Finish project 2

This commit is contained in:
2025-09-18 09:06:36 +02:00
parent e62c42bb2c
commit fededb4ed3
13 changed files with 688 additions and 1 deletions
+23
View File
@@ -0,0 +1,23 @@
#include "include/helpers.hpp"
#include <iostream>
#include <armadillo>
using namespace std;
using namespace arma;
int main(){
// Setup of the test matrix
mat A = {{1., 0., 0., 0.5},
{0., 1., -0.7, 0.},
{0., -0.7, 1., 0.},
{0.5, 0., 0., 1.}};
// Call the function
int k, l;
double max_val = max_offdiag_symmetric(A, k, l);
// Print the results
cout << "Max off-diagonal value: " << max_val << " at (" << k << ", " << l << ")" << endl;
return 0;
}