Finish project 2
This commit is contained in:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user