mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
switch to enums everywhere
This commit is contained in:
@@ -70,10 +70,10 @@
|
||||
* \c Matrix<double,3,5>.
|
||||
*
|
||||
* Note that most of the API is in the base class MatrixBase, and that the base class
|
||||
* MatrixStorage also provides the MatrixStorage::resize() public method.
|
||||
* MatrixStorage also provides the MatrixStorage::recoeffs() public method.
|
||||
*/
|
||||
template<typename _Scalar, int _Rows, int _Cols,
|
||||
MatrixStorageOrder _StorageOrder = EIGEN_DEFAULT_MATRIX_STORAGE_ORDER>
|
||||
int _StorageOrder = EIGEN_DEFAULT_MATRIX_STORAGE_ORDER>
|
||||
class Matrix : public MatrixBase<_Scalar, Matrix<_Scalar, _Rows, _Cols, _StorageOrder> >,
|
||||
public MatrixStorage<_Scalar, _Rows, _Cols>
|
||||
{
|
||||
@@ -96,8 +96,11 @@ class Matrix : public MatrixBase<_Scalar, Matrix<_Scalar, _Rows, _Cols, _Storage
|
||||
{ return Storage::m_data; }
|
||||
|
||||
private:
|
||||
static const int RowsAtCompileTime = _Rows, ColsAtCompileTime = _Cols;
|
||||
static const MatrixStorageOrder StorageOrder = _StorageOrder;
|
||||
enum {
|
||||
RowsAtCompileTime = _Rows,
|
||||
ColsAtCompileTime = _Cols,
|
||||
StorageOrder = _StorageOrder
|
||||
};
|
||||
|
||||
Ref _ref() const { return Ref(*this); }
|
||||
|
||||
@@ -132,12 +135,12 @@ class Matrix : public MatrixBase<_Scalar, Matrix<_Scalar, _Rows, _Cols, _Storage
|
||||
if(RowsAtCompileTime == 1)
|
||||
{
|
||||
assert(other.isVector());
|
||||
resize(1, other.size());
|
||||
resize(1, other.coeffs());
|
||||
}
|
||||
else if(ColsAtCompileTime == 1)
|
||||
{
|
||||
assert(other.isVector());
|
||||
resize(other.size(), 1);
|
||||
resize(other.coeffs(), 1);
|
||||
}
|
||||
else resize(other.rows(), other.cols());
|
||||
return Base::operator=(other);
|
||||
|
||||
Reference in New Issue
Block a user