- move CompressedStorage and AmbiVector into internal namespace

- remove innerVectorNonZeros(j) => use innerVector(j).nonZeros()
This commit is contained in:
Gael Guennebaud
2011-12-02 10:00:24 +01:00
parent a0bcaa88af
commit f10bae74e8
8 changed files with 27 additions and 22 deletions

View File

@@ -86,7 +86,7 @@ template<typename _Scalar, int _Options, typename _Index>
typedef DynamicSparseMatrix<Scalar,(Flags&~RowMajorBit)|(IsRowMajor?RowMajorBit:0)> TransposedSparseMatrix;
Index m_innerSize;
std::vector<CompressedStorage<Scalar,Index> > m_data;
std::vector<internal::CompressedStorage<Scalar,Index> > m_data;
public:
@@ -96,8 +96,8 @@ template<typename _Scalar, int _Options, typename _Index>
inline Index outerSize() const { return static_cast<Index>(m_data.size()); }
inline Index innerNonZeros(Index j) const { return m_data[j].size(); }
std::vector<CompressedStorage<Scalar,Index> >& _data() { return m_data; }
const std::vector<CompressedStorage<Scalar,Index> >& _data() const { return m_data; }
std::vector<internal::CompressedStorage<Scalar,Index> >& _data() { return m_data; }
const std::vector<internal::CompressedStorage<Scalar,Index> >& _data() const { return m_data; }
/** \returns the coefficient value at given position \a row, \a col
* This operation involes a log(rho*outer_size) binary search.

View File

@@ -177,7 +177,7 @@ void SparseLLT<_MatrixType,Backend>::compute(const _MatrixType& a)
m_matrix.resize(size, size);
// allocate a temporary vector for accumulations
AmbiVector<Scalar,Index> tempVector(size);
internal::AmbiVector<Scalar,Index> tempVector(size);
RealScalar density = a.nonZeros()/RealScalar(size*size);
// TODO estimate the number of non zeros
@@ -222,7 +222,7 @@ void SparseLLT<_MatrixType,Backend>::compute(const _MatrixType& a)
RealScalar rx = internal::sqrt(internal::real(x));
m_matrix.insert(j,j) = rx; // FIXME use insertBack
Scalar y = Scalar(1)/rx;
for (typename AmbiVector<Scalar,Index>::Iterator it(tempVector, m_precision*rx); it; ++it)
for (typename internal::AmbiVector<Scalar,Index>::Iterator it(tempVector, m_precision*rx); it; ++it)
{
// FIXME use insertBack
m_matrix.insertBack(it.index(), j) = it.value() * y;