/home/peifer/diffit/modules/setMesh.cc File Reference

#include <stdlib.h>
#include <iostream>
#include <fstream>
#include "../nr.h"
#include "../def.h"

Go to the source code of this file.

Functions

void setMesh (GlobExp *ex, Glob *globs, long expNr)


Function Documentation

void setMesh GlobExp ex,
Glob globs,
long  expNr
 

Definition at line 11 of file setMesh.cc.

References dvector(), FALSE, GlobExp::fitend, GlobExp::fitstart, GlobExp::mesh, Glob::noMeasurements, and GlobExp::nPoints.

00012 {
00013   long i,nPoints=ex[expNr].nPoints;
00014   
00015   ex[expNr].mesh=dvector(1,nPoints);
00016   ex[expNr].mesh[1]= ex[expNr].fitstart;
00017   ex[expNr].mesh[nPoints]= ex[expNr].fitend;
00018 
00019   if (globs->noMeasurements==FALSE) 
00020     {         
00021       // mesh at data points
00022       if (ex[expNr].nMeasure < nPoints) 
00023         {
00024           cerr << "Too few measurements to construct mesh\n";
00025           exit(1);
00026         }
00027       for (i=2; i < nPoints; ++i)
00028         ex[expNr].mesh[i]=ex[expNr].xMeasure[ex[expNr].firstMeasure+int(double((i-1)*(ex[expNr].nMeasure-1))/double(nPoints-1))];
00029     } 
00030   else 
00031     {        
00032       // evenly spaced mesh
00033       for (i=2; i < nPoints; ++i)
00034         ex[expNr].mesh[i]=ex[expNr].fitstart+(ex[expNr].fitend-ex[expNr].fitstart)*double(i-1)/double(nPoints-1);
00035     }
00036 }


Generated on Mon Jan 29 17:09:15 2007 for Diffit by  doxygen 1.4.6