Re: [eigen] Valid use case for creating a SparseMatrix?

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


Hi,

> why not. We could also make it explicit by allowing Dynamic for the sizes:
> 
> SparseMatrix<...> mat(Dynamic,Dynamic)
> // insertions
> mat.finalize();
> 
> mat.resize(Dynamic,Dynamic);
> // insertions
> mat.finalize();

How do I resize to the actual dimensions? I mean at some point I have to
set them.
Will mat.resize(rows, cols) work?

> And one could make it Dynamic in only one dimension.
> 
> gael
> 
> what about a conservativeResize(rows,cols) function. You would still
> be responsible of tracking the largest "inner" index, and to call
> conservativeResize() anytime you

That sounds like a good approach to me. I just want to know whether it
is useful to others as well. I don't like to extend the API with a
feature that nobody cares about. It may even lead to misunderstandings.
But the above it should be pretty convenient.

Jens



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/