Changeset 3329 in Sophya for trunk/Cosmo/SimLSS/geneutils.cc
- Timestamp:
- Sep 27, 2007, 6:21:55 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Cosmo/SimLSS/geneutils.cc
r3325 r3329 64 64 : _ymin(0.) , _ymax(0.) , _x(x) , _y(y) 65 65 { 66 int_4 ns = _x.size();66 uint_4 ns = _x.size(); 67 67 if(ns<3 || _y.size()<=0 || ns!=_y.size()) 68 68 throw ParmError("InverseFunc::InverseFunc_Error: bad array size"); 69 69 70 70 // Check "x" strictement monotone croissant 71 for( int_4 i=0;i<ns-1;i++)71 for(uint_4 i=0;i<ns-1;i++) 72 72 if(_x[i+1]<=_x[i]) { 73 73 cout<<"InverseFunc::InverseFunc_Error: _x array not stricly growing"<<endl; … … 76 76 77 77 // Check "y" monotone croissant 78 for( int_4 i=0;i<ns-1;i++)78 for(uint_4 i=0;i<ns-1;i++) 79 79 if(_y[i+1]<_y[i]) { 80 80 cout<<"InverseFunc::InverseFunc_Error: _y array not growing"<<endl; … … 134 134 // Protection 135 135 if(i1<0) {i1++; i2++; i3++;} 136 if(i3== _y.size()) {i1--; i2--; i3--;}136 if(i3==(long)_y.size()) {i1--; i2--; i3--;} 137 137 // Interpolation parabolique 138 138 double dy = _y[i3]-_y[i1]; … … 163 163 { 164 164 long n = X.size(); 165 if( Y.size()<n|| n<2)165 if(n>(long)Y.size() || n<2) 166 166 throw ParmError("InterpTab_Error : incompatible size between X and Y tables!"); 167 167
Note:
See TracChangeset
for help on using the changeset viewer.