Changeset 13062


Ignore:
Timestamp:
08/16/12 09:25:56 (13 years ago)
Author:
Eric.Larour
Message:

CHG: used IssmPDouble instead of double for Solver prototype -> simplified code layout

Location:
issm/trunk-jpl/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/ad/todo

    r12688 r13062  
    4343
    4444Replace memcpy, realloc with x layers.  Replace all calls to malloc and free in the code.
     45
     46
     47
     48Questions:
     49set of active IssmDouble variables different from set of independent variables activated with <<=?
     50same thing dependent variables?
  • issm/trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp

    r13056 r13062  
    5656        /*Intermediary: */
    5757        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;
    6161
    6262        /*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]);
    6767       
    6868        /*Call wrapped solver: */
    69         SolverxSeq(&doubleX,doubleA, doubleB, n);
     69        SolverxSeq(&pdoubleX,pdoubleA, pdoubleB, n);
    7070
    7171        /*Transfer solution vector from double to IssmDouble: */
    7272        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]);
    7474
    7575        /*Free ressources:*/
    76         xDelete<double>(doubleA);
    77         xDelete<double>(doubleB);
     76        xDelete<IssmPDouble>(pdoubleA);
     77        xDelete<IssmPDouble>(pdoubleB);
    7878
    7979        /*Assign output pointers: */
     
    8282/*}}}*/
    8383#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
     84void SolverxSeq(IssmPDouble** pX,IssmPDouble* A,IssmPDouble* B,int n){ //{{{
    9085        #ifdef _HAVE_GSL_
    9186        /*GSL Matrices and vectors: */
Note: See TracChangeset for help on using the changeset viewer.