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

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjfouet <jfouet@1f5c12ca-751b-0410-a591-d2e778427230>2008-05-15 23:09:01 +0400
committerjfouet <jfouet@1f5c12ca-751b-0410-a591-d2e778427230>2008-05-15 23:09:01 +0400
commitb231ffc8b1d9b81e5f5a6188327b157763344349 (patch)
tree8aa46ba4c84333575e2f03c4d79593f2f6f32103 /mert/Point.h
parentad2ee87603dde378c6c275ee29c7b5402396ed6c (diff)
add Types.h to unify the typedefs
git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk@1713 1f5c12ca-751b-0410-a591-d2e778427230
Diffstat (limited to 'mert/Point.h')
-rw-r--r--mert/Point.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/mert/Point.h b/mert/Point.h
index 6862e6c14..723a146d0 100644
--- a/mert/Point.h
+++ b/mert/Point.h
@@ -1,16 +1,16 @@
#ifndef POINT_H
#define POINT_H
#include <vector>
+#include "Types.h"
#include "FeatureStats.h"
#include <cassert>
-typedef float lambda,statscore;
class Optimizer;
/**class that handle the subset of the Feature weight on which we run the optimization*/
-class Point:public vector<lambda>{
+class Point:public parameters_t{
friend class Optimizer;
private:
/**The indices over which we optimize*/
@@ -18,7 +18,7 @@ class Point:public vector<lambda>{
/**dimension of optindices and of the parent vector*/
static unsigned dim;
/**fixed weights in case of partial optimzation*/
- static map<unsigned,lambda> fixedweights;
+ static map<unsigned,parameter_t> fixedweights;
/**total size of the parameter space; we have pdim=FixedWeight.size()+optinidices.size()*/
static unsigned pdim;
static unsigned ncall;
@@ -26,10 +26,10 @@ class Point:public vector<lambda>{
static unsigned getdim(){return dim;}
static unsigned getpdim(){return pdim;}
static bool OptimizeAll(){return fixedweights.empty();};
- statscore score;
- Point():vector<lambda>(dim){};
- Point(vector<lambda> init):vector<lambda>(init){assert(init.size()==dim);};
- void Randomize(const std::vector<lambda>&min,const std::vector<lambda>& max);
+ statscore_t score;
+ Point():parameters_t(dim){};
+ Point(parameters_t init):parameters_t(init){assert(init.size()==dim);};
+ void Randomize(const parameters_t& min,const parameters_t& max);
double operator*(const FeatureStats&)const;//compute the feature function
Point operator+(const Point&)const;
Point operator*(float)const;
@@ -37,7 +37,7 @@ class Point:public vector<lambda>{
friend ostream& operator<<(ostream& o,const Point& P);
void Normalize();
/**return a vector of size pdim where all weights have been put*/
- vector<lambda> GetAllWeights()const;
+ parameters_t GetAllWeights()const;
};
#endif