switch to enums everywhere

This commit is contained in:
Benoit Jacob
2008-01-10 20:45:35 +00:00
parent 209cf7c91f
commit 45a4b61b5f
29 changed files with 162 additions and 107 deletions

View File

@@ -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);