/[escript]/trunk/paso/profiling/Test.c
ViewVC logotype

Annotation of /trunk/paso/profiling/Test.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2160 - (hide annotations)
Tue Dec 16 03:29:54 2008 UTC (12 years, 7 months ago) by artak
File MIME type: text/plain
File size: 965 byte(s)
Testing envirounment for PASO
1 artak 2160 #include <stdio.h>
2     #include "paso/Common.h"
3     #include "paso/Solver.h"
4     #include "paso/SystemMatrix.h"
5     #include "paso/Paso_tests.h"
6    
7     int main (int argc, char *argv[]) {
8     Paso_SystemMatrix *A = NULL;
9     double *b,*x,S;
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     }

  ViewVC Help
Powered by ViewVC 1.1.26