Changeset 14887
- Timestamp:
- 05/04/13 12:39:45 (12 years ago)
- Location:
- issm/trunk-jpl/src/c/toolkits/gsl
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/toolkits/gsl/DenseGslSolve.cpp
r14877 r14887 23 23 class Parameters; 24 24 25 void DenseGslSolve(/*output*/ Issm Double** px,/*stiffness matrix:*/ IssmDouble* Kff, int Kff_M, int Kff_N, /*right hand side load vector: */ IssmDouble* pf, int pf_M, Parameters* parameters){25 void DenseGslSolve(/*output*/ IssmPDouble** px,/*stiffness matrix:*/ IssmPDouble* Kff, int Kff_M, int Kff_N, /*right hand side load vector: */ IssmPDouble* pf, int pf_M, Parameters* parameters){ /*{{{*/ 26 26 27 27 /*Intermediary: */ … … 30 30 if(Kff_M!=Kff_N)_error_("Stiffness matrix should be square!"); 31 31 32 #ifdef _HAVE_ADOLC_ 33 ensureContiguousLocations(Kff_N); 34 #endif 35 IssmDouble *x = xNew<IssmDouble>(Kff_N); 36 37 #ifdef _HAVE_ADOLC_ 38 SolverxSeq(x,Kff,pf,Kff_N,parameters); 39 #else 32 IssmPDouble *x = xNew<IssmPDouble>(Kff_N); 40 33 SolverxSeq(x,Kff,pf,Kff_N); 41 #endif42 34 43 35 /*allocate output pointers: */ 44 36 *px=x; 45 }46 47 void SolverxSeq(IssmPDouble **pX, IssmPDouble *A, IssmPDouble *B,int n){ /*{{{*/48 49 /*Allocate output*/50 double* X = xNew<double>(n);51 52 /*Solve*/53 SolverxSeq(X,A,B,n);54 55 /*Assign output pointer*/56 *pX=X;57 37 } 58 38 /*}}}*/ … … 220 200 } 221 201 /*}}}*/ 202 void DenseGslSolve(/*output*/ IssmDouble** px,/*stiffness matrix:*/ IssmDouble* Kff, int Kff_M, int Kff_N, /*right hand side load vector: */ IssmDouble* pf, int pf_M, Parameters* parameters){ /*{{{*/ 203 204 /*Intermediary: */ 205 206 if(Kff_N!=pf_M)_error_("Right hand side vector of size " << pf_M << ", when matrix is of size " << Kff_M << "-" << Kff_N << " !"); 207 if(Kff_M!=Kff_N)_error_("Stiffness matrix should be square!"); 208 209 ensureContiguousLocations(Kff_N); 210 IssmDouble *x = xNew<IssmDouble>(Kff_N); 211 212 SolverxSeq(x,Kff,pf,Kff_N,parameters); 213 214 /*allocate output pointers: */ 215 *px=x; 216 } 217 /*}}}*/ 222 218 void SolverxSeq(IssmDouble *X,IssmDouble *A,IssmDouble *B,int n, Parameters* parameters){/*{{{*/ 223 219 // pack inputs to conform to the EDF-prescribed interface … … 240 236 /*}}}*/ 241 237 #endif 238 -
issm/trunk-jpl/src/c/toolkits/gsl/gslincludes.h
r14877 r14887 22 22 void DenseGslSolve(IssmDouble** px, IssmDouble* Kff,int Kff_M, int Kff_N, IssmDouble* pf, int pf_M, Parameters* parameters); 23 23 24 void SolverxSeq(IssmPDouble **pX, IssmPDouble *A, IssmPDouble *B,int n);25 24 void SolverxSeq(IssmPDouble *X, IssmPDouble *A, IssmPDouble *B,int n); 26 25
Note:
See TracChangeset
for help on using the changeset viewer.