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

#include <iostream>
#include <math.h>
#include <stdlib.h>
#include <time.h>
#include "../def.h"
#include "../model.h"
#include "../nr.h"

Go to the source code of this file.

Functions

void outSimit (GlobExp ex[], Glob *globs, double *t, long n, double **y)


Function Documentation

void outSimit GlobExp  ex[],
Glob globs,
double *  t,
long  n,
double **  y
 

Definition at line 12 of file outSimit.cc.

References GlobExp::nobs, and Glob::sig.

00013 {
00014   long k,l;
00015   long idum=-time(NULL);
00016   long nobs=ex[1].nobs;
00017   ofstream out;
00018   
00019   out.open(ex[1].fileName);
00020 
00021   if(globs->sig==0)
00022     {
00023       for(k=1;k<=n;k++)
00024         {
00025           out << t[k];
00026           for(l=1;l<=nobs;l++)
00027             out << " " << y[k][l] << " 1";
00028           out << endl;
00029         }
00030 
00031     }
00032   else
00033     {
00034       double *max=dvector(1,nobs),*min=dvector(1,nobs);
00035       for(l=1;l<=nobs;l++)
00036         {
00037           max[l]=y[1][l];
00038           min[l]=y[1][l];
00039         }
00040       for(k=2;k<=n;k++)
00041         {
00042           for(l=1;l<=nobs;l++)
00043             {
00044               if(max[l]<y[k][l])
00045                 max[l]=y[k][l];
00046               if(min[l]>y[k][l])
00047                 min[l]=y[k][l];
00048             }
00049         }
00050       for(k=1;k<=n;k++)
00051         {
00052           out << t[k] ;
00053           for(l=1;l<=nobs;l++)
00054             out << " " << y[k][l]+globs->sig*fabs(max[l]-min[l])*gasdev(&idum) << " " << globs->sig*fabs(max[l]-min[l]);
00055           out << endl;
00056         }
00057     }
00058 
00059 }


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