Changeset 12354


Ignore:
Timestamp:
06/04/12 10:50:00 (13 years ago)
Author:
utke
Message:

rename type and use xNew/xDelete and also one case of xNewInit

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/objects/DakotaPlugin.cpp

    r9571 r12354  
    5757
    5858        int i;
    59         double* variables=NULL;
     59        IssmDouble* variables=NULL;
    6060        char** variable_descriptors=NULL;
    6161        char*  variable_descriptor=NULL;
    62         double* responses=NULL;
     62        IssmDouble* responses=NULL;
    6363
    6464        /*increae counter: */
     
    6969
    7070        /*First, the variables: */
    71         variables=(double*)xmalloc(numACV*sizeof(double));
     71        variables=xNew<IssmDouble>(numACV);
    7272        for(i=0;i<numACV;i++){
    7373                variables[i]=xC[i];
     
    8585
    8686        /*Initialize responses: */
    87         responses=(double*)xcalloc(numFns,sizeof(double));
     87        responses=xNewInit<IssmDouble>(numFns,0.0);
    8888
    8989        /*run core solution: */
     
    9797
    9898        /*Free ressources:*/
    99         xfree((void**)&variables);
     99        xDelete<IssmDouble>(variables);
    100100        for(i=0;i<numACV;i++){
    101101                variable_descriptor=variable_descriptors[i];
     
    103103        }
    104104        xfree((void**)&variable_descriptors);
    105         xfree((void**)&responses);
     105        xDelete<IssmDouble>(responses);
    106106
    107107        return 0;
Note: See TracChangeset for help on using the changeset viewer.