Boost logo

Boost :

Subject: Re: [boost] different matrix library?
From: joel (joel.falcou_at_[hidden])
Date: 2009-08-15 10:34:27


DE wrote:
> suppose i'm a not too experienced programmer and i want to express that
> my function foo() takes a column vector as a parameter
> considering 'matrix' and 'vector' be distinct types i would write:
>
> void foo(const lib::vector<some_type> &v);
>
> it is type safe and the intent is very clear
> as foo() author i know that i get v.size() by 1 matrix (actually a vector)
> and can access elements with subscript operator[]
> it is common and it is among the first things every programmer learns
>
> how would i deal with generic matrix
Using latest NT2 interface, you'll use a semi-statically bound matrix :

void foo( nt2::matrix<T, settings( OfSize<unspec, 1>)> const& v );

-- 
___________________________________________
Joel Falcou - Assistant Professor
PARALL Team - LRI - Universite Paris Sud XI
Tel : (+33)1 69 15 66 35

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk