Re: [eigen] Sparse Arrays for Eigen?

[ Thread Index | Date Index | More Archives ]

If there is an input-method you want Eigen::Sparse to have, we are generally open to include it (if it's reasonably useful).

I would suggest something like:

template<class IndexT, class ValueT>
    Eigen::Tensor<IndexT, 1> const &index0,
    Eigen::Tensor<IndexT, 1> const &index1,
    Eigen::Tensor<ValueT, 1> const &values)

As long as Eigen::Tensor is flexible enough, and can be constructed from pre-existing memory, then this constructor will cover all reasonable cases.  For example, the existing triplets constructor would become (technically) obsolete, as long as Eigen::Tensor supports arrays with non-unit stride.

If I just absolutely love spsparse and want to construct Eigen::SparseMatrix from it, then I'd be able to write my own little constructor pretty easily that converts my internal std::vector<> into Eigen::Tensor.

-- Elizabeth

Mail converted by MHonArc 2.6.19+