Boost logo

Ublas :

Subject: [ublas] sparse matrix resize()
From: Ernest Turro (ernest.turro_at_[hidden])
Date: 2009-02-27 10:26:31


I've noticed that resize() with data preservation is not implemented
for sparse matrices (matrix_sparse.hpp:2791). Does anyone have any
suggestions on how to get around that efficiently? The following comes
to mind but I'd appreciate comments: create a temporary copy of the
matrix; resize the original matrix without data preservation; iterate
through non-zero elements of the temporary matrix and copy them to the
original matrix. If this is a good idea, could someone please advise
how to iterate only over non-zero elements?

Many thanks,

Run-time error:

Check failed in file /opt/local/include/boost/numeric/ublas/
matrix_sparse.hpp at line 2791:
terminate called after throwing an instance of
  what(): internal logic
Abort trap