mathnet-numerics icon indicating copy to clipboard operation
mathnet-numerics copied to clipboard

Symmetric matrices

Open alexkaratarakis opened this issue 12 years ago • 2 comments

Adds symmetric matrices.

-Symmetric class family SquareMatrix->SymmetricMatrix->SymmetricDenseMatrix

There are some choices that need to be made here: a) The transpose of a symmetric matrix is the same as the original matrix. This means that Tranpose() can simply return "this". However, this has the pitfall of not being a separate entity and thus changes to the "transposed" affect the original. Since there was a Unit test explicitly checking for NotSameObject, Transpose() return this.clone().

b) Writing the symmetric matrix: [i,j] & [j,i] point to the same element. Modifying the strictly lower triangle is disabled to avoid hard to debug errors. See issue 39 (https://github.com/mathnet/mathnet-numerics/issues/39) for more information.

  • Indexer class family This uses the recently introduced MatrixStorage. The Storages used for Symmetric Matrices also have an Indexer as a separate class. The same indexer is used for Triangular matrices so its worth having it separately to avoid duplication. Included is a hierarchy to cover Indexers, StaticIndexers, (in contrast to DynamicIndexers used by formats such as Skyline) and PackedStorage with an implemented UpperPackedStorage.
  • Commits 99b710a [Matrix.Arithmetic] Matrix-Matrix operations that CreateMatrix() request a fullyMutable matrix 94747be [MatrixTests.Arithmetic] Fix reversed CanKroneckerProduct() test method names

are the only ones (I think) that modify existing files. They are bug fixes that can be independently cherry picked for master.

alexkaratarakis avatar Nov 26 '12 20:11 alexkaratarakis

Impressive, thanks!

FYI, currently in mainline in the la-symmetric branch.

cdrnet avatar Dec 02 '12 15:12 cdrnet

This feature could be really useful for my use case. Do you still plan to merge it to master ?

Fread75 avatar Dec 13 '19 06:12 Fread75