mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/sta-peak.git
synced 2025-06-12 02:45:59 +00:00
added frobenius matrix norm
This commit is contained in:
parent
45dfd20464
commit
8d02d21b8d
@ -61,9 +61,13 @@ float norm(matrix m) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// todo: implement different matrix norms
|
float sum = 0;
|
||||||
|
for(int i=0; i<m.get_rows(); i++) {
|
||||||
return 0;
|
for(int j=0; j<m.get_cols(); j++) {
|
||||||
|
sum += m(i, j)*m(i, j);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return std::sqrt(sum);
|
||||||
|
|
||||||
};
|
};
|
||||||
matrix normalize(matrix m) {
|
matrix normalize(matrix m) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user