--- In Boost-Users@yahoogroups.com, jhr.walter@t... wrote:
----- Original Message ----- From: Mike Hayford To: Boost-Users@yahoogroups.com Sent: Tuesday, December 31, 2002 8:20 AM Subject: [Boost-Users] ublas - newbie question and comment
Problem: write the product of a diagonal matrix and a vector when
stuff clipped... the
diagonal matrix is stored as a vector.
I'd use a banded_matrix with number of upper and lower diagonals set to zero. Another strategy could be to add an expression tree node class for this operation based on vector_binary.
The banded_matrix approach is straightforward. Here's what I wound up
with:
int n = 5;
vector<double> x(n), y(n), diag(n);
banded_matrix<double> dMat(n, n, 0, 0);
matrix_vector_slice