[Dune] defining a matrix

Aleksejs Fomins aleksejs.fomins at lspr.ch
Thu Jul 31 15:57:36 CEST 2014


Dear Dune,

I require to define a square matrix of real numbers within dune, which I
then need to invert and then read off the entries.

I would define the matrix via
FieldMatrix< ctype, nrows, ncols> M;

then I would enter its elements using
M[i][j] = something(i, j)

then I would invert it using
M.invert();

Finally I would read off the entries using
something_else[i][j] = M[i,j]


The matrix will have integer dimension, nrows = ncols = n <= 56. It
would be convenient if n can be passed dynamically, which already
disagrees with what is written in the reference, namely "The number of
rows and columns is given at compile time. ". Maybe it is still possible
somehow?



Please tell me if this is correct. If not, I would be grateful if you
could advise me how to improve this.


Thank you,
Aleksejs Fomins



-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 551 bytes
Desc: OpenPGP digital signature
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20140731/4a6fc8f7/attachment.sig>


More information about the Dune mailing list