/[escript]/trunk/paso/src/solve.c
ViewVC logotype

Annotation of /trunk/paso/src/solve.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1028 - (hide annotations)
Wed Mar 14 00:15:24 2007 UTC (12 years, 7 months ago) by gross
File MIME type: text/plain
File size: 3688 byte(s)
modifications to be compliant with _WIN32. The substitutes for asinh, acosh, atanh are still missing (erf will through an exception)
1 jgs 150 /* $Id$ */
2    
3 dhawcroft 631
4     /*
5     ********************************************************************************
6 dhawcroft 633 * Copyright 2006 by ACcESS MNRF *
7 dhawcroft 631 * *
8     * http://www.access.edu.au *
9     * Primary Business: Queensland, Australia *
10     * Licensed under the Open Software License version 3.0 *
11     * http://www.opensource.org/licenses/osl-3.0.php *
12     ********************************************************************************
13     */
14    
15 jgs 150 /**************************************************************/
16    
17     /* Paso: interface to the direct solvers */
18    
19     /**************************************************************/
20    
21     /* Copyrights by ACcESS Australia 2003 */
22     /* Author: gross@access.edu.au */
23    
24     /**************************************************************/
25    
26     #include "Paso.h"
27 gross 584 #include "performance.h"
28 gross 700 #include "Solver.h"
29 jgs 150
30     #ifdef SCSL
31 gross 411 #include "SCSL.h"
32 jgs 150 #endif
33    
34     #ifdef MKL
35 gross 411 #include "MKL.h"
36 jgs 150 #endif
37    
38     #ifdef UMFPACK
39 gross 411 #include "UMFPACK.h"
40 jgs 150 #endif
41    
42     /**************************************************************/
43    
44     void Paso_solve(Paso_SystemMatrix* A,
45     double* out,
46     double* in,
47     Paso_Options* options) {
48 gross 584 Paso_Performance pp;
49 gross 1028 index_t package;
50 jgs 150 Paso_resetError();
51     if (A->num_rows!=A->num_cols || A->col_block_size!=A->row_block_size) {
52 gross 415 Paso_setError(VALUE_ERROR,"Paso_solve: matrix has to be a square matrix.");
53 jgs 150 return;
54     }
55 gross 584 Performance_open(&pp,options->verbose);
56 gross 1028 package=Paso_Options_getPackage(options->method,options->package,options->symmetric);
57 jgs 150 if (Paso_noError()) {
58     switch(package) {
59    
60     case PASO_PASO:
61 gross 584 Paso_Solver(A,out,in,options,&pp);
62 gross 727 A->solver_package=PASO_PASO;
63 jgs 150 break;
64    
65     #ifdef SCSL
66     case PASO_SCSL:
67 gross 584 Paso_SCSL(A,out,in,options,&pp);
68 gross 727 A->solver_package=PASO_SCSL;
69 jgs 150 break;
70     #endif
71    
72 gross 425
73     #ifdef MKL
74 jgs 150 case PASO_MKL:
75 gross 584 Paso_MKL(A,out,in,options,&pp);
76 gross 727 A->solver_package=PASO_MKL;
77 jgs 150 break;
78 gross 425 #endif
79 jgs 150
80 gross 805 #ifdef UMFPACK
81 jgs 150 case PASO_UMFPACK:
82 gross 806 Paso_UMFPACK(A,out,in,options,&pp);
83 gross 727 A->solver_package=PASO_UMFPACK;
84 jgs 150 break;
85 gross 805 #endif
86 jgs 150
87     default:
88 gross 415 Paso_setError(VALUE_ERROR,"Paso_solve: unknown package code");
89 gross 584 break;
90 jgs 150 }
91     }
92 gross 584 Performance_close(&pp,options->verbose);
93 jgs 150 return;
94     }
95    
96     /* free memory possibly resereved for a recall */
97    
98     void Paso_solve_free(Paso_SystemMatrix* in) {
99 gross 727
100 gross 425 switch(in->solver_package) {
101    
102     case PASO_PASO:
103 jgs 150 Paso_Solver_free(in);
104 gross 425 break;
105    
106     #ifdef SCSL
107     case PASO_SCSL:
108 jgs 150 Paso_SCSL_free(in);
109 gross 425 break;
110     #endif
111    
112    
113     #ifdef MKL
114     case PASO_MKL:
115     Paso_MKL_free(in);
116     break;
117     #endif
118    
119 gross 806 #ifdef UMFPACK
120 gross 425 case PASO_UMFPACK:
121     Paso_UMFPACK_free(in);
122     break;
123 gross 806 #endif
124 gross 425 }
125 jgs 150 }
126     /*
127     * $Log$
128     * Revision 1.2 2005/09/15 03:44:39 jgs
129     * Merge of development branch dev-02 back to main trunk on 2005-09-15
130     *
131     * Revision 1.1.2.2 2005/09/07 00:59:08 gross
132     * some inconsistent renaming fixed to make the linking work.
133     *
134     * Revision 1.1.2.1 2005/09/05 06:29:49 gross
135     * These files have been extracted from finley to define a stand alone libray for iterative
136     * linear solvers on the ALTIX. main entry through Paso_solve. this version compiles but
137     * has not been tested yet.
138     *
139     *
140     */

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.26