On this page
Eigen::MatrixBase
template<typename Derived>
class Eigen::MatrixBase< Derived >
Base class for all dense matrices, vectors, and expressions.
This class is the base that is inherited by all matrix, vector, and related expression types. Most of the Eigen API is contained in this class, and its base classes. Other important classes for the Eigen API are Matrix, and VectorwiseOp.
Note that some methods are defined in other modules such as the LU module LU module for all functions related to matrix inversions.
- Template Parameters
-
Derived is the derived type, e.g. a matrix type, or an expression, etc.
When writing a function taking Eigen objects as argument, if you want your function to take as argument any matrix, vector, or expression, just let it take a MatrixBase argument. As an example, here is a function printFirstRow which, given a matrix, vector, or expression x, prints the first row of x.
template<typename Derived>
void printFirstRow(const Eigen::MatrixBase<Derived>& x)
{
cout << x.row(0) << endl;
}
This class can be extended with the help of the plugin mechanism described on the page Extending MatrixBase (and other classes) by defining the preprocessor symbol EIGEN_MATRIXBASE_PLUGIN.
- See also
- The class hierarchy