00001
00002
00003
00004
00005 #ifndef Midnight_h
00006 #define Midnight_h
00007
00008 #include "CalRecon/MString.h"
00009
00010 typedef unsigned char MBool;
00011 typedef int MInt;
00012 typedef double MDouble;
00013 typedef void(*MFunction)(MInt&,MDouble*,MDouble&,MDouble*,MInt);
00014 typedef void(*MPrintf)(const char*,...);
00015
00016 class Midnight {
00017 private:
00018 MInt fEmpty;
00019 MInt fMaxpar;
00020 MString *fCpnam;
00021 MDouble *fU;
00022 MDouble *fAlim;
00023 MDouble *fBlim;
00024 MDouble *fErp;
00025 MDouble *fErn;
00026 MDouble *fWerr;
00027 MDouble *fGlobcc;
00028 MInt *fNvarl;
00029 MInt *fNiofex;
00030 MInt *fNexofi;
00031 MDouble *fX;
00032 MDouble *fXt;
00033 MDouble *fDirin;
00034 MDouble *fXs;
00035 MDouble *fXts;
00036 MDouble *fDirins;
00037 MDouble *fGrd;
00038 MDouble *fG2;
00039 MDouble *fGstep;
00040 MDouble *fGin;
00041 MDouble *fDgrd;
00042 MDouble *fGrds;
00043 MDouble *fG2s;
00044 MDouble *fGsteps;
00045 MInt *fIpfix;
00046 MInt fNpfix;
00047 MDouble *fVhmat;
00048 MDouble *fVthmat;
00049 MDouble *fP;
00050 MDouble *fPstar;
00051 MDouble *fPstst;
00052 MDouble *fPbar;
00053 MDouble *fPrho;
00054 MInt fMaxint;
00055 MInt fNpar;
00056 MInt fMaxext;
00057 MInt fNu;
00058 MInt fIsysrd;
00059 MInt fIsyswr;
00060 MInt fIsyssa;
00061 MInt fNpagwd;
00062 MInt fNpagln;
00063 MInt fNewpag;
00064 MInt fIstkrd[10];
00065 MInt fNstkrd;
00066 MInt fIstkwr[10];
00067 MInt fNstkwr;
00068 MString fCfrom;
00069 MString fCstatu;
00070 MString fCtitl;
00071 MString fCword;
00072 MString fCundef;
00073 MString fCvrsn;
00074 MString fCovmes[4];
00075 MInt fISW[7];
00076 MInt fIdbg[11];
00077 MInt fNblock;
00078 MInt fIcomnd;
00079 MDouble fAmin;
00080 MDouble fUp;
00081 MDouble fEDM;
00082 MDouble fFval3;
00083 MDouble fEpsi;
00084 MDouble fApsi;
00085 MDouble fDcovar;
00086 MInt fNfcn;
00087 MInt fNfcnmx;
00088 MInt fNfcnlc;
00089 MInt fNfcnfr;
00090 MInt fItaur;
00091 MInt fIstrat;
00092 MInt fNwrmes[2];
00093 MDouble *fWord7;
00094 MBool fLwarn;
00095 MBool fLrepor;
00096 MBool fLimset;
00097 MBool fLnolim;
00098 MBool fLnewmn;
00099 MBool fLphead;
00100 MDouble fEpsmac;
00101 MDouble fEpsma2;
00102 MDouble fVlimlo;
00103 MDouble fVlimhi;
00104 MDouble fUndefi;
00105 MDouble fBigedm;
00106 MDouble fUpdflt;
00107 MDouble *fXpt;
00108 MDouble *fYpt;
00109 MString *fChpt;
00110 MDouble fXmidcr;
00111 MDouble fYmidcr;
00112 MDouble fXdircr;
00113 MDouble fYdircr;
00114 MInt fKe1cr;
00115 MInt fKe2cr;
00116 MString *fOrigin;
00117 MString *fWarmes;
00118 MInt fNfcwar[20];
00119 MInt fIcirc[2];
00120 MFunction fFCN;
00121 MPrintf fPrintf;
00122
00123
00124
00125 private:
00126 Midnight(const Midnight &m);
00127 void BuildArrays(MInt maxpar=15);
00128 void DeleteArrays();
00129 public:
00130 Midnight();
00131 Midnight(MInt maxpar);
00132 virtual ~Midnight();
00133 void SetFCN(MFunction);
00134 void SetPrintf(MPrintf);
00135
00136
00137
00138 int GetParameter(int parNo, double ¤tValue, double ¤tError );
00139
00140
00141 void mnamin();
00142 void mnbins(MDouble a1, MDouble a2, MInt naa, MDouble &bl, MDouble &bh, MInt &nb, MDouble &bwid);
00143 void mncalf(MDouble *pvec, MDouble &ycalf);
00144 void mncler();
00145 void mncntr(MInt ke1, MInt ke2, MInt &ierrf);
00146 void mncomd(MString crdbin, MInt &icondn);
00147 void mncont(MInt ke1, MInt ke2, MInt nptu, MDouble *xptu, MDouble *yptu, MInt &ierrf);
00148 void mncrck(MString &crdbuf, MInt maxcwd, MString &comand, MInt &lnc
00149 , MInt mxp, MDouble *plist, MInt &llist, MInt &ierr, MInt isyswr);
00150 void mncros(MDouble &aopt, MInt &iercr);
00151 void mncuve();
00152 void mnderi();
00153 void mndxdi(MDouble pint, MInt ipar, MDouble &dxdi);
00154 void mneig(MDouble *a, MInt ndima, MInt n, MInt mits, MDouble *work, MDouble precis, MInt &ifault);
00155 void mnemat(MDouble *emat, MInt ndim);
00156 void mnerrs(MInt number, MDouble &eplus, MDouble &eminus, MDouble &eparab, MDouble &gcc);
00157 void mneval(MDouble anext, MDouble &fnext, MInt &ierev);
00158 void mnexcm(MString comand, MDouble *plist, MInt llist, MInt &ierflg) ;
00159 void mnexin(MDouble *pint);
00160 void mnfixp(MInt iint, MInt &ierr);
00161 void mnfree(MInt k);
00162 void mngrad();
00163 void mnhelp(MString comd);
00164 void mnhess();
00165 void mnhes1();
00166 void mnimpr();
00167 void mninex(MDouble *pint);
00168 void mninit(MInt i1, MInt i2, MInt i3);
00169 void mnlims();
00170 void mnline(MDouble *start, MDouble fstart, MDouble *step, MDouble slope, MDouble toler);
00171 void mnmatu(MInt kode);
00172 void mnmigr();
00173 void mnmnos();
00174 void mnmnot(MInt ilax, MInt ilax2, MDouble &val2pl, MDouble &val2mi);
00175 void mnparm(MInt k, MString cnamj, MDouble uk, MDouble wk, MDouble a, MDouble b, MInt &ierflg);
00176 void mnpars(MString &crdbuf, MInt &icondn);
00177 void mnpfit(MDouble *parx2p, MDouble *pary2p, MInt npar2p, MDouble *coef2p, MDouble &sdev2p);
00178 void mnpint(MDouble &pexti, MInt i, MDouble &pinti);
00179 void mnplot(MDouble *xpt, MDouble *ypt, MString *chpt, MInt nxypt, MInt npagwd, MInt npagln);
00180 void mnpout(MInt iuext, MString& chnam, MDouble &val, MDouble &err, MDouble &xlolim, MDouble &xuplim, MInt &iuint);
00181 void mnprin(MInt inkode, MDouble fval);
00182 void mnpsdf();
00183 void mnrazz(MDouble ynew, MDouble *pnew, MDouble *y, MInt &jh, MInt &jl);
00184 void mnrn15(MDouble &val, MInt &inseed);
00185 void mnrset(MInt iopt);
00186 void mnsave();
00187 void mnscan();
00188 void mnseek();
00189 void mnset();
00190 void mnsimp();
00191 void mnstat(MDouble &fmin, MDouble &fedm, MDouble &errdef, MInt &npari, MInt &nparx, MInt &istat);
00192 void mntiny(MDouble epsp1, MDouble &epsbak);
00193 MBool mnunpt(MString &cfname);
00194 void mnvert(MDouble *a, MInt l, MInt m, MInt n, MInt &ifail);
00195 void mnwarn(const char *copt, const char *corg, const char *cmes);
00196 void mnwerr();
00197 };
00198
00199 #endif
00200
00201
00202
00203
00204
00205
00206
00207