1 |
#include <stdio.h> |
2 |
#include "paso/Common.h" |
3 |
#include "paso/Solver.h" |
4 |
#include "paso/SystemMatrix.h" |
5 |
#include "Paso_tests.h" |
6 |
|
7 |
int main (int argc, char *argv[]) { |
8 |
Paso_SystemMatrix *A = NULL; |
9 |
double *b,*x; |
10 |
dim_t i,n; |
11 |
|
12 |
if (argc<2) { |
13 |
fprintf(stderr,"Please enter the filename\n"); |
14 |
return -1; |
15 |
} |
16 |
|
17 |
A=MEMALLOC(1,Paso_SystemMatrix); |
18 |
|
19 |
A=Paso_SystemMatrix_loadMM_toCSR(argv[1]); |
20 |
if (A==NULL) { |
21 |
printf("CSR Matrix not Loaded\n"); |
22 |
return 0; |
23 |
} |
24 |
n=Paso_SystemMatrix_getTotalNumRows(A); |
25 |
b=MEMALLOC(n,double); |
26 |
x=MEMALLOC(n,double); |
27 |
for(i=0;i<n;i++) |
28 |
{ |
29 |
b[i]=1; |
30 |
} |
31 |
|
32 |
Paso_test_run(A,b,1); |
33 |
|
34 |
MEMFREE(b); |
35 |
MEMFREE(x); |
36 |
Paso_SystemMatrix_free(A); |
37 |
return 1; |
38 |
} |