Ignore:
Timestamp:
08/31/12 17:23:24 (13 years ago)
Author:
Eric.Larour
Message:

NEW: large change to the code, to adapt to ADOLC requirements.

This change relates to the introduction of template classes and functions for the
Option.h abstract class. This is needed, because we want to make the Matlab
API independent from the libCore objects, which are dependent on the IssmDouble*
ADOLC type (adouble), when the Matlab API is dependent on the IssmPDouble* type (double).

To make them independent, we need to be able to specify at run time Options, Matrix and
Vector objects that hold either IssmDouble or IssmPDouble objects. The only way to do
that is through the use of templated classes for Option.h, Matrix and Vector.

The change gets rid of a lot of useless code (especially in the classes/objects/Options
directory), by introducing template versions of the same code.

The bulk of the changes to src/modules and src/mex modules is to adapt to this
new runtime declaration of templated Matrix, Vector and Option objects.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/modules/TriMeshx/TriMeshx.cpp

    r12860 r13216  
    2020/*}}}*/
    2121
    22 void TriMeshx(Matrix** pindex,Vector** px,Vector** py,Matrix** psegments,Vector** psegmentmarkerlist,DataSet* domain,DataSet* rifts,double area){
     22void TriMeshx(Matrix<IssmDouble>** pindex,Vector<IssmDouble>** px,Vector<IssmDouble>** py,Matrix<IssmDouble>** psegments,Vector<IssmDouble>** psegmentmarkerlist,DataSet* domain,DataSet* rifts,double area){
    2323
    2424        /*indexing: */
     
    2727        /*output: */
    2828        double* index=NULL;
    29         Matrix* index_matrix=NULL;
     29        Matrix<IssmDouble>* index_matrix=NULL;
    3030        double* x=NULL;
    3131        double* y=NULL;
    3232        double* segments=NULL;
    33         Matrix* segments_matrix=NULL;
     33        Matrix<IssmDouble>* segments_matrix=NULL;
    3434        double* segmentmarkerlist=NULL;
    3535
     
    192192
    193193        /*Output : */
    194         index_matrix=new Matrix(index,out.numberoftriangles,3,1,SeqMatType);
     194        index_matrix=new Matrix<IssmDouble>(index,out.numberoftriangles,3,1,SeqMatType);
    195195        *pindex=index_matrix;
    196196       
    197         segments_matrix=new Matrix(segments,out.numberofsegments,3,1,SeqMatType);
     197        segments_matrix=new Matrix<IssmDouble>(segments,out.numberofsegments,3,1,SeqMatType);
    198198        *psegments=segments_matrix;
    199199
    200         *px=new Vector(x,out.numberofpoints,SeqMatType);
    201         *py=new Vector(y,out.numberofpoints,SeqMatType);
    202         *psegmentmarkerlist=new Vector(segmentmarkerlist,out.numberofsegments,SeqMatType);
     200        *px=new Vector<IssmDouble>(x,out.numberofpoints,SeqMatType);
     201        *py=new Vector<IssmDouble>(y,out.numberofpoints,SeqMatType);
     202        *psegmentmarkerlist=new Vector<IssmDouble>(segmentmarkerlist,out.numberofsegments,SeqMatType);
    203203}
Note: See TracChangeset for help on using the changeset viewer.