2015-10-24 16:36:30 +03:00
|
|
|
/*
|
|
|
|
* Weights.h
|
|
|
|
*
|
|
|
|
* Created on: 24 Oct 2015
|
|
|
|
* Author: hieu
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef WEIGHTS_H_
|
|
|
|
#define WEIGHTS_H_
|
|
|
|
|
2015-10-26 19:32:47 +03:00
|
|
|
#include <iostream>
|
2015-10-29 21:15:12 +03:00
|
|
|
#include <vector>
|
2015-10-24 16:36:30 +03:00
|
|
|
#include "TypeDef.h"
|
|
|
|
|
2015-10-27 20:35:42 +03:00
|
|
|
class FeatureFunctions;
|
|
|
|
|
2015-10-24 16:36:30 +03:00
|
|
|
class Weights {
|
2015-10-26 19:32:47 +03:00
|
|
|
friend std::ostream& operator<<(std::ostream &, const Weights &);
|
2015-10-24 16:36:30 +03:00
|
|
|
public:
|
2015-10-27 20:35:42 +03:00
|
|
|
Weights();
|
|
|
|
virtual ~Weights();
|
2015-10-29 21:15:12 +03:00
|
|
|
void Init(const FeatureFunctions &ffs);
|
2015-10-27 20:35:42 +03:00
|
|
|
|
|
|
|
SCORE operator[](size_t ind) const {
|
2015-10-29 21:15:12 +03:00
|
|
|
return m_weights[ind];
|
2015-10-27 20:35:42 +03:00
|
|
|
}
|
2015-10-24 16:36:30 +03:00
|
|
|
|
2015-10-29 21:15:12 +03:00
|
|
|
void Debug(std::ostream &out, const FeatureFunctions &ffs) const;
|
|
|
|
|
2015-10-27 20:35:42 +03:00
|
|
|
void CreateFromString(const FeatureFunctions &ffs, const std::string &line);
|
2015-10-24 16:36:30 +03:00
|
|
|
|
2015-10-29 21:15:12 +03:00
|
|
|
protected:
|
|
|
|
std::vector<SCORE> m_weights;
|
2015-10-24 16:36:30 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* WEIGHTS_H_ */
|