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

Go to the documentation of this file.
00001 #include <stdlib.h>
00002 #include <iostream>
00003 #include <fstream>
00004 
00005 #include "../nr.h"
00006 #include "../def.h"
00007 
00008 using namespace std;
00009 
00010 
00011 void setMesh(GlobExp *ex,Glob *globs,long expNr)
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:13 2007 for Diffit by  doxygen 1.4.6