Files
FYS4150/src/project2/off_diagonal_finder.cpp
T
2025-09-18 09:06:36 +02:00

23 lines
523 B
C++

#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;
}