symmetric_matrix operation

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 built-in 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 "boost-way" to deal with this?

Hi Archie14,
hth:
# include
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 built-in 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 "boost-way" to deal with this?
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (2)
-
Archie14
-
Kim Kuen Tang