Closed SebastianSemper closed 5 years ago
A little bit more insight:
If one is able to apply A^2 and A^2^H, where A^2 is elementwise squaring, one can apply these to a vector containing all ones and then draw a square root element wise of the result, to get the row or colum norms respectively.
Moreover if the classes could provide not only their norms, but squared norms, one could use this in cases like the blockdiag or diag blocks or blocks to calculate the norm of nested matrizes.
since this is something, we might be using a lot, it might be worth to spend some effort in providing these methods.
so if I understood correctly, you are suggesting to add the following properties to the base class?:
.colNorm
.rowNorm
.colSuaredNorm
.rowSquaredNorm
.colNormalized
.rowNormalized
Each one of these gets the full shadowing and overloading interface, of course. (e.g. .colNorm
also gets ._colNorm
, .colSquaredNorm
, .colNormalized
)
In the process .normalized
would be removed.
No
Am Fr., 9. Nov. 2018, 19:38 hat Christoph Wagner notifications@github.com geschrieben:
so if I understood correctly, you are suggesting to add the following properties to the base class?:
.colNorm .rowNorm .colSuaredNorm .rowSquaredNorm .colNormalized .rowNormalized
Each one of these gets the full shadowing and overloading interface, of course. (e.g. .colNorm also gets ._colNorm, .colSquaredNorm, .colNormalized)
In the process .normalized would be removed.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/EMS-TU-Ilmenau/fastmat/issues/8#issuecomment-437454442, or mute the thread https://github.com/notifications/unsubscribe-auth/ABDZRiP1k5NpYC5jrVFyM7T29RKVCMuGks5utcujgaJpZM4P6cNb .
Update:
.columnNorms
.rowNorms
.columnNormalized
.rowNormalized
Problem
Currently we offer a
Matrix.normalized()
function, which returnsMatrix * Diag
such that this matrices columns are normalized. This yields certain drawbacks:There is no obvious way to tell, that the columns of the matrix are normalized. So the name is a little bit to abiguous.
We need to differentiate between column and row normalization, since both features are needed in various contexts.
Solution
Implement
Matrix.colNormalized
, which returnsMatrix * Diag
andMatrix.rowNormalized
, which returnsDiag * Matrix
.Profit
The
Product
class allows nifty normalization...