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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2168 - (hide annotations)
Wed Dec 17 00:50:37 2008 UTC (12 years, 11 months ago) by artak
File MIME type: text/plain
File size: 1133 byte(s)
methods are added for loading right-hand-side from MM format
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 2165 dim_t i,n,level=1;
11 artak 2160
12     if (argc<2) {
13     fprintf(stderr,"Please enter the filename\n");
14     return -1;
15     }
16 artak 2165
17 artak 2168 if (argc>2) {
18 artak 2165 level=atoi(argv[2]);
19     }
20 artak 2160
21     A=MEMALLOC(1,Paso_SystemMatrix);
22    
23     A=Paso_SystemMatrix_loadMM_toCSR(argv[1]);
24     if (A==NULL) {
25 artak 2165 fprintf(stderr,"CSR Matrix not Loaded\n");
26 artak 2160 return 0;
27     }
28     n=Paso_SystemMatrix_getTotalNumRows(A);
29     b=MEMALLOC(n,double);
30     x=MEMALLOC(n,double);
31 artak 2168
32     if(argc==4) {
33     Paso_RHS_loadMM_toCSR(argv[3],b,n);
34 artak 2160 }
35 artak 2168 else {
36     for(i=0;i<n;i++) {
37     b[i]=1;
38     }
39     }
40 artak 2160
41 artak 2168
42 artak 2165 Paso_test_run(A,b,level);
43 artak 2160 MEMFREE(b);
44     MEMFREE(x);
45     Paso_SystemMatrix_free(A);
46     return 1;
47     }

  ViewVC Help
Powered by ViewVC 1.1.26