Re: [eigen] What is StorageKind?

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


Currently it is mainly used to select the appropriate implementation
of each expression type and to select the appropriate base class. For
instance, you can use Transpose<> on both dense and sparse objects to
get the type of a transposed expression:

Transpose<MatrixXf>
Transpose<SparseMatrix<double> >

both are the same class (there is no partial specialization at this
stage), but they inherit an "implementation" template class which is
specialized for each kind of storage type, which themselves inherit
the proper base class (e.g., MatrixBase or SparseMatrixBase).

For instance, the implementation class for dense storage has to
provide the coeff() methods only, and for sparse an InnerIterator.

The same principle applies to other expression types (CwiseUnaryOp, etc...)

This is way it is relatively easy to support expression template for a
new fancy kind of storage while focusing on the specific
implementation details rather than on re-implementing the
expression-template logic.

hope that helps,

gael

On Wed, Jul 21, 2010 at 6:13 PM, Manoj Rajagopalan <rmanoj@xxxxxxxxx> wrote:
> Hi eigen developers,
>
>  I see this typedef in many Eigen classes. IIUC, it can be either Dense or
> Sparse. Is it's purpose "to be used in meta-ifs to decide on algorithm for
> implementing products etc."?
>
> thanks,
> Manoj
>
>
>



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