source: molecuilder/src/parser.hpp@ b4c71a

Last change on this file since b4c71a was b4c71a, checked in by Frederik Heber <heber@…>, 17 years ago

ColumnCounter -> *ColumnCounter

columns of the MatrixContainer class may now be variable over each matrix. This was changed globally to allow for varying column numbers of the new class HessianMatrix.

  • Property mode set to 100644
File size: 4.0 KB
Line 
1/** \file parsing.hpp
2 *
3 * Definitions of various class functions for the parsing of value files.
4 *
5 */
6
7
8#ifndef PARSING_HPP_
9#define PARSING_HPP_
10
11using namespace std;
12
13// include config.h
14#ifdef HAVE_CONFIG_H
15#include <config.h>
16#endif
17
18// ======================================= DEFINES ==========================================
19
20#define EnergySuffix ".energy.all"
21#define EnergyFragmentSuffix ".energyfragment.all"
22#define ForcesSuffix ".forces.all"
23#define ForceFragmentSuffix ".forcefragment.all"
24#define HcorrectionSuffix ".Hcorrection.all"
25#define HcorrectionFragmentSuffix ".Hcorrectionfragment.all"
26#define HessianSuffix ".hessian_xx.all"
27#define HessianFragmentSuffix ".hessianfragment_xx.all"
28#define OrderSuffix ".Order"
29#define ShieldingSuffix ".sigma_all.csv"
30#define ShieldingPASSuffix ".sigma_all_PAS.csv"
31#define ShieldingFragmentSuffix ".sigma_all_fragment.all"
32#define ShieldingPASFragmentSuffix ".sigma_all_PAS_fragment.all"
33#define TimeSuffix ".speed"
34
35// ======================================= FUNCTIONS ==========================================
36
37bool FilePresent(const char *filename, bool test);
38bool TestParams(int argc, char **argv);
39
40
41// ======================================= CLASS MatrixContainer =============================
42
43class MatrixContainer {
44 public:
45 double ***Matrix;
46 int **Indices;
47 char *Header;
48 int MatrixCounter;
49 int *RowCounter;
50 int *ColumnCounter;
51
52 MatrixContainer();
53 ~MatrixContainer();
54
55 bool InitialiseIndices(class MatrixContainer *Matrix = NULL);
56 bool ParseMatrix(const char *name, int skiplines, int skipcolumns, int MatrixNr);
57 virtual bool ParseFragmentMatrix(char *name, char *prefix, string suffix, int skiplines, int skipcolumns);
58 bool AllocateMatrix(char *GivenHeader, int MCounter, int *RCounter, int *CCounter);
59 bool ResetMatrix();
60 double FindMinValue();
61 double FindMaxValue();
62 bool SetLastMatrix(double value, int skipcolumns);
63 bool SetLastMatrix(double **values, int skipcolumns);
64 //bool ParseIndices();
65 //bool SumSubValues();
66 bool SumSubManyBodyTerms(class MatrixContainer &Matrix, class KeySetsContainer &KeySet, int Order);
67 bool WriteTotalFragments(const char *name, const char *prefix);
68 bool WriteLastMatrix(const char *name, const char *prefix, const char *suffix);
69};
70
71// ======================================= CLASS EnergyMatrix =============================
72
73class EnergyMatrix : public MatrixContainer {
74 public:
75 bool SumSubEnergy(class EnergyMatrix &Fragments, class EnergyMatrix *CorrectionFragments, class KeySetsContainer &KeySet, int Order, double sign);
76 bool ParseFragmentMatrix(char *name, char *prefix, string suffix, int skiplines, int skipcolumns);
77};
78
79// ======================================= CLASS ForceMatrix =============================
80
81class ForceMatrix : public MatrixContainer {
82 public:
83 bool ParseIndices(char *name);
84 bool SumSubForces(class ForceMatrix &Fragments, class KeySetsContainer &KeySet, int Order, double sign);
85 bool ParseFragmentMatrix(char *name, char *prefix, string suffix, int skiplines, int skipcolumns);
86};
87
88// ======================================= CLASS HessianMatrix =============================
89
90class HessianMatrix : public MatrixContainer {
91 public:
92 bool ParseIndices(char *name);
93 bool SumSubHessians(class HessianMatrix &Fragments, class KeySetsContainer &KeySet, int Order, double sign);
94 bool ParseFragmentMatrix(char *name, char *prefix, string suffix, int skiplines, int skipcolumns);
95};
96
97// ======================================= CLASS KeySetsContainer =============================
98
99class KeySetsContainer {
100 public:
101 int **KeySets;
102 int *AtomCounter;
103 int FragmentCounter;
104 int Order;
105 int *FragmentsPerOrder;
106 int **OrderSet;
107
108 KeySetsContainer();
109 ~KeySetsContainer();
110
111 bool ParseKeySets(const char *name, const int *ACounter, const int FCounter);
112 bool ParseManyBodyTerms();
113 bool Contains(const int GreaterSet, const int SmallerSet);
114};
115
116// ======================================= END =============================================
117
118#endif /*PARSING_HPP_*/
Note: See TracBrowser for help on using the repository browser.