Changeset 13062
- Timestamp:
- 08/16/12 09:25:56 (13 years ago)
- Location:
- issm/trunk-jpl/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/ad/todo
r12688 r13062 43 43 44 44 Replace memcpy, realloc with x layers. Replace all calls to malloc and free in the code. 45 46 47 48 Questions: 49 set of active IssmDouble variables different from set of independent variables activated with <<=? 50 same thing dependent variables? -
issm/trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp
r13056 r13062 56 56 /*Intermediary: */ 57 57 int i; 58 double*doubleA=NULL;59 double*doubleB=NULL;60 double*doubleX=NULL;58 IssmPDouble* pdoubleA=NULL; 59 IssmPDouble* pdoubleB=NULL; 60 IssmPDouble* pdoubleX=NULL; 61 61 62 62 /*First, transfer from IssmDouble to double all our matrices and vectors: */ 63 doubleA=xNew<double>(n*n);64 doubleB=xNew<double>(n);65 for(i=0;i<n*n;i++) A[i]>>=doubleA[i];66 for(i=0;i<n;i++) B[i]>>=doubleB[i];63 pdoubleA=xNew<double>(n*n); 64 pdoubleB=xNew<double>(n); 65 for(i=0;i<n*n;i++)pdoubleA[i]=reCast<IssmPDouble>(A[i]); 66 for(i=0;i<n;i++)pdoubleB[i]=reCast<IssmPDouble>(B[i]); 67 67 68 68 /*Call wrapped solver: */ 69 SolverxSeq(& doubleX,doubleA,doubleB, n);69 SolverxSeq(&pdoubleX,pdoubleA, pdoubleB, n); 70 70 71 71 /*Transfer solution vector from double to IssmDouble: */ 72 72 X = xNew<IssmDouble>(n); 73 for(i=0;i<n;i++)X[i] <<=doubleX[i];73 for(i=0;i<n;i++)X[i]=reCast<IssmDouble>(pdoubleX[i]); 74 74 75 75 /*Free ressources:*/ 76 xDelete< double>(doubleA);77 xDelete< double>(doubleB);76 xDelete<IssmPDouble>(pdoubleA); 77 xDelete<IssmPDouble>(pdoubleB); 78 78 79 79 /*Assign output pointers: */ … … 82 82 /*}}}*/ 83 83 #endif 84 //void SolverxSeq(double** pX,double* A,double* B,int n){ //{{{ 85 #ifdef _HAVE_ADOLC_ 86 void SolverxSeq(double** pX,double* A,double* B,int n){ 87 #else 88 void SolverxSeq(IssmDouble** pX,IssmDouble* A,IssmDouble* B,int n){ 89 #endif 84 void SolverxSeq(IssmPDouble** pX,IssmPDouble* A,IssmPDouble* B,int n){ //{{{ 90 85 #ifdef _HAVE_GSL_ 91 86 /*GSL Matrices and vectors: */
Note:
See TracChangeset
for help on using the changeset viewer.