Deep refactoring.

1) Kill MatrixXpr class, instead let all class inherit a common EigenBase class
2) Kill MatrixBase/Matrix/Vector classes, instead introduce a single Matrix class,
a MatrixStorage class, and typedefs to emulate vectors
3) Huge code cleanup, remove large preprocessor macros, sloccount drop to ~750
down from 1100.
4) Introduce compile-time-known sizes
This commit is contained in:
Benoit Jacob
2007-09-26 14:06:14 +00:00
parent 1af61c6ff0
commit 55227b1f63
18 changed files with 612 additions and 1048 deletions

View File

@@ -30,43 +30,32 @@ namespace Eigen
{
template<typename MatrixType> class MatrixRef
: public EigenBase<typename MatrixType::Scalar, MatrixRef<MatrixType> >
{
public:
typedef typename ForwardDecl<MatrixType>::Scalar Scalar;
typedef MatrixXpr<MatrixRef<MatrixType> > Xpr;
typedef typename MatrixType::Scalar Scalar;
friend class EigenBase<Scalar, MatrixRef>;
MatrixRef(MatrixType& matrix) : m_matrix(matrix) {}
MatrixRef(const MatrixRef& other) : m_matrix(other.m_matrix) {}
~MatrixRef() {}
static bool hasDynamicNumRows()
{
return MatrixType::hasDynamicNumRows();
}
INHERIT_ASSIGNMENT_OPERATORS(MatrixRef)
static bool hasDynamicNumCols()
{
return MatrixType::hasDynamicNumCols();
}
int rows() const { return m_matrix.rows(); }
int cols() const { return m_matrix.cols(); }
private:
int _rows() const { return m_matrix.rows(); }
int _cols() const { return m_matrix.cols(); }
const Scalar& read(int row, int col) const
Scalar _read(int row, int col) const
{
return m_matrix.read(row, col);
}
Scalar& write(int row, int col)
Scalar& _write(int row, int col)
{
return m_matrix.write(row, col);
}
Xpr xpr()
{
return Xpr(*this);
}
protected:
MatrixType& m_matrix;
};