add constructors and accessors/mutators specific to small vectors.

Add corresponding unit-test.
This commit is contained in:
Benoit Jacob
2007-12-17 20:51:40 +00:00
parent f75a0c5179
commit 53040f53d9
6 changed files with 127 additions and 6 deletions

View File

@@ -186,6 +186,16 @@ template<typename Scalar, typename Derived> class MatrixBase
}
Scalar& operator[](int index) { return coeffRef(index, UserDebugging); }
Scalar x() const { return coeff(0, UserDebugging); }
Scalar y() const { return coeff(1, UserDebugging); }
Scalar z() const { return coeff(2, UserDebugging); }
Scalar w() const { return coeff(3, UserDebugging); }
Scalar& x() { return coeffRef(0, UserDebugging); }
Scalar& y() { return coeffRef(1, UserDebugging); }
Scalar& z() { return coeffRef(2, UserDebugging); }
Scalar& w() { return coeffRef(3, UserDebugging); }
Eval<Derived> eval() const EIGEN_ALWAYS_INLINE;
};