Main Page | Class Hierarchy | Class List | File List | Class Members

ReadData.h

00001 #ifndef READDATA_H
00002 #define READDATA_H
00003 
00004 #include "XMLFile.h"
00005 #include "SmallString.h"
00006 #include "iostream.h"
00007 #include "SimpleList.h"
00008 #include <stdio.h>
00009 
00010 #include "Restrain.h"
00011 
00012 #include "global.h"
00013 
00014 
00015 using namespace std;
00016 
00017 //------------------
00018 
00030 struct Atom
00031 {
00032 
00036    REAL x;
00040    REAL y;
00044    REAL z;                   int id;
00048    int idFrg;
00052 
00056    int idLoc;
00060   CSmallString type;       
00064    bool ch; 
00065 };
00066 
00067 
00068 class CContrELECT;
00069 
00070 //--------------------------
00071 
00077 class CData
00078 {
00079 
00080  public:
00081 
00085         CData();
00089         ~CData();
00090 
00091 
00123         void Read(char *name); 
00124 
00128         void Delete();
00129         void PrintSelf();
00133         void Prepare(); void Postpare();        
00140 
00145         void CheckAllRestraints();
00146 
00154         int GetNumber(int id,int *idFrg,int *idLoc);    
00155 
00165         void EnergyFunction(int ndim, const ColumnVector& X, REAL& E, int& result);     
00166 
00174         void InitComputation (int ndim, ColumnVector& x);
00175         void SetFilenamePDBall(CSmallString &str) { strFilePDBall=str; }; 
00179         void SetFilenamePDBfinal(CSmallString &str) { strFilePDBfinal=str; };
00183         CSmallString & GetFilenamePDBall() { return strFilePDBall; };
00187 
00188 
00192         CSmallString & GetFilenamePDBfinal() { return strFilePDBfinal;};
00193 
00194         void SetFilenameEnergyGraph(CSmallString &str) { strFileEnergyGraph=str; };
00198 
00202         CSmallString & GetFilenameEnergyGraph() { return strFileEnergyGraph;};
00203 
00204 //----------------------------------------
00205 
00206 
00212 void ApplyTransformsToAllAtoms(const ColumnVector & X);
00213 
00217         void ExportDataPDB(const ColumnVector & X, FILE *fout); 
00221         void ExportDataPDB(const ColumnVector & X, char *name); 
00225         void ExportDataXML(const ColumnVector & X, char *name);
00226 
00227         int numFragments;       // number of fragments
00228         int *nF;                // number of atomu in each fragment
00229         CSmallString *idF;      // fragments Identificators
00230 
00231         int masterFragment;     // number of Governing Fragment
00232 
00233         Atom **Atoms;           // atoms in all fragments (two-dimensional array)
00234         int ** changingAtoms;   // references to atom that are change because of restrains
00235         int *cntChangeAtom;     // number of atoms that are change because 
00236                                 // of restrains in scope of restrain
00237 
00238 
00239         Point **points;         // structure for computing the points
00240         Point *centerF;         // center of Each fragments
00241         REAL *chargeF;          // charge of fragment
00242         bool *distribF;         // distribute charges to all atoms in fragment
00243 //----------------------
00244 
00245         int numRestrains;               // number of restrains
00246         CRestrain **restrains;          // array of CRestrains
00247         CContrELECT *contrEl;           
00248 
00249         CSmallString strFilePDBall;     // filename for all sequences
00250         CSmallString strFilePDBfinal;   // filename for the last frame
00251         CSmallString strFileEnergyGraph;        // filename for the energy graph
00252         
00253         int numIterations;              //number of Iteration (number of calling function optimize)
00254 
00255         void SetNumIterations(int a) { numIterations=a; };      
00256         void IncrementNumIterations(int a=1) { numIterations+=a; };     
00257 
00258  private: 
00259         void CreateQuickReferences();
00260         void CreateTableOfChangingAtoms();
00261         void DestructTableOfChangingAtoms();
00262         void PrintTableOfChangingAtoms();
00263         void PrintCentersOfFragments();
00264         void PrintPoints();
00265 
00266         void CenterOutFragments();
00267         void GetMemForPoints();
00268 
00269         void ComputeCenterOfFragments();
00270         void OpenOutputFiles();
00271         void CloseOutputFiles();
00272 
00273 
00274         FILE *fout_all_PDB,*fout_final_PDB;
00275         FILE *fout_EnergyGraph;
00276         int DataReaded;
00277 };
00278 
00279 
00283 class CFitting
00284 {
00285 public:
00286     CFitting();
00287     ~CFitting();
00291     void Initialize(int argc, char ** argv);
00295     void Run();
00299     void Finalize();
00300 
00301     CData data;
00302     CClock aclock;
00303 private: 
00304   int nDimension;
00305         void Print_help(FILE *stream, int exit_code);
00306         void ReadParameters(int argc, char ** argv);
00307 
00308   char output_file[100];
00309   char input_file[100];
00310   char output_file_allPDB[100];
00311   char output_file_energy[100];
00312   char input_file_finalPDB[100];
00313   char program_name[100];
00314 
00315   OptQNewton *objfcn;
00316   
00317 
00318 };
00319 
00320 #endif

Generated on Tue Apr 20 11:53:39 2004 for FragmentsFitting by doxygen 1.3.4