summaryrefslogtreecommitdiff
path: root/test/math/gauss.cpp
diff options
context:
space:
mode:
authorGloria Mundi <gloria@gloria-mundi.eu>2024-11-16 21:17:29 +0100
committerGloria Mundi <gloria@gloria-mundi.eu>2024-11-16 21:17:29 +0100
commit1880ccb6d85c6eb79e724593457877bab431951c (patch)
tree23eddd5bd0b29b3024e170a5ef9023eda9226ab5 /test/math/gauss.cpp
parente95f59debd69ee7d45d5c966ce466d23264e1c3c (diff)
get rid of all() and sz()
Diffstat (limited to 'test/math/gauss.cpp')
-rw-r--r--test/math/gauss.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/test/math/gauss.cpp b/test/math/gauss.cpp
index 6e4759d..eb8f641 100644
--- a/test/math/gauss.cpp
+++ b/test/math/gauss.cpp
@@ -7,10 +7,10 @@ vector<vector<double>> mat;
#include <math/gauss.cpp>
vector<vector<double>> inverseMat(const vector<vector<double>>& m) {
- int n = sz(m);
+ int n = ssize(m);
mat = m;
for (int i = 0; i < n; i++) {
- if (sz(mat[i]) != n) cerr << "error: no square matrix" << FAIL;
+ if (ssize(mat[i]) != n) cerr << "error: no square matrix" << FAIL;
mat[i].resize(2*n);
mat[i][n+i] = 1;
}
@@ -27,10 +27,10 @@ vector<vector<double>> inverseMat(const vector<vector<double>>& m) {
}
vector<vector<double>> mul(const vector<vector<double>>& a, const vector<vector<double>>& b) {
- int n = sz(a);
- int m = sz(b[0]);
- int x = sz(b);
- if (sz(a[0]) != sz(b)) cerr << "error: wrong dimensions" << FAIL;
+ int n = ssize(a);
+ int m = ssize(b[0]);
+ int x = ssize(b);
+ if (ssize(a[0]) != ssize(b)) cerr << "error: wrong dimensions" << FAIL;
vector<vector<double>> res(n, vector<double>(m));
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
@@ -48,21 +48,21 @@ void test_tiny() {
{0, 5, 6, 7},
{0, 0, 8, 9},
};
- if (gauss(sz(mat)) != UNIQUE) cerr << "error: 1" << FAIL;
+ if (gauss(ssize(mat)) != UNIQUE) cerr << "error: 1" << FAIL;
mat = {
{-1, 1, 0, -1},
{ 2, 6, 0, 10},
{ 1, -2, 0, 0},
};
- if (gauss(sz(mat)) != MULTIPLE) cerr << "error: 2" << FAIL;
+ if (gauss(ssize(mat)) != MULTIPLE) cerr << "error: 2" << FAIL;
mat = {
{-1, 1, 0, -1},
{ 2, 6, 0, 10},
{ 1, -2, 0, 1},
};
- if (gauss(sz(mat)) != INCONSISTENT) cerr << "error: 3" << FAIL;
+ if (gauss(ssize(mat)) != INCONSISTENT) cerr << "error: 3" << FAIL;
}
void stress_test_inv() {