Boost logo

Ublas :

From: Gunter Winkler (guwi17_at_[hidden])
Date: 2008-08-21 17:01:32

Am Mittwoch, 20. August 2008 13:38 schrieb Nizar Khalifa Sallem:
> Hi,
> I thinks there is a mistake in this documentation page
>htm but not sure (for version 1.36  also). Anyway the questions are :
> 1- how axpy_prod (const vector_expression< E1 > &e1, const
> matrix_expression< E2 > &e2, V &v, bool init=true) could compute v +=
> A x or v = A x and v += AT x or v = AT x knowing that there is no
> params to indicate whether to transpose or not. Shouldn't one of the
> axpy_prod be an opb_prod? 2 - axpy_prod (const matrix_expression< E1
> > &e1, const matrix_expression< E2 > &e2, M &m, bool init=true) and 
> opb_prod (const matrix_expression< E1 > &e1, const matrix_expression<
> E2 > &e2, M &m, bool init=true) seem to compute the same thing (based
> on the doc)  M += A X or M = A X. Shouldn't one of them compute M +=
> AT X or M = AT X? Can somebody lighten me?
> Thanks

most products can be called in two ways:

prod(A, x) which computes A x
prod(x, A) which computes A^T x

the prod(), axpy_prod() and opb_prod() are different implementations for
the same thing. Depending on the size of the matrix one of the three
products is faster than the other two.

the transposed matrix-product is a little more tricky, because
axpy_prod(A, X, Y) and axpy_prod(X, A, Y) have the same signature. Thus
you have to use axpy_prod(trans(A), X, Y)