mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
add constructors and accessors/mutators specific to small vectors.
Add corresponding unit-test.
This commit is contained in:
@@ -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;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user