5template <
int Rows,
int Cols,
typename Scalar>
7 const Matrix<Rows, Cols, Scalar>& matrix,
11 for (
int i = 0;
i < Rows;
i++) {
12 for (
int j = 0;
j < Cols;
j++) {
13 result(i) += matrix(i, j) * vector(j);
23template <
int Rows,
int Cols,
typename Scalar>
30 for (
int i = 0; i < Rows; i++) {
31 for (
int j = 0; j < Cols; j++) {
32 r(i) += alpha * matrix(i, j) * v(j);
38template <
int Rows,
int Cols,
typename Scalar>
40 const Matrix<Rows, Cols, Scalar>& matrix,
43 return multiply(matrix, vector);
47template <
int Rows,
int Cols>
49 const Matrix<Rows, Cols, double>& matrix,
71template <
int Size,
typename Scalar>
77 for (
int i = 0;
i <
Size;
i++) {
78 for (
int j = 0;
j <
Size;
j++) {
79 result(j, i) = lhs(j) *
rhs(i);
Matrix< Rows, Cols, Scalar > multiply(const Matrix< Rows, X, Scalar > &lhs, const Matrix< X, Cols, Scalar > &rhs)
Performs a matrix x matrix multiplication.
void matVec(const Matrix< Rows, Cols, Scalar > &matrix, Scalar alpha, const Vector< Cols, Scalar > &v, Vector< Rows, Scalar > &r)
Compute r = r + alpha * M * v in-situ.
Matrix< Size, Size, Scalar > outerDot(const Vector< Size, Scalar > &lhs, const Vector< Size, Scalar > &rhs)
Outer dot product.
Matrix< Rows, Cols, Scalar > operator*(const Matrix< Rows, X, Scalar > &lhs, const Matrix< X, Cols, Scalar > &rhs)