1 |
/* $Id$ */ |
2 |
|
3 |
/**************************************************************/ |
4 |
|
5 |
/* Paso: interface to the direct solvers */ |
6 |
|
7 |
/**************************************************************/ |
8 |
|
9 |
/* Copyrights by ACcESS Australia 2003 */ |
10 |
/* Author: gross@access.edu.au */ |
11 |
|
12 |
/**************************************************************/ |
13 |
|
14 |
#include "Paso.h" |
15 |
#include "Solvers/Solver.h" |
16 |
|
17 |
#ifdef SCSL |
18 |
#include "SCSL/SCSL.h" |
19 |
#endif |
20 |
|
21 |
#ifdef MKL |
22 |
#include "MKL/MKL.h" |
23 |
#endif |
24 |
|
25 |
#ifdef UMFPACK |
26 |
#include "UFMPACK/UMFPACK.h" |
27 |
#endif |
28 |
|
29 |
/**************************************************************/ |
30 |
|
31 |
void Paso_solve(Paso_SystemMatrix* A, |
32 |
double* out, |
33 |
double* in, |
34 |
Paso_Options* options) { |
35 |
|
36 |
Paso_resetError(); |
37 |
if (A->num_rows!=A->num_cols || A->col_block_size!=A->row_block_size) { |
38 |
Paso_setError(VALUE_ERROR,"__FILE__: matrix has to be a square matrix."); |
39 |
return; |
40 |
} |
41 |
index_t package=Paso_Options_getPackage(options->method,options->package,options->symmetric); |
42 |
if (Paso_noError()) { |
43 |
switch(package) { |
44 |
|
45 |
case PASO_PASO: |
46 |
Paso_Solver(A,out,in,options); |
47 |
break; |
48 |
|
49 |
#ifdef SCSL |
50 |
case PASO_SCSL: |
51 |
Paso_SCSL(A,out,in,options); |
52 |
break; |
53 |
#endif |
54 |
|
55 |
/* |
56 |
case PASO_MKL: |
57 |
Paso_MKL(A,out,in,options); |
58 |
break; |
59 |
*/ |
60 |
|
61 |
/* |
62 |
case PASO_UMFPACK: |
63 |
Paso_UMFPACK(A,out,in,options); |
64 |
break; |
65 |
*/ |
66 |
|
67 |
default: |
68 |
Paso_setError(VALUE_ERROR,"__FILE__: unknown package code"); |
69 |
return; |
70 |
} |
71 |
} |
72 |
return; |
73 |
} |
74 |
|
75 |
/* free memory possibly resereved for a recall */ |
76 |
|
77 |
void Paso_solve_free(Paso_SystemMatrix* in) { |
78 |
Paso_Solver_free(in); |
79 |
#ifdef SCSL |
80 |
Paso_SCSL_free(in); |
81 |
#endif |
82 |
/* Paso_MKL_free(A,out,in,options); */ |
83 |
/* Paso_UMFPACK_free(A,out,in,options); */ |
84 |
return; |
85 |
} |
86 |
/* |
87 |
* $Log$ |
88 |
* Revision 1.2 2005/09/15 03:44:39 jgs |
89 |
* Merge of development branch dev-02 back to main trunk on 2005-09-15 |
90 |
* |
91 |
* Revision 1.1.2.2 2005/09/07 00:59:08 gross |
92 |
* some inconsistent renaming fixed to make the linking work. |
93 |
* |
94 |
* Revision 1.1.2.1 2005/09/05 06:29:49 gross |
95 |
* These files have been extracted from finley to define a stand alone libray for iterative |
96 |
* linear solvers on the ALTIX. main entry through Paso_solve. this version compiles but |
97 |
* has not been tested yet. |
98 |
* |
99 |
* |
100 |
*/ |