mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-04-23 10:09:36 +08:00
add a missing operator= for copying a matrix into an expression.
This commit is contained in:
parent
13a82795f7
commit
9477e62b68
@ -211,6 +211,16 @@ class MatrixBase
|
|||||||
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>
|
template<typename Derived>
|
||||||
std::ostream & operator <<
|
std::ostream & operator <<
|
||||||
( std::ostream & s,
|
( std::ostream & s,
|
||||||
|
@ -105,6 +105,9 @@ template<typename Content> class MatrixXpr
|
|||||||
this->operator()(i, j) = other(i, j);
|
this->operator()(i, j) = other(i, j);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<typename Derived>
|
||||||
|
void operator=(const MatrixBase<Derived>& matrix);
|
||||||
|
|
||||||
MatrixXpr<MatrixRow<MatrixXpr<Content> > > row(int i);
|
MatrixXpr<MatrixRow<MatrixXpr<Content> > > row(int i);
|
||||||
MatrixXpr<MatrixCol<MatrixXpr<Content> > > col(int i);
|
MatrixXpr<MatrixCol<MatrixXpr<Content> > > col(int i);
|
||||||
MatrixXpr<MatrixMinor<MatrixXpr<Content> > > minor(int row, int col);
|
MatrixXpr<MatrixMinor<MatrixXpr<Content> > > minor(int row, int col);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user