mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-04 19:20:41 +08:00
add .data() member to Diagonal<>
This commit is contained in:
parent
18e3ac0f0d
commit
670e3af5a8
@ -101,6 +101,15 @@ template<typename MatrixType, int DiagIndex> class Diagonal
|
||||
return 0;
|
||||
}
|
||||
|
||||
typedef typename internal::conditional<
|
||||
internal::is_lvalue<MatrixType>::value,
|
||||
Scalar,
|
||||
const Scalar
|
||||
>::type ScalarWithConstIfNotLvalue;
|
||||
|
||||
inline ScalarWithConstIfNotLvalue* data() { return &(m_matrix.const_cast_derived().coeffRef(rowOffset(), colOffset())); }
|
||||
inline const Scalar* data() const { return &(m_matrix.const_cast_derived().coeffRef(rowOffset(), colOffset())); }
|
||||
|
||||
inline Scalar& coeffRef(Index row, Index)
|
||||
{
|
||||
EIGEN_STATIC_ASSERT_LVALUE(MatrixType)
|
||||
|
Loading…
x
Reference in New Issue
Block a user