Boost logo

Ublas :

Subject: Re: [ublas] multiarray subarray and matrix
From: David Bellot (david.bellot_at_[hidden])
Date: 2010-03-31 07:33:42


why not simply put your matrices into a vector:

std::vector<matrix<T>> multi;

You can then access to any element like this:

multi(i)(j,k)

and work on single matrices like that, for example:

matrix<T> result = multi(i) + multi(j);

The first dimension will always reference a matrix and the two inner
dimensions are coordinates in your matrix.

Then all possible combinations are possible:

vector<T> v = my_vector + row(multi(i) , t);

T p = inner_prod(v , col(multi(i), t);

etc....

Hope it helps.
David

-- 
David Bellot, PhD
david.bellot_at_[hidden]
http://david.bellot.free.fr