-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutil_test.cpp
More file actions
52 lines (40 loc) · 1.16 KB
/
util_test.cpp
File metadata and controls
52 lines (40 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// Test file for utilities.cpp
#include<fstream>
#include"utilities.h"
#include<iostream>
using namespace std;
extern "C" double dtrsyl_(char* trana, char* tranb, int* isgn, int* orda, int* ordb, double* A, int* lda, double* B, int* ldb, double* C, int* ldc, double* scale, int* info);
int main()
{
ifstream ipfile;
int SIZE;
ipfile.open("inputMatrix.ascii");
SIZE = MatSize(ipfile);
double epsilon = 0.02;
ofstream opfile;
double *test[SIZE];
double *P[SIZE];
double *Q[SIZE];
for(int i=0; i<SIZE; i++)
{
test[i] = new double[SIZE];
P[i] = new double[SIZE];
Q[i] = new double[SIZE];
}
cout << "Epsilon = " << epsilon << endl;
cout << "SIZE = " <<SIZE <<endl;
loadMat(ipfile, test, SIZE);
opfile.open("epsVsSSA.ascii", ios::trunc);
double ssa;
for(epsilon = 0.001; epsilon < 0.1; epsilon += 0.001)
{
cout << "Epsilon = " <<epsilon << endl;
ssa = SimpleSSA(test, P, Q, epsilon, SIZE);
opfile << epsilon << " " << ssa << endl;
}
for(int i=0; i<SIZE; i++)
{
delete[] test[i];
}
return 0;
}