mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/sta-peak.git
synced 2025-06-10 18:16:00 +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
|
||||
|
||||
return 0;
|
||||
float sum = 0;
|
||||
for(int i=0; i<m.get_rows(); i++) {
|
||||
for(int j=0; j<m.get_cols(); j++) {
|
||||
sum += m(i, j)*m(i, j);
|
||||
}
|
||||
}
|
||||
return std::sqrt(sum);
|
||||
|
||||
};
|
||||
matrix normalize(matrix m) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user