Updated by Alexander Shishkov about 13 years ago

There is a header for 1D SparseMat [[SparseMat]] ptr in core.hpp

//! returns pointer to the specified element (1D case)
uchar* ptr(int i0, bool createMissing, size_t* hashval=0);

but the implementation in matrix.cpp is missing. This results in linker errors as soon as any of ptr, ref, value, find for 1D sparse arrays is used. Current workaround is to use the nD version by using a reference to the index:

int size = {10};
SparseMat_<float> [[SparseMat]]_<float> a_sparse_vector(1, size);
int index_to_sparse_vector = 5;
a_sparse_vector.ref(&index_to_sparse_vector) = 0.1f;

Normally, this should work:
a_sparse_vector.ref(5) = 0.1f;
but it does not due to the missing implementation.

Back