\section{/home/peifer/diffit/modules/out\-Fit.cc File Reference}
\label{outFit_8cc}\index{/home/peifer/diffit/modules/outFit.cc@{/home/peifer/diffit/modules/outFit.cc}}
{\tt \#include $<$iostream$>$}\par
{\tt \#include $<$math.h$>$}\par
{\tt \#include $<$stdlib.h$>$}\par
{\tt \#include \char`\"{}../def.h\char`\"{}}\par
{\tt \#include \char`\"{}../model.h\char`\"{}}\par
{\tt \#include \char`\"{}../nr.h\char`\"{}}\par
\subsection*{Functions}
\begin{CompactItemize}
\item 
void {\bf out\-Fit} ({\bf Glob\-Exp} ex[$\,$], {\bf Glob} $\ast$globs)
\end{CompactItemize}


\subsection{Function Documentation}
\index{outFit.cc@{out\-Fit.cc}!outFit@{outFit}}
\index{outFit@{outFit}!outFit.cc@{out\-Fit.cc}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void out\-Fit ({\bf Glob\-Exp} {\em ex}[$\,$], {\bf Glob} $\ast$ {\em globs})}\label{outFit_8cc_89e77e765b35e43fc6de7e0d52e83ae7}




Definition at line 11 of file out\-Fit.cc.

References Glob::covar, dmatrix(), FALSE, Glob::npar, Glob::nr\-Exp, Glob\-Exp::nvar, Glob::strategy, and Glob::y0fix.

\footnotesize\begin{verbatim}12 {
13   long i,j;
14   long nExp;
15   long nvar,npar,nglob=0;
16   long ind=1;
17 
18   npar=globs->npar;     
19   nvar=ex[1].nvar;
20 
21   double **errorS=dmatrix(1,globs->nrExp,1,nvar);
22   double **errorP=dmatrix(1,globs->nrExp,1,npar);
23   
24 
25   if(globs->strategy!=2)
26     {
27       //prepare output
28       for(nExp=1;nExp<=globs->nrExp;++nExp) 
29         {
30           for(i=1;i<=nvar;i++)
31             errorS[nExp][i]=-1;
32           for(i=1;i<=npar;i++)
33             errorP[nExp][i]=-1;
34           
35           for(i=1;i<=nvar;i++)
36             {
37               if(globs->y0fix[i]!=FALSE)
38                 {
39                   errorS[nExp][i]=sqrt(globs->covar[ind][ind]);
40                   ind++;
41                 }
42             }
43           for(i=1;i<=npar;i++)
44             {
45               if(globs->doP[i]=='L')
46                 {
47                   errorP[nExp][i]=sqrt(globs->covar[ind][ind]);
48                   ind++;
49                   nglob++;
50                 }
51             }
52         }
53       
54       for(i=1;i<=npar;i++)
55         {
56           if(globs->doP[i]==TRUE)
57             {
58               for(nExp=1;nExp<=globs->nrExp;++nExp) 
59                 {
60                   errorP[nExp][i]=sqrt(globs->covar[ind][ind]);
61                 }
62               ind++;
63             }
64         } 
65     }  //end if(globs->strategy..)
66 
67   /* print results */
68   if(globs->silent!=TRUE)
69     {
70       cout << "Number of iterations: " << globs->nIter << ", chi^2 = " << globs->chisq << "\n\n";
71       cout << "\nBest fit parameters +/- standard errors:\n";
72       cout << "----------------------------------------\n\n"; 
73       
74       cout << "Global Parameters:\n";
75       for(j=1;j<=npar;j++)
76         { 
77           if(globs->doP[j]!='L')
78             {
79               if(globs->strategy!=2)
80                 {
81                   for(nExp=1;nExp<=globs->nrExp;++nExp) 
82                     ex[nExp].errP[j]=errorP[1][j];
83                   cout << ParameterNames[j-1];
84                   if(errorP[1][j]!=-1)
85                     cout << " = " << ex[1].par[j] <<  " +/- " << errorP[1][j] << endl;
86                   else
87                     cout << " (fixed)\n";
88                 }
89               else
90                 cout << ParameterNames[j-1] << " = " << ex[1].par[j] << endl;
91                 
92                 
93             }
94         }
95       cout << endl;
96       for(i=1;i<=globs->nrExp;++i) 
97         {
98           cout << "Experiment " << i << ":";
99           if(nglob!=0)
100             cout << "\n\nLocal Parameters:\n";
101           else
102             cout << endl;
103           
104           for(j=1;j<=npar;j++)
105             {
106               if(globs->doP[j]=='L')
107                 {
108                   if(globs->strategy!=2)
109                     {
110                       ex[i].errP[j]=errorP[i][j];
111                       cout << ParameterNames[j-1] << " = " << ex[i].par[j];
112                       if(errorP[i][j]!=-1)
113                         cout <<  " +/- " << errorP[i][j] << endl;
114                       else
115                         cout << " (fixed)\n";
116                     }
117                   else
118                     cout << ParameterNames[j-1] << " = " << ex[i].par[j] << endl;
119                 }
120             }
121           cout << "Initial Values" << endl;
122           for(j=1;j<=nvar;j++)
123             {
124               if(globs->strategy!=2)
125                 {
126                   ex[i].errY0[j]=errorS[i][j];
127                   cout << VariableNames[j-1] << " = " << ex[i].yTry[1][j];
128                   if(errorS[i][j]!=-1)
129                     cout <<  " +/- " << errorS[i][j] << endl;
130                   else
131                     cout << " (fixed)\n";
132                 }
133               else
134                 cout << VariableNames[j-1] << " = " << ex[i].yTry[1][j] << endl;
135             }
136           cout << endl;
137         }
138     } //end of --> if(silent!=TRUE)
139 
140   free_dmatrix(errorS,1,globs->nrExp,1,nvar);
141   free_dmatrix(errorP,1,globs->nrExp,1,npar);
142 }
\end{verbatim}\normalsize 


