Changeset 12466


Ignore:
Timestamp:
06/19/12 15:22:27 (13 years ago)
Author:
utke
Message:

type rename plus one generic include to make the typedef'ed name known

Location:
issm/trunk-jpl/src/c/Container
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/Container/Container.h

    r12410 r12466  
    66#define  _CONTAINER_CONTAINER_H_
    77
     8#include "../include/include.h"
    89#include "./DataSet.h"
    910#include "./Constraints.h"
  • issm/trunk-jpl/src/c/Container/DataSet.cpp

    r12459 r12466  
    6060        if(sorted_ids){
    6161                copy->sorted_ids=xNew<int>(objects.size());
    62                 memcpy(copy->sorted_ids,sorted_ids,objects.size()*sizeof(int));
     62                xMemCpy<int>(copy->sorted_ids,sorted_ids,objects.size());
    6363        }
    6464        if(id_offsets){
    6565                copy->id_offsets=xNew<int>(objects.size());
    66                 memcpy(copy->id_offsets,id_offsets,objects.size()*sizeof(int));
     66                xMemCpy<int>(copy->id_offsets,id_offsets,objects.size());
    6767        }
    6868
  • issm/trunk-jpl/src/c/Container/Elements.cpp

    r12459 r12466  
    173173        int    *resultssizes  = NULL;
    174174        int    *resultssteps  = NULL;
    175         double *resultstimes = NULL;
    176         double *vector_serial= NULL;
     175        IssmDouble *resultstimes = NULL;
     176        IssmDouble *vector_serial= NULL;
    177177        Vector*     vector       = NULL;
    178178        bool   io_gather;
     
    217217                        resultsenums=xNew<int>(numberofresults);
    218218                        resultssizes=xNew<int>(numberofresults);
    219                         resultstimes=xNew<double>(numberofresults);
     219                        resultstimes=xNew<IssmDouble>(numberofresults);
    220220                        resultssteps=xNew<int>(numberofresults);
    221221                }
     
    250250                        /*clean up*/
    251251                        xdelete(&vector);
    252                         xDelete<double>(vector_serial);
     252                        xDelete<IssmDouble>(vector_serial);
    253253                }
    254254        }
     
    272272        xDelete<int>(resultssizes);
    273273        xDelete<int>(resultssteps);
    274         xDelete<double>(resultstimes);
     274        xDelete<IssmDouble>(resultstimes);
    275275        delete patch;
    276276}
  • issm/trunk-jpl/src/c/Container/Inputs.cpp

    r12365 r12466  
    9393}
    9494/*}}}*/
    95 /*FUNCTION Inputs::GetInputValue(double* pvalue,int enum-type){{{*/
    96 void Inputs::GetInputValue(double* pvalue,int enum_type){
     95/*FUNCTION Inputs::GetInputValue(IssmDouble* pvalue,int enum-type){{{*/
     96void Inputs::GetInputValue(IssmDouble* pvalue,int enum_type){
    9797
    9898        vector<Object*>::iterator object;
     
    122122/*}}}*/
    123123/*FUNCTION Inputs::GetInputAverage{{{*/
    124 void Inputs::GetInputAverage(double* pvalue,int enum_type){
     124void Inputs::GetInputAverage(IssmDouble* pvalue,int enum_type){
    125125
    126126        vector<Object*>::iterator object;
     
    206206/*}}}*/
    207207/*FUNCTION Inputs::ConstrainMin{{{*/
    208 void  Inputs::ConstrainMin(int constrain_enum, double minimum){
     208void  Inputs::ConstrainMin(int constrain_enum, IssmDouble minimum){
    209209           
    210210        Input* constrain_input=NULL;
     
    220220/*}}}*/
    221221/*FUNCTION Inputs::InfinityNorm{{{*/
    222 double Inputs::InfinityNorm(int enumtype){
    223 
    224         /*Output*/
    225         double norm;
     222IssmDouble Inputs::InfinityNorm(int enumtype){
     223
     224        /*Output*/
     225        IssmDouble norm;
    226226
    227227        /*Get input*/
     
    241241/*}}}*/
    242242/*FUNCTION Inputs::Max{{{*/
    243 double Inputs::Max(int enumtype){
    244 
    245         /*Output*/
    246         double max;
     243IssmDouble Inputs::Max(int enumtype){
     244
     245        /*Output*/
     246        IssmDouble max;
    247247
    248248        /*Get input*/
     
    262262/*}}}*/
    263263/*FUNCTION Inputs::MaxAbs{{{*/
    264 double Inputs::MaxAbs(int enumtype){
    265 
    266         /*Output*/
    267         double max;
     264IssmDouble Inputs::MaxAbs(int enumtype){
     265
     266        /*Output*/
     267        IssmDouble max;
    268268
    269269        /*Get input*/
     
    283283/*}}}*/
    284284/*FUNCTION Inputs::Min{{{*/
    285 double Inputs::Min(int enumtype){
    286 
    287         /*Output*/
    288         double min;
     285IssmDouble Inputs::Min(int enumtype){
     286
     287        /*Output*/
     288        IssmDouble min;
    289289
    290290        /*Get input*/
     
    304304/*}}}*/
    305305/*FUNCTION Inputs::MinAbs{{{*/
    306 double Inputs::MinAbs(int enumtype){
    307 
    308         /*Output*/
    309         double min;
     306IssmDouble Inputs::MinAbs(int enumtype){
     307
     308        /*Output*/
     309        IssmDouble min;
    310310
    311311        /*Get input*/
     
    406406/*}}}*/
    407407/*FUNCTION Inputs::AXPY{{{*/
    408 void  Inputs::AXPY(int MeshYEnum, double scalar, int MeshXEnum){
     408void  Inputs::AXPY(int MeshYEnum, IssmDouble scalar, int MeshXEnum){
    409409           
    410410        Input* xinput=NULL;
  • issm/trunk-jpl/src/c/Container/Inputs.h

    r12365 r12466  
    3131                int     AddInput(Input* in_input);
    3232                void    ChangeEnum(int enumtype,int new_enumtype);
    33                 void    ConstrainMin(int constrain_enum, double minimum);
     33                void    ConstrainMin(int constrain_enum, IssmDouble minimum);
    3434                int     DeleteInput(int enum_type);
    3535                void    DuplicateInput(int original_enum,int new_enum);
    3636                Input*  GetInput(int enum_name);
    3737                Inputs* SpawnTriaInputs(int* indices);
    38                 void    AXPY(int MeshYEnum, double scalar, int MeshXEnum);
    39                 double  InfinityNorm(int enumtype);
    40                 double  Max(int enumtype);
    41                 double  MaxAbs(int enumtype);
    42                 double  Min(int enumtype);
    43                 double  MinAbs(int enumtype);
     38                void    AXPY(int MeshYEnum, IssmDouble scalar, int MeshXEnum);
     39                IssmDouble  InfinityNorm(int enumtype);
     40                IssmDouble  Max(int enumtype);
     41                IssmDouble  MaxAbs(int enumtype);
     42                IssmDouble  Min(int enumtype);
     43                IssmDouble  MinAbs(int enumtype);
    4444               
    45                 void GetInputAverage(double* pvalue, int enum_type);
     45                void GetInputAverage(IssmDouble* pvalue, int enum_type);
    4646                void GetInputValue(bool* pvalue,int enum_type);
    4747                void GetInputValue(int* pvalue,int enum_type);
    48                 void GetInputValue(double* pvalue,int enum_type);
     48                void GetInputValue(IssmDouble* pvalue,int enum_type);
    4949
    5050                void Configure(Parameters* parameters);
  • issm/trunk-jpl/src/c/Container/Observations.cpp

    r12459 r12466  
    3434}
    3535/*}}}*/
    36 /*FUNCTION Observations::Observations(double* observations_list,double* x,double* y,int n,Options* options){{{*/
    37 Observations::Observations(double* observations_list,double* x,double* y,int n,Options* options){
     36/*FUNCTION Observations::Observations(IssmDouble* observations_list,IssmDouble* x,IssmDouble* y,int n,Options* options){{{*/
     37Observations::Observations(IssmDouble* observations_list,IssmDouble* x,IssmDouble* y,int n,Options* options){
    3838
    3939        /*Intermediaries*/
    4040        int          i,j,maxdepth,level,counter,index;
    4141        int          xi,yi;
    42         double       xmin,xmax,ymin,ymax;
    43         double       offset,minlength,minspacing,mintrimming,maxtrimming;
     42        IssmDouble       xmin,xmax,ymin,ymax;
     43        IssmDouble       offset,minlength,minspacing,mintrimming,maxtrimming;
    4444        int         *indices     = NULL;
    4545        Observation *observation = NULL;
     
    6969        else{
    7070                maxdepth = 30;
    71                 minlength=max(xmax-xmin,ymax-ymin)/double((1L<<maxdepth)-1);
     71                minlength=max(xmax-xmin,ymax-ymin)/IssmDouble((1L<<maxdepth)-1);
    7272        }
    7373
     
    117117/*Methods*/
    118118/*FUNCTION Observations::ClosestObservation{{{*/
    119 void Observations::ClosestObservation(double *px,double *py,double *pobs,double x_interp,double y_interp,double radius){
     119void Observations::ClosestObservation(IssmDouble *px,IssmDouble *py,IssmDouble *pobs,IssmDouble x_interp,IssmDouble y_interp,IssmDouble radius){
    120120
    121121        /*Output and Intermediaries*/
    122122        bool         stop;
    123123        int          nobs,i,index;
    124         double       h2,hmin2,radius2;
     124        IssmDouble       h2,hmin2,radius2;
    125125        int         *indices      = NULL;
    126126        Observation *observation  = NULL;
     
    165165
    166166}/*}}}*/
    167 /*FUNCTION Observations::ObservationList(double **px,double **py,double **pobs,int* pnobs,double x_interp,double y_interp,double radius,int maxdata){{{*/
    168 void Observations::ObservationList(double **px,double **py,double **pobs,int* pnobs,double x_interp,double y_interp,double radius,int maxdata){
     167/*FUNCTION Observations::ObservationList(IssmDouble **px,IssmDouble **py,IssmDouble **pobs,int* pnobs,IssmDouble x_interp,IssmDouble y_interp,IssmDouble radius,int maxdata){{{*/
     168void Observations::ObservationList(IssmDouble **px,IssmDouble **py,IssmDouble **pobs,int* pnobs,IssmDouble x_interp,IssmDouble y_interp,IssmDouble radius,int maxdata){
    169169
    170170        /*Output and Intermediaries*/
    171171        bool         stop;
    172172        int          nobs,tempnobs,i,j,k,n,counter;
    173         double       h2,radius2;
     173        IssmDouble       h2,radius2;
    174174        int         *indices      = NULL;
    175175        int         *tempindices  = NULL;
    176         double      *dists        = NULL;
    177         double      *x            = NULL;
    178         double      *y            = NULL;
    179         double      *obs          = NULL;
     176        IssmDouble      *dists        = NULL;
     177        IssmDouble      *x            = NULL;
     178        IssmDouble      *y            = NULL;
     179        IssmDouble      *obs          = NULL;
    180180        Observation *observation  = NULL;
    181181
     
    190190        if(tempnobs){
    191191                indices = xNew<int>(tempnobs);
    192                 dists   = xNew<double>(tempnobs);
     192                dists   = xNew<IssmDouble>(tempnobs);
    193193        }
    194194        nobs = 0;
     
    225225                }
    226226        } 
    227         xDelete<double>(dists);
     227        xDelete<IssmDouble>(dists);
    228228        xDelete<int>(tempindices);
    229229
    230230        if(nobs){
    231231                /*Allocate vectors*/
    232                 x   = xNew<double>(nobs);
    233                 y   = xNew<double>(nobs);
    234                 obs = xNew<double>(nobs);
     232                x   = xNew<IssmDouble>(nobs);
     233                y   = xNew<IssmDouble>(nobs);
     234                obs = xNew<IssmDouble>(nobs);
    235235
    236236                /*Loop over all observations and fill in x, y and obs*/
     
    248248        *pnobs=nobs;
    249249}/*}}}*/
    250 /*FUNCTION Observations::ObservationList(double **px,double **py,double **pobs,int* pnobs){{{*/
    251 void Observations::ObservationList(double **px,double **py,double **pobs,int* pnobs){
     250/*FUNCTION Observations::ObservationList(IssmDouble **px,IssmDouble **py,IssmDouble **pobs,int* pnobs){{{*/
     251void Observations::ObservationList(IssmDouble **px,IssmDouble **py,IssmDouble **pobs,int* pnobs){
    252252
    253253        /*Output and Intermediaries*/
    254254        int          nobs;
    255         double      *x            = NULL;
    256         double      *y            = NULL;
    257         double      *obs          = NULL;
     255        IssmDouble      *x            = NULL;
     256        IssmDouble      *y            = NULL;
     257        IssmDouble      *obs          = NULL;
    258258        Observation *observation  = NULL;
    259259
     
    261261
    262262        if(nobs){
    263                 x   = xNew<double>(nobs);
    264                 y   = xNew<double>(nobs);
    265                 obs = xNew<double>(nobs);
     263                x   = xNew<IssmDouble>(nobs);
     264                y   = xNew<IssmDouble>(nobs);
     265                obs = xNew<IssmDouble>(nobs);
    266266                for(int i=0;i<this->Size();i++){
    267267                        observation=(Observation*)this->GetObjectByOffset(i);
     
    277277}/*}}}*/
    278278/*FUNCTION Observations::InterpolationIDW{{{*/
    279 void Observations::InterpolationIDW(double *pprediction,double x_interp,double y_interp,double radius,int mindata,int maxdata,double power){
     279void Observations::InterpolationIDW(IssmDouble *pprediction,IssmDouble x_interp,IssmDouble y_interp,IssmDouble radius,int mindata,int maxdata,IssmDouble power){
    280280
    281281        /*Intermediaries*/
    282282        int    i,n_obs;
    283         double prediction;
    284         double numerator,denominator,h,weight;
    285         double *x   = NULL;
    286         double *y   = NULL;
    287         double *obs = NULL;
     283        IssmDouble prediction;
     284        IssmDouble numerator,denominator,h,weight;
     285        IssmDouble *x   = NULL;
     286        IssmDouble *y   = NULL;
     287        IssmDouble *obs = NULL;
    288288
    289289        /*Some checks*/
     
    321321        /*clean-up*/
    322322        *pprediction = prediction;
    323         xDelete<double>(x);
    324         xDelete<double>(y);
    325         xDelete<double>(obs);
     323        xDelete<IssmDouble>(x);
     324        xDelete<IssmDouble>(y);
     325        xDelete<IssmDouble>(obs);
    326326}/*}}}*/
    327327/*FUNCTION Observations::InterpolationKriging{{{*/
    328 void Observations::InterpolationKriging(double *pprediction,double *perror,double x_interp,double y_interp,double radius,int mindata,int maxdata,Variogram* variogram){
     328void Observations::InterpolationKriging(IssmDouble *pprediction,IssmDouble *perror,IssmDouble x_interp,IssmDouble y_interp,IssmDouble radius,int mindata,int maxdata,Variogram* variogram){
    329329
    330330        /*Intermediaries*/
    331331        int           i,j,n_obs;
    332         double        prediction,error;
    333         double        numerator,denominator,ratio;
    334         double       *x            = NULL;
    335         double       *y            = NULL;
    336         double       *obs          = NULL;
    337         double       *Gamma        = NULL;
    338         double       *GinvG0       = NULL;
    339         double       *Ginv1        = NULL;
    340         double       *GinvZ        = NULL;
    341         double       *gamma0       = NULL;
    342         double       *ones         = NULL;
     332        IssmDouble        prediction,error;
     333        IssmDouble        numerator,denominator,ratio;
     334        IssmDouble       *x            = NULL;
     335        IssmDouble       *y            = NULL;
     336        IssmDouble       *obs          = NULL;
     337        IssmDouble       *Gamma        = NULL;
     338        IssmDouble       *GinvG0       = NULL;
     339        IssmDouble       *Ginv1        = NULL;
     340        IssmDouble       *GinvZ        = NULL;
     341        IssmDouble       *gamma0       = NULL;
     342        IssmDouble       *ones         = NULL;
    343343
    344344        /*Some checks*/
     
    360360
    361361        /*Allocate intermediary matrix and vectors*/
    362         Gamma  = xNew<double>(n_obs*n_obs);
    363         gamma0 = xNew<double>(n_obs);
    364         ones   = xNew<double>(n_obs);
     362        Gamma  = xNew<IssmDouble>(n_obs*n_obs);
     363        gamma0 = xNew<IssmDouble>(n_obs);
     364        ones   = xNew<IssmDouble>(n_obs);
    365365
    366366        /*First: Create semivariogram matrix for observations*/
     
    401401        *pprediction = prediction;
    402402        *perror = error;
    403         xDelete<double>(x);
    404         xDelete<double>(y);
    405         xDelete<double>(obs);
    406         xDelete<double>(Gamma);
    407         xDelete<double>(gamma0);
    408         xDelete<double>(ones);
    409         xDelete<double>(GinvG0);
    410         xDelete<double>(Ginv1);
    411         xDelete<double>(GinvZ);
     403        xDelete<IssmDouble>(x);
     404        xDelete<IssmDouble>(y);
     405        xDelete<IssmDouble>(obs);
     406        xDelete<IssmDouble>(Gamma);
     407        xDelete<IssmDouble>(gamma0);
     408        xDelete<IssmDouble>(ones);
     409        xDelete<IssmDouble>(GinvG0);
     410        xDelete<IssmDouble>(Ginv1);
     411        xDelete<IssmDouble>(GinvZ);
    412412
    413413}/*}}}*/
    414414/*FUNCTION Observations::InterpolationNearestNeighbor{{{*/
    415 void Observations::InterpolationNearestNeighbor(double *pprediction,double x_interp,double y_interp,double radius){
     415void Observations::InterpolationNearestNeighbor(IssmDouble *pprediction,IssmDouble x_interp,IssmDouble y_interp,IssmDouble radius){
    416416
    417417        /*Intermediaries*/
    418         double        x,y,obs;
     418        IssmDouble        x,y,obs;
    419419
    420420        /*Get clostest observation*/
     
    425425}/*}}}*/
    426426/*FUNCTION Observations::QuadtreeColoring{{{*/
    427 void Observations::QuadtreeColoring(double* A,double *x,double *y,int n){
     427void Observations::QuadtreeColoring(IssmDouble* A,IssmDouble *x,IssmDouble *y,int n){
    428428
    429429        int xi,yi,level;
     
    432432                this->quadtree->IntergerCoordinates(&xi,&yi,x[i],y[i]);
    433433                this->quadtree->QuadtreeDepth(&level,xi,yi);
    434                 A[i]=(double)level;
     434                A[i]=(IssmDouble)level;
    435435        }
    436436
    437437}/*}}}*/
    438438/*FUNCTION Observations::Variomap{{{*/
    439 void Observations::Variomap(double* gamma,double *x,int n){
     439void Observations::Variomap(IssmDouble* gamma,IssmDouble *x,int n){
    440440
    441441        /*Output and Intermediaries*/
    442442        int          i,j,k;
    443         double       distance;
     443        IssmDouble       distance;
    444444        Observation *observation1 = NULL;
    445445        Observation *observation2 = NULL;
    446446
    447         double *counter = xNew<double>(n);
     447        IssmDouble *counter = xNew<IssmDouble>(n);
    448448        for(j=0;j<n;j++) counter[j] = 0.0;
    449449        for(j=0;j<n;j++) gamma[j]   = 0.0;
     
    474474
    475475        /*Assign output pointer*/
    476         xDelete<double>(counter);
    477 }/*}}}*/
     476        xDelete<IssmDouble>(counter);
     477}/*}}}*/
  • issm/trunk-jpl/src/c/Container/Observations.h

    r12422 r12466  
    2020                /*constructors, destructors*/
    2121                Observations();
    22                 Observations(double* observations_list,double* x,double* y,int n,Options* options);
     22                Observations(IssmDouble* observations_list,IssmDouble* x,IssmDouble* y,int n,Options* options);
    2323                ~Observations();
    2424
    2525                /*Methods*/
    26                 void ClosestObservation(double *px,double *py,double *pobs,double x_interp,double y_interp,double radius);
    27                 void InterpolationIDW(double *pprediction,double x_interp,double y_interp,double radius,int mindata,int maxdata,double power);
    28                 void InterpolationKriging(double *pprediction,double *perror,double x_interp,double y_interp,double radius,int mindata,int maxdata,Variogram* variogram);
    29                 void InterpolationNearestNeighbor(double *pprediction,double x_interp,double y_interp,double radius);
    30                 void ObservationList(double **px,double **py,double **pobs,int* pnobs);
    31                 void ObservationList(double **px,double **py,double **pobs,int* pnobs,double x_interp,double y_interp,double radius,int maxdata);
    32                 void QuadtreeColoring(double* A,double *x,double *y,int n);
    33                 void Variomap(double* gamma,double *x,int n);
     26                void ClosestObservation(IssmDouble *px,IssmDouble *py,IssmDouble *pobs,IssmDouble x_interp,IssmDouble y_interp,IssmDouble radius);
     27                void InterpolationIDW(IssmDouble *pprediction,IssmDouble x_interp,IssmDouble y_interp,IssmDouble radius,int mindata,int maxdata,IssmDouble power);
     28                void InterpolationKriging(IssmDouble *pprediction,IssmDouble *perror,IssmDouble x_interp,IssmDouble y_interp,IssmDouble radius,int mindata,int maxdata,Variogram* variogram);
     29                void InterpolationNearestNeighbor(IssmDouble *pprediction,IssmDouble x_interp,IssmDouble y_interp,IssmDouble radius);
     30                void ObservationList(IssmDouble **px,IssmDouble **py,IssmDouble **pobs,int* pnobs);
     31                void ObservationList(IssmDouble **px,IssmDouble **py,IssmDouble **pobs,int* pnobs,IssmDouble x_interp,IssmDouble y_interp,IssmDouble radius,int maxdata);
     32                void QuadtreeColoring(IssmDouble* A,IssmDouble *x,IssmDouble *y,int n);
     33                void Variomap(IssmDouble* gamma,IssmDouble *x,int n);
    3434
    3535};
  • issm/trunk-jpl/src/c/Container/Options.cpp

    r12459 r12466  
    106106}
    107107/*}}}*/
    108 /*FUNCTION Options::Get(double* pvalue, char* name){{{*/
    109 void Options::Get(double* pvalue,const char* name){
    110 
    111         vector<Object*>::iterator object;
    112         Option* option=NULL;
    113 
    114         /*Get option*/
    115         option=GetOption(name);
    116 
    117         /*If the pointer is not NULL, the option has been found*/
    118         if(option){
    119                 option->Get(pvalue);
    120         }
    121         /*Else, the Option does not exist, no default provided*/
    122         else{
    123                 _error_("option of name \"%s\" not found, and no default value has been provided",name);
    124         }
    125 }
    126 /*}}}*/
    127 /*FUNCTION Options::Get(double* pvalue, char* name,double default_value){{{*/
    128 void Options::Get(double* pvalue,const char* name,double default_value){
     108/*FUNCTION Options::Get(IssmDouble* pvalue, char* name){{{*/
     109void Options::Get(IssmDouble* pvalue,const char* name){
     110
     111        vector<Object*>::iterator object;
     112        Option* option=NULL;
     113
     114        /*Get option*/
     115        option=GetOption(name);
     116
     117        /*If the pointer is not NULL, the option has been found*/
     118        if(option){
     119                option->Get(pvalue);
     120        }
     121        /*Else, the Option does not exist, no default provided*/
     122        else{
     123                _error_("option of name \"%s\" not found, and no default value has been provided",name);
     124        }
     125}
     126/*}}}*/
     127/*FUNCTION Options::Get(IssmDouble* pvalue, char* name,IssmDouble default_value){{{*/
     128void Options::Get(IssmDouble* pvalue,const char* name,IssmDouble default_value){
    129129
    130130        vector<Object*>::iterator object;
     
    223223                stringsize=strlen(default_value)+1;
    224224                outstring=xNew<char>(stringsize);
    225                 memcpy(outstring,default_value,stringsize*sizeof(char));
     225                xMemCpy<char>(outstring,default_value,stringsize);
    226226                *pvalue=outstring;
    227227        }
     
    275275}
    276276/*}}}*/
    277 /*FUNCTION Options::Get(double** pvalue,int* numel,const char* name){{{*/
    278 void Options::Get(double** pvalue,int* numel,const char* name){
     277/*FUNCTION Options::Get(IssmDouble** pvalue,int* numel,const char* name){{{*/
     278void Options::Get(IssmDouble** pvalue,int* numel,const char* name){
    279279
    280280        vector<Object*>::iterator object;
  • issm/trunk-jpl/src/c/Container/Options.h

    r12292 r12466  
    2020                int  AddOption(Option* in_oobject);
    2121                Option* GetOption(const char* name);
    22                 void Get(double*  pvalue,const char* name);
    23                 void Get(double*  pvalue,const char* name,double default_value);
     22                void Get(IssmDouble*  pvalue,const char* name);
     23                void Get(IssmDouble*  pvalue,const char* name,IssmDouble default_value);
    2424                void Get(int*  pvalue,const char* name);
    2525                void Get(int*  pvalue,const char* name,int default_value);
     
    2929                void Get(char**   pvalue,const char* name,const char* default_value);
    3030                void Get(char***  pvalue,int* numel,const char* name);
    31                 void Get(double** pvalue,int* numel,const char* name);
     31                void Get(IssmDouble** pvalue,int* numel,const char* name);
    3232};
    3333
  • issm/trunk-jpl/src/c/Container/Parameters.cpp

    r12365 r12466  
    8585}
    8686/*}}}*/
    87 /*FUNCTION Parameters::FindParam(double* pscalar, int enum_type){{{*/
    88 void Parameters::FindParam(double* pscalar, int enum_type){ _assert_(this);
     87/*FUNCTION Parameters::FindParam(IssmDouble* pscalar, int enum_type){{{*/
     88void Parameters::FindParam(IssmDouble* pscalar, int enum_type){ _assert_(this);
    8989       
    9090        vector<Object*>::iterator object;
     
    174174}
    175175/*}}}*/
    176 /*FUNCTION Parameters::FindParam(double** pdoublearray,int* pM,int enum_type){{{*/
    177 void Parameters::FindParam(double** pdoublearray,int* pM, int enum_type){ _assert_(this);
    178 
    179         vector<Object*>::iterator object;
    180         Param* param=NULL;
    181 
    182         for ( object=objects.begin() ; object < objects.end(); object++ ){
    183 
    184                 param=(Param*)(*object);
    185                 if(param->InstanceEnum()==enum_type){
    186                         param->GetParameterValue(pdoublearray,pM);
    187                         return;
    188                 }
    189         }
    190         _error_("could not find parameter %s",EnumToStringx(enum_type));
    191 
    192 }
    193 /*}}}*/
    194 /*FUNCTION Parameters::FindParam(double** pdoublearray,int* pM, int* pN,int enum_type){{{*/
    195 void Parameters::FindParam(double** pdoublearray,int* pM, int* pN,int enum_type){ _assert_(this);
    196 
    197         vector<Object*>::iterator object;
    198         Param* param=NULL;
    199 
    200         for ( object=objects.begin() ; object < objects.end(); object++ ){
    201 
    202                 param=(Param*)(*object);
    203                 if(param->InstanceEnum()==enum_type){
    204                         param->GetParameterValue(pdoublearray,pM,pN);
    205                         return;
    206                 }
    207         }
    208         _error_("could not find parameter %s",EnumToStringx(enum_type));
    209 
    210 }
    211 /*}}}*/
    212 /*FUNCTION Parameters::FindParam(double*** parray,int* pM,int** pmdims_array,int** pndims_array,int enum_type){{{*/
    213 void Parameters::FindParam(double*** parray,int* pM,int** pmdims_array,int** pndims_array,int enum_type){ _assert_(this);
     176/*FUNCTION Parameters::FindParam(IssmDouble** pIssmDoublearray,int* pM,int enum_type){{{*/
     177void Parameters::FindParam(IssmDouble** pIssmDoublearray,int* pM, int enum_type){ _assert_(this);
     178
     179        vector<Object*>::iterator object;
     180        Param* param=NULL;
     181
     182        for ( object=objects.begin() ; object < objects.end(); object++ ){
     183
     184                param=(Param*)(*object);
     185                if(param->InstanceEnum()==enum_type){
     186                        param->GetParameterValue(pIssmDoublearray,pM);
     187                        return;
     188                }
     189        }
     190        _error_("could not find parameter %s",EnumToStringx(enum_type));
     191
     192}
     193/*}}}*/
     194/*FUNCTION Parameters::FindParam(IssmDouble** pIssmDoublearray,int* pM, int* pN,int enum_type){{{*/
     195void Parameters::FindParam(IssmDouble** pIssmDoublearray,int* pM, int* pN,int enum_type){ _assert_(this);
     196
     197        vector<Object*>::iterator object;
     198        Param* param=NULL;
     199
     200        for ( object=objects.begin() ; object < objects.end(); object++ ){
     201
     202                param=(Param*)(*object);
     203                if(param->InstanceEnum()==enum_type){
     204                        param->GetParameterValue(pIssmDoublearray,pM,pN);
     205                        return;
     206                }
     207        }
     208        _error_("could not find parameter %s",EnumToStringx(enum_type));
     209
     210}
     211/*}}}*/
     212/*FUNCTION Parameters::FindParam(IssmDouble*** parray,int* pM,int** pmdims_array,int** pndims_array,int enum_type){{{*/
     213void Parameters::FindParam(IssmDouble*** parray,int* pM,int** pmdims_array,int** pndims_array,int enum_type){ _assert_(this);
    214214       
    215215        vector<Object*>::iterator object;
     
    305305}
    306306/*}}}*/
    307 /*FUNCTION Parameters::SetParam(double scalar,int enum_type);{{{*/
    308 void   Parameters::SetParam(double scalar,int enum_type){
     307/*FUNCTION Parameters::SetParam(IssmDouble scalar,int enum_type);{{{*/
     308void   Parameters::SetParam(IssmDouble scalar,int enum_type){
    309309
    310310        Param* param=NULL;
     
    341341}
    342342/*}}}*/
    343 /*FUNCTION Parameters::SetParam(double* doublearray,int M,int enum_type);{{{*/
    344 void   Parameters::SetParam(double* doublearray,int M, int enum_type){
    345 
    346         Param* param=NULL;
    347        
    348         /*first, figure out if the param has already been created: */
    349         param=(Param*)this->FindParamObject(enum_type);
    350 
    351         if(param) param->SetValue(doublearray,M); //already exists, just set it.
    352         else this->AddObject(new DoubleVecParam(enum_type,doublearray,M)); //just add the new parameter.
    353 }
    354 /*}}}*/
    355 /*FUNCTION Parameters::SetParam(double* doublearray,int M,int N, int enum_type);{{{*/
    356 void   Parameters::SetParam(double* doublearray,int M, int N, int enum_type){
    357 
    358         Param* param=NULL;
    359        
    360         /*first, figure out if the param has already been created: */
    361         param=(Param*)this->FindParamObject(enum_type);
    362 
    363         if(param) param->SetValue(doublearray,M,N); //already exists, just set it.
    364         else this->AddObject(new DoubleMatParam(enum_type,doublearray,M,N)); //just add the new parameter.
     343/*FUNCTION Parameters::SetParam(IssmDouble* IssmDoublearray,int M,int enum_type);{{{*/
     344void   Parameters::SetParam(IssmDouble* IssmDoublearray,int M, int enum_type){
     345
     346        Param* param=NULL;
     347       
     348        /*first, figure out if the param has already been created: */
     349        param=(Param*)this->FindParamObject(enum_type);
     350
     351        if(param) param->SetValue(IssmDoublearray,M); //already exists, just set it.
     352        else this->AddObject(new DoubleVecParam(enum_type,IssmDoublearray,M)); //just add the new parameter.
     353}
     354/*}}}*/
     355/*FUNCTION Parameters::SetParam(IssmDouble* IssmDoublearray,int M,int N, int enum_type);{{{*/
     356void   Parameters::SetParam(IssmDouble* IssmDoublearray,int M, int N, int enum_type){
     357
     358        Param* param=NULL;
     359       
     360        /*first, figure out if the param has already been created: */
     361        param=(Param*)this->FindParamObject(enum_type);
     362
     363        if(param) param->SetValue(IssmDoublearray,M,N); //already exists, just set it.
     364        else this->AddObject(new DoubleMatParam(enum_type,IssmDoublearray,M,N)); //just add the new parameter.
    365365}
    366366/*}}}*/
  • issm/trunk-jpl/src/c/Container/Parameters.h

    r12365 r12466  
    3232                void  FindParam(bool* pinteger,int enum_type);
    3333                void  FindParam(int* pinteger,int enum_type);
    34                 void  FindParam(double* pscalar, int enum_type);
     34                void  FindParam(IssmDouble* pscalar, int enum_type);
    3535                void  FindParam(char** pstring,int enum_type);
    3636                void  FindParam(char*** pstringarray,int* pM,int enum_type);
    3737                void  FindParam(int** pintarray,int* pM,int enum_type);
    3838                void  FindParam(int** pintarray,int* pM,int* PN,int enum_type);
    39                 void  FindParam(double** pdoublearray,int* pM,int enum_type);
    40                 void  FindParam(double** pdoublearray,int* pM,int* pN,int enum_type);
    41                 void  FindParam(double*** parray,int* pM, int** pmdims_array,int** pndims_array,int enum_type);
     39                void  FindParam(IssmDouble** pIssmDoublearray,int* pM,int enum_type);
     40                void  FindParam(IssmDouble** pIssmDoublearray,int* pM,int* pN,int enum_type);
     41                void  FindParam(IssmDouble*** parray,int* pM, int** pmdims_array,int** pndims_array,int enum_type);
    4242                void  FindParam(Vector** pvec,int enum_type);
    4343                void  FindParam(Matrix** pmat,int enum_type);
     
    4646                void  SetParam(bool boolean,int enum_type);
    4747                void  SetParam(int integer,int enum_type);
    48                 void  SetParam(double scalar, int enum_type);
     48                void  SetParam(IssmDouble scalar, int enum_type);
    4949                void  SetParam(char* string,int enum_type);
    5050                void  SetParam(char** stringarray,int M,int enum_type);
    51                 void  SetParam(double* doublearray,int M,int enum_type);
    52                 void  SetParam(double* doublearray,int M,int N,int enum_type);
     51                void  SetParam(IssmDouble* IssmDoublearray,int M,int enum_type);
     52                void  SetParam(IssmDouble* IssmDoublearray,int M,int N,int enum_type);
    5353                void  SetParam(int* intarray,int M,int enum_type);
    5454                void  SetParam(int* intarray,int M,int N,int enum_type);
Note: See TracChangeset for help on using the changeset viewer.