Boost logo

Ublas :

From: Gunter Winkler (guwi17_at_[hidden])
Date: 2007-03-05 10:16:15


On Monday 05 March 2007 15:34, Preben Hagh Strunge Holm wrote:
> The project-function?
> Could you explain what should be going on here?

http://www.boost.org/libs/numeric/ublas/doc/operations_overview.htm
section about submatrix/subvector

> I'll look more into the sparse matrix. Sometimes there are only 3 or 6
> elements in the matrix of size 72x72 (that's below 25% "I think").

In this case you should definitely use a sparse matrix. Inserting elements is
simple. You can either use
1) a(i,j) = value; // may be slow if the matrix has already many nonzeros
2) a.insert_element(i,j,value); // is equivalent to 1)
3) a.push_back(i,j,value); // is O(1) but requires a specific ordering

Please have a look at the documentation.

mfg
Gunter