Boost logo

Boost :

From: Joerg Walter (jhr.walter_at_[hidden])
Date: 2002-09-30 14:37:39


----- Original Message -----
From: "Toon Knapen" <toon.knapen_at_[hidden]>
To: <boost_at_[hidden]>
Cc: "Karl Meerbergen" <karl.meerbergen_at_[hidden]>
Sent: Monday, September 30, 2002 1:43 PM
Subject: [boost] ublas: leading dimension

> For our ublas bindings to BLAS, we need to know the leading dimension of
the
> matrix in case a matrix_row is passed to some BLAS1 or BLAS2 function.
> Is there some function foreseen for this and if not could we introduce
this ?

There is no such function currently. But something like

template<class M>
std::size_t leading_dimension (const M &m) {
    typedef typename M::functor_type functor_type;
    return functor_type ().one1 (m.size1 (), m.size2 ()) *
              functor_type ().one2 (m.size1 (), m.size2 ());
}

or

template<class M>
std::size_t leading_dimension (const M &m) {
    typedef typename M::functor_type functor_type;
    return m.size1 () / functor_type ().one1 (m.size1 (), m.size2 ()) *
              m.size2 () / functor_type ().one2 (m.size1 (), m.size2 ());
}

(I'm currently a bit confused about the leading dimension ;-) should do the
job for dense matrices.

Regards

Joerg


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