56 #ifndef FVWITHMULTICLASSCOEFS_HH 57 #define FVWITHMULTICLASSCOEFS_HH 69 template<
typename FV>
85 void setSVCoef(
unsigned int otherClassLabel,
double coef)
87 _sVCoefs[otherClassLabel] = coef;
90 double sVCoef(
unsigned int otherClassLabel)
const 92 return _sVCoefs[otherClassLabel];
97 return _sVCoefs.size();
114 {
return _fv.getLabel(); }
118 { _fv.setLabel( label); }
125 {
return _fv.square(); }
136 {
return _fv.operator[](index); }
139 {
return _fv.operator[](index); }
142 {
return _fv.begin(); }
145 {
return _fv.begin(); }
147 const_iterator
end()
const 148 {
return _fv.end(); }
151 {
return _fv.end(); }
154 {
return _fv.size(); }
157 {
return _fv.resize( s); }
165 std::vector<double> _sVCoefs;
168 template<
typename FV>
170 operator<<( std::ostream& os, const FVwithMultiClassCoefs<FV>& fv)
173 for(
unsigned int i = 0; i < fv.sVCoefs_size(); ++i)
175 os <<
" "<< fv.sVCoef(i);
178 os <<
") " << fv.origFeatureVector();
const_iterator begin() const
void setSVCoef(unsigned int otherClassLabel, double coef)
set Coeficients
double sVCoef(unsigned int otherClassLabel) const
const FV & origFeatureVector() const
std::vector< double > & sVCoefs()
reference operator[](int index)
FV::const_iterator const_iterator
unsigned int sVCoefs_size() const
const_iterator end() const
double dotProduct(const svt::FVwithMultiClassCoefs< FV > &fv) const
FV::const_reference const_reference
const std::vector< double > & sVCoefs() const
const_reference operator[](int index) const