Changeset 12440


Ignore:
Timestamp:
06/18/12 08:48:43 (13 years ago)
Author:
Mathieu Morlighem
Message:

changing xmalloc to xNew and xfree to xDelete

Location:
issm/trunk-jpl/src/c/shared
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/shared/Matrix/MatrixUtils.cpp

    r12437 r12440  
    171171        int noerr=1;
    172172        int i,j,k,ipt,jpt,irow,icol,ipiv,ncol;
    173         int (*pivrc)[2],*pindx;
     173        int *pivrc1,*pivrc2,*pindx;
    174174        double pivot,det,dtemp;
    175175
     
    217217                }
    218218
    219                 pivrc[i][0]=irow;
    220                 pivrc[i][1]=icol;
     219                pivrc1[i]=irow;
     220                pivrc2[i]=icol;
    221221
    222222                ipiv=icol;
     
    308308                j=(nrow-1)-i;
    309309
    310                 if (pivrc[j][0] != pivrc[j][1]) {
    311                         irow=pivrc[j][0];
    312                         icol=pivrc[j][1];
     310                if (pivrc1[j] != pivrc2[j]) {
     311                        irow=pivrc1[j];
     312                        icol=pivrc2[j];
    313313
    314314//                      _printf_(true,"column switch back for j=%d: irow=%d, icol=%d\n",
     
    330330        xfree((void**)&pivrc);
    331331        xDelete<int>(pindx);
    332 
    333332        return noerr;
    334333}/*}}}*/
  • issm/trunk-jpl/src/c/shared/Numerics/OptionsFromAnalysis.cpp

    r12437 r12440  
    6161
    6262        /*ok, grab the option string: */
    63         outstring=(char*)xmalloc((strlen(strings[found])+1)*sizeof(char));
     63        outstring=xNew<char>(strlen(strings[found])+1);
    6464        strcpy(outstring,strings[found]);
    6565
  • issm/trunk-jpl/src/c/shared/TriMesh/SplitMeshForRifts.cpp

    r12086 r12440  
    33 */
    44#include "./trimesh.h"
    5 
     5#include "../Alloc/xNewDelete.h"
    66#include "../Alloc/alloc.h"
    77
     
    5252
    5353        /*Go through all nodes of the rift segments, and start splitting the mesh: */
    54         flags=(int*)xcalloc(nods,sizeof(int)); //to make sure we don't split the same nodes twice!
     54        flags=xNewInit<int>(nods,0); //to make sure we don't split the same nodes twice!
    5555        for (i=0;i<nriftsegs;i++){
    5656                for (j=0;j<2;j++){
  • issm/trunk-jpl/src/c/shared/TriMesh/TriMeshUtils.cpp

    r12436 r12440  
    129129
    130130        /*Allocate segmentflags: */
    131         riftsegments_uncompressed=(int*)xcalloc(nsegs*5,sizeof(int));
     131        riftsegments_uncompressed=xNewInit<int>(nsegs*5,0);
    132132
    133133        /*Find the segments that belong to a rift: they are the ones that see two elements. The other ones belong to a boundary
Note: See TracChangeset for help on using the changeset viewer.