mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-02-17 18:09:55 +08:00
add a missing operator= for copying a matrix into an expression.
This commit is contained in:
parent
13a82795f7
commit
9477e62b68
@ -15,4 +15,4 @@ endif (CMAKE_COMPILER_IS_GNUCXX)
|
||||
include_directories( ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} )
|
||||
|
||||
add_subdirectory(src)
|
||||
add_subdirectory(test)
|
||||
add_subdirectory(test)
|
||||
|
@ -211,6 +211,16 @@ class MatrixBase
|
||||
MatrixBase() {};
|
||||
};
|
||||
|
||||
template<typename Content>
|
||||
template<typename Derived>
|
||||
void MatrixXpr<Content>::operator=(const MatrixBase<Derived>& matrix)
|
||||
{
|
||||
assert(rows() == matrix.rows() && cols() == matrix.cols());
|
||||
for(int i = 0; i < rows(); i++)
|
||||
for(int j = 0; j < cols(); j++)
|
||||
this->operator()(i, j) = matrix(i, j);
|
||||
}
|
||||
|
||||
template<typename Derived>
|
||||
std::ostream & operator <<
|
||||
( std::ostream & s,
|
||||
|
@ -105,6 +105,9 @@ template<typename Content> class MatrixXpr
|
||||
this->operator()(i, j) = other(i, j);
|
||||
}
|
||||
|
||||
template<typename Derived>
|
||||
void operator=(const MatrixBase<Derived>& matrix);
|
||||
|
||||
MatrixXpr<MatrixRow<MatrixXpr<Content> > > row(int i);
|
||||
MatrixXpr<MatrixCol<MatrixXpr<Content> > > col(int i);
|
||||
MatrixXpr<MatrixMinor<MatrixXpr<Content> > > minor(int row, int col);
|
||||
|
Loading…
Reference in New Issue
Block a user