18#ifndef EIGEN_DENSE_MATRIX_HPP
19#define EIGEN_DENSE_MATRIX_HPP
21#include <external/Eigen/Dense>
22#include <external/Eigen/IterativeLinearSolvers>
23#include <external/EigenUnsupported/Eigen/IterativeSolvers>
43template <
typename T,
int StorageOrder = Eigen::ColMajor>
47 using MatrixType = Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic, StorageOrder>;
63 return (*matrix_)(
row,
col);
110 matrix_->setConstant(
a);
129 xd.raw_matrix() = matrix_->partialPivLu().solve(
bd.raw_matrix());
203 virtual const T*
data()
const override
204 {
return matrix_->data(); };
212 {
return matrix_->data(); };
222 return matrix_->norm();
233 return matrix_->colwise().sum().array().abs().maxCoeff();
244 return matrix_->rowwise().sum().array().abs().maxCoeff();
254 return matrix_->fullPivLu().rank();
Eigen-based dense matrix wrapper.
void add_block(const MatrixBase< T > &x, Index row_start, Index col_start, const T &a=T(1)) override
Adds a block of values to this matrix from the values of a given matrix, starting at a given position...
void mat_solve(MatrixBase< T > &x, const MatrixBase< T > &b) override
Solves for matrix with a direct solver, where is this matrix, and is a given right-hand side matr...
T frobenius_norm() const
Returns the Frobenius norm of the matrix, defined as the square root of the sum of the squares of all...
void set_value(Index row, Index col, const T &a) override
Sets the matrix value at the specified row and column.
virtual T * data() override
Returns a writable pointer to the underlying raw data - use with care.
void get_block(MatrixBase< T > &x, Index row_start, Index col_start, Index b_rows, Index b_cols) const override
Retrieves a block of values from this matrix.
Index rank() const
Computes the rank of the matrix.
void add_value(Index row, Index col, const T &a) override
Adds to the matrix value at the specified row and column.
void scale(const T &a) override
Scales all matrix entries by a given value.
void set_block(const MatrixBase< T > &x, Index row_start, Index col_start, const T &a=T(1)) override
Sets a block of values in this matrix to the values of a given matrix, starting at a given position.
T value(Index row, Index col) const override
Returns the matrix value at the specified row and column.
virtual const T * data() const override
Returns a read-only pointer to the underlying raw data.
void set_constant(const T &a)
Sets all matrix entries to a given constant value.
T infinity_norm() const
Returns the infinity-norm of the matrix, computed by taking the sum of absolute values of all columns...
T one_norm() const
Returns the one-norm of the matrix, computed by taking the sum of absolute values of all rows for eac...
Base class for Eigen-based matrices.
Eigen::Matrix< T, N, 1 > EigColVecN
Fixed-size column vector of size N containing type T.
std::size_t Index
Unsigned integer type for indices and container sizes.
Primary namespace for the OpenBEM library.