Welcome to mirror list, hosted at ThFree Co, Russian Federation.

Problem.h « mkcls-v2 - github.com/moses-smt/giza-pp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 337390ea1d5285b853ed03098a3f044fdfdb6773 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
/*

Copyright (C) 1997,1998,1999,2000,2001  Franz Josef Och

mkcls - a program for making word classes .

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, 
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 
USA.

*/







#ifndef PROBLEMCHANGE
#define PROBLEMCHANGE 
#include <iostream>
#include "general.h"
#include "StatVar.h"

class Optimization;

class ProblemChange

{
	public:
	virtual ~ProblemChange();
	ProblemChange();
};

class Problem {

 private:
  short initialized; 
  int curCompVal;        
  short curCompChange;   
  int maxCompVal;        
  int maxComp;           

  
 protected:
  int curComp;           

 void setValuesFrom(Problem *p);

   virtual int maxDimensionVal(void) ;
  

   virtual int maxDimension(void) ;
  
  
   inline int curDimension(void) { assert(maxComp!=-1);return curComp;}
  

   inline int curDimensionVal(void) { assert(maxComp!=-1);return curCompVal;}
  


   virtual void  _doChange(ProblemChange &c)=0;
  

   virtual int   _change(ProblemChange **p)=0;
  

   virtual void  _undoChange(ProblemChange &c)=0;
  

   virtual void  _initialize(int initialisierung)=0;
  

   virtual double  _value()=0;
  

 public:
   Problem(int maxCompVal=-1,int maxComp=-1,int _initialisierung=0,
		      int _auswertung=0,int _nachbarschaft=0); 

   virtual ~Problem();
  
  
   void doChange(ProblemChange &c);
  

   ProblemChange& change();			
  

   virtual double  value();
  

   virtual double  valueChange(ProblemChange &c);
  

   virtual void  initialize(int a= -23);
  

   inline virtual short endCriterion();	
  

   virtual int   maxNonBetterIterations()=0;
  

   virtual int   expectedNumberOfIterations()=0;
  

   virtual void dumpOn(ostream &strm);
  

   virtual void dumpInfos(ostream &strm);
  

   virtual Problem *makeEqualProblem()=0;
  

   virtual double nicevalue(double vorher=1e100);
  

   virtual StatVar& deviationStatVar(Optimization &s,int anz);
  

   virtual void incrementDirection();
  

  
  
  
  int initialisierung;
  int auswertung;
  int nachbarschaft;
  
  int numberOfFullEvaluations; 
  int numberOfPartEvaluations; 
  int numberOfDoChange;        
                               

 
};

inline short Problem::endCriterion()
{ 
  return 0;
};	

#endif