
Boost Users : 
Subject: [Boostusers] symmetric_matrix operation
From: Archie14 (admin_at_[hidden])
Date: 20090526 13:50:53
I am very new to the whole Ublas library. I have two symmetric matrices and I
need to divide each element of the first matrix to the element in the second
matrix. I am now doing smth like this:
int _matrixsize;
symmetric_matrix<double> mfirst(_matrixsize);
symmetric_matrix<double> msecond(_matrixsize);
symmetric_matrix<double> ratio (_matrixsize);
for (int ifirst = 0; ifirst < _matrixsize; ifirst++)
for (int isecond = 0; isecond < _matrixsize; isecond++)
ratio(ifirst, isecond) = mfirst(ifirst, isecond) / msecond
(ifirst, isecond);
My questions are:
1. Can I use iterators (begin1, begin2) and if yes, then how? Examples in the
doc use above method of iterating through elements, without using iterators.
2. I did not find builtin operators in the symmetric_matrix to do this
division, but may be I overlooked smth or did not understand the docs?
3. If matrix "msecond" contains zeros  what is the "boostway" to deal with
this?
Boostusers 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