
Ublas : 
Subject: [ublas] [Question] submatrix by columns
From: Marcel Rehberg (Marcel.Rehberg_at_[hidden])
Date: 20101119 11:04:29
Hello,
I have a rather large matrix and I try to access submatrices based on
columns. For example I would like to access the 3rd, 5th, and 9th column.
Since the intervals between the columns I need are not regular a basic
stride won't work. I'd figured I could use the more general
matrix_indirect however I couldn't get that to work, plus I would have to
index the rows too, which would be unnecessary.
I guess I could also use a large combination of two element strides but
how does that inflict on performance?
My last resort would be to rearrange the columns to a more regular order
and try to use strides then.
Or maybe I just overlooking a most basic and simple solution.
btw: Regarding the error for the matrix_indirect: For indexing I tried to
use ublas::matrix<unsigned> but that got me several
boost_1_44_0/boost/numeric/ublas/matrix_proxy.hpp:4381: error: no type
named â€˜const_iteratorâ€™ in â€˜class boost::numeric::ublas::matrix<unsigned
int, boost::numeric::ublas::basic_row_major<unsigned int, int>,
boost::numeric::ublas::unbounded_array<unsigned int,
std::allocator<unsigned int> > >â€™
and
boost/numeric/ublas/matrix_proxy.hpp:4220: error: â€˜const class
boost::numeric::ublas::matrix<unsigned int,
boost::numeric::ublas::basic_row_major<unsigned int, int>,
boost::numeric::ublas::unbounded_array<unsigned int,
std::allocator<unsigned int> > >â€™ has no member named â€˜preprocessâ€™
However, I tried also matrix_vector_indirect with ublas::vector<unsigned>
for indexing and it worked.
Thanks for any help.
Marcel
 Marcel Rehberg Center for Systems Biology (ZBSA) AG Modeling and Scientific Computing Habsburger Str. 49 79104 Freiburg Germany phone: +49 (0)761 20397159 http://omnibus.unifreiburg.de/~dl954/