Boost logo

Ublas :

Subject: Re: [ublas] Slicing
From: Markus Weimer (mailinglists2008_at_[hidden])
Date: 2008-11-27 11:23:37


Hi Ralf and other knowledgeables,

thanks for your hint. This seems to work, but not in my case. I want
to set some elements of a row of a matrix based on the multiplication
of a one matrix with a subset of the columns of another one. Sounds a
bit complicated and it probably is:

> ublas::row(G, i) = ublas::row(ublas::prod(GF, X), j);

G and X are dense ublas::matrix<double>. I want to ignore the same
columns in G and X. However, I cannot even define an indirect array as
suggested via:

> ublas::indirect_array<ublas::matrix_row<ublas::matrix<double> > >
> g_indices;

I get the following error:

> boost/numeric/ublas/storage.hpp:1281: error: no type named
> 'const_pointer' in 'class boost::numeric::ublas::matrix_row<...>'

The same happens when I try to define the index on X. Could it be that
indices are only possible on "real" vectors as opposed to
vector_expressions?

Thanks again for your support!

Markus

> I don't think that such a "\setminus" slice is possible in ublas. If
> I understood your question correctly, then you have to set up (in a
> loop or so) an
>
> ublas::indirect_array<> relevant(len);
>
> containing the relevant indices, i.e. all those *not* belonging to
> the slice, and than use
>
> new_vec = ublas::project(vec, relevant);
>
> to get only the relevant values out of vec.
>
> At least I'm doing something similar in my code ...
>
> Ciao
>
> Ralf
>
>
>> Hi,
>>
>> I'd like to take a given vector_expression v and get one that
>> contains
>> all the entries in it, but not the ones in a range of indices. The
>> docs
>> only describe the opposite case it seems. Is it possible to
>> construct a
>> vector-slice in my case?
>>
>> Thanks in advance,
>>
>> Markus
> _________________________________________________________________________
> Sensationsangebot nur bis 30.11: WEB.DE FreeDSL - Telefonanschluss +
> DSL
> für nur 16,37 Euro/mtl.!* http://dsl.web.de/?
> ac=OM.AD.AD008K13805B7069a
>
> _______________________________________________
> ublas mailing list
> ublas_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/ublas