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

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

Parent Directory Parent Directory | Revision Log Revision Log


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