mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-04 11:10:40 +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;
|
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)
|
inline Scalar& coeffRef(Index row, Index)
|
||||||
{
|
{
|
||||||
EIGEN_STATIC_ASSERT_LVALUE(MatrixType)
|
EIGEN_STATIC_ASSERT_LVALUE(MatrixType)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user