Boost logo

Boost Users :

From: speedsnaii speedsnaii_at_[hidden])
Date: 2003-02-26 04:56:46


I think I found out now, what I was missing. I am working with
expressions now, and so I have to refer to the arguments as

arg().size()

But this still leaves me with even more questions:

Why would I prefer:

template<class E>
void foo(const vector_expression<E>& arg)
{
    arg().size();
}

over

template<class V>
void foo(const V& arg)
{
    arg.size();
}

?

When rethinking my problem it seems to me as if I would need to
decide whether my algorithm should work on expressions or on
containers. But where is my container? vector is a container and an
expression. This confuses me somewhat.
Ok, my original question was of how to
foo(m.column(0)) or foo(m.row(1))
and this automatically made an expression from my rows/cols.
So creating my subroutine in a way is implementing an algorithm. But
as I feel this is different from what uBLAS does in functional.hpp,
isn't it?

What I originally was looking for was a container concept similar to
std::vector that extends to matrix. I am aware that uBLAS is much
more powerful, but leaves me with the question of how to write my own
subroutines. Could you Joerg or anyone else give me some ideas of how
to do this (conceptually simple) task or point me to some example
code?

Thank you for your help,
Roland


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net