mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-05-04 17:54:07 +08:00
Fix SparseVector::coeffRef(i,j) and add missing SparseVector::insert*Unordered
This commit is contained in:
parent
1ed9e2d004
commit
460662cbcc
@ -109,7 +109,7 @@ class SparseVector
|
|||||||
inline Scalar& coeffRef(Index row, Index col)
|
inline Scalar& coeffRef(Index row, Index col)
|
||||||
{
|
{
|
||||||
eigen_assert(IsColVector ? (col==0 && row>=0 && row<m_size) : (row==0 && col>=0 && col<m_size));
|
eigen_assert(IsColVector ? (col==0 && row>=0 && row<m_size) : (row==0 && col>=0 && col<m_size));
|
||||||
return coeff(IsColVector ? row : col);
|
return coeffRef(IsColVector ? row : col);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** \returns a reference to the coefficient value at given index \a i
|
/** \returns a reference to the coefficient value at given index \a i
|
||||||
@ -152,6 +152,18 @@ class SparseVector
|
|||||||
return m_data.value(m_data.size()-1);
|
return m_data.value(m_data.size()-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Scalar& insertBackByOuterInnerUnordered(Index outer, Index inner)
|
||||||
|
{
|
||||||
|
EIGEN_UNUSED_VARIABLE(outer);
|
||||||
|
eigen_assert(outer==0);
|
||||||
|
return insertBackUnordered(inner);
|
||||||
|
}
|
||||||
|
inline Scalar& insertBackUnordered(Index i)
|
||||||
|
{
|
||||||
|
m_data.append(0, i);
|
||||||
|
return m_data.value(m_data.size()-1);
|
||||||
|
}
|
||||||
|
|
||||||
inline Scalar& insert(Index row, Index col)
|
inline Scalar& insert(Index row, Index col)
|
||||||
{
|
{
|
||||||
eigen_assert(IsColVector ? (col==0 && row>=0 && row<m_size) : (row==0 && col>=0 && col<m_size));
|
eigen_assert(IsColVector ? (col==0 && row>=0 && row<m_size) : (row==0 && col>=0 && col<m_size));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user