ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE/props/staticProps.cpp
(Generate patch)

Comparing trunk/OOPSE/props/staticProps.cpp (file contents):
Revision 801 by mmeineke, Fri Oct 3 22:02:52 2003 UTC vs.
Revision 802 by mmeineke, Thu Oct 9 22:09:52 2003 UTC

# Line 39 | Line 39 | int main(int argC,char* argV[]){
39    bool haveMaxLength;
40    double maxLength;
41    
42 +  int nBins;
43 +
44    vector<PairCorrList> theList;
45    pairCorrEnum pairType;
46    
# Line 72 | Line 74 | int main(int argC,char* argV[]){
74    haveMaxLength = false;
75    
76    maxLength = 1.0;
77 +  nBins = 100;
78  
79    programName = argv[0]; /*save the program name in case we need it*/
80  
# Line 208 | Line 211 | int main(int argC,char* argV[]){
211              if( optionError ){
212                sprintf( painCave.errMsg,
213                         "\n"
214 <                       "The -i flag should end an option sequence.\n"
215 <                       "   example: -ri <int> *NOT* -ir <int>\n" );
214 >                       "The -l flag should end an option sequence.\n"
215 >                       "   example: -sl <double> *NOT* -ls <double>\n" );
216                usage();
217                painCave.isFatal = 1;
218                simError();
# Line 219 | Line 222 | int main(int argC,char* argV[]){
222              if( i>=argC ){
223                sprintf( painCave.errMsg,
224                         "\n"
225 <                       "not enough arguments for -i\n");
225 >                       "not enough arguments for -l\n");
226                usage();
227                painCave.isFatal = 1;
228                simError();
229              }    
230  
231 <            maxLength = strtod( argV[i], &conversionCheck, 10 );
231 >            maxLength = strtod( argV[i], &conversionCheck);
232              if( conversionCheck == argV[i] ) conversionError = true;
233              if( *conversionCheck != '\0' ) conversionError = true;
234              
# Line 242 | Line 245 | int main(int argC,char* argV[]){
245  
246              break;
247  
248 +          case 'n':
249 +            // -n <int>    set <int> to the nBins
250 +
251 +            j++;
252 +            currentFlag = argV[i][j];
253 +              
254 +            if( currentFlag != '\0' ) optionError = true;
255 +            
256 +            if( optionError ){
257 +              sprintf( painCave.errMsg,
258 +                       "\n"
259 +                       "The -n flag should end an option sequence.\n"
260 +                       "   example: -sn <int> *NOT* -ns <int>\n" );
261 +              usage();
262 +              painCave.isFatal = 1;
263 +              simError();
264 +            }
265 +
266 +            i++;
267 +            if( i>=argC ){
268 +              sprintf( painCave.errMsg,
269 +                       "\n"
270 +                       "not enough arguments for -n\n");
271 +              usage();
272 +              painCave.isFatal = 1;
273 +              simError();
274 +            }    
275 +
276 +            nBins = strtol( argV[i], &conversionCheck, 10 );
277 +            if( conversionCheck == argV[i] ) conversionError = true;
278 +            if( *conversionCheck != '\0' ) conversionError = true;
279 +            
280 +            if( conversionError ){
281 +              sprintf( painCave.errMsg,
282 +                       "Error converting \"%s\" to an int for nBins.\n",
283 +                       argV[i] );
284 +              usage();
285 +              painCave.isFatal = 1;
286 +              simError();
287 +            }
288 +            
289 +            if( nBins < 1 ){
290 +              sprintf( painCave.errMsg,
291 +                       "nBins error: nBins = %d is less than 1.\n",
292 +                       nBins );
293 +              usage();
294 +              painCave.isFatal = 1;
295 +              simError();
296 +            }
297 +
298 +            done = true;
299 +
300 +            break;
301 +
302            default:
303  
304              sprintf(painCave.errMsg,
# Line 331 | Line 388 | int main(int argC,char* argV[]){
388    printf("Initializing the pair correlations..." );
389    fflush(stdout);
390    
391 +  if(haveMaxLength)
392 +    theCorrs.setMaxLength( maxLength );
393 +  
394 +  theCorrs.setNbins( nBins );
395    theCorrs.setFrames( infoArray, nFrames, reader );
396    theCorrs.setPairCorrList( theList );
397    theCorrs.initCorrelations( outPrefix );
# Line 358 | Line 419 | void usage(){
419                  "   short:\n"
420                  "   ------\n"
421                  "   -o <name>       The output prefix\n"
422 +                "   -n <nBins>      Set the number of bins in the Histogram.\n"
423 +                "                     *Defaults to 100\n"
424                  "   -l <maxLength>  set the maximum value of r\n"
425                  "                     *Defaults to 1/2 smallest length of first frame.\n"
426                  "   -s              Turn on separate output files\n"

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines