How can I get the number of elements per row form the matrix?
Hi,
how can I compute the number of elements of a particular row of the coefficient matrix? I know how to compute the totals of the lower, upper and diagonal part e.g. int elements_lower_triangle = matrix.lower().size() + matrix.diag().size(); int elements_upper_triangle = matrix.upper().size() + matrix.diag().size(); Klaus |
I have been thinking of modifying the following code which is used to print a matrix
Code:
for(int i = 0; i < matrix_.lower().size(); i++){ Code:
0 1 2 3 |
Quick note: I was looking into answering another thread of yours and while deducing how to do things, I remembered that gdbOF does what you're looking for: https://openfoamwiki.net/index.php/Contrib_gdbOF
If you look into the manual they provide, in the appendices are the pseudo-code blocks that tell how the matrices are reconstructed... which is what you're looking for here... |
All times are GMT -4. The time now is 11:47. |