Changeset 1193 for trunk/yat/classifier


Ignore:
Timestamp:
Feb 29, 2008, 8:48:45 PM (13 years ago)
Author:
Peter
Message:

changing operator() in weighted lookups and removing operator[] in 1D lookups

Location:
trunk/yat/classifier
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/classifier/DataLookup1D.cc

    r1146 r1193  
    125125
    126126
    127   double DataLookup1D::operator[](const size_t i) const
    128   {
    129     return this->operator()(i);
    130   }
    131 
    132 
    133127  double DataLookup1D::operator*(const DataLookup1D& other) const
    134128  {
  • trunk/yat/classifier/DataLookup1D.h

    r1170 r1193  
    121121
    122122    ///
    123     /// @brief access operator
    124     ///
    125     double operator[](const size_t i) const;
    126 
    127     ///
    128123    /// scalar product
    129124    ///
  • trunk/yat/classifier/DataLookupWeighted1D.cc

    r1088 r1193  
    115115
    116116
    117   double DataLookupWeighted1D::operator()(const size_t i) const
     117  std::pair<double,double> DataLookupWeighted1D::operator()(const size_t i) const
    118118  {
    119119    return column_vector_ ? (*matrix_)(i,index_) : (*matrix_)(index_,i);
     
    121121
    122122
    123   double DataLookupWeighted1D::operator[](const size_t i) const
    124   {
    125     return this->operator()(i);
    126   }
    127 
    128123}}} // of namespace classifier, yat, and theplu
  • trunk/yat/classifier/DataLookupWeighted1D.h

    r1111 r1193  
    112112    /// @return data(i) * weight(i)
    113113    ///
    114     double operator()(const size_t i) const;
    115 
    116     ///
    117     /// @return data(i) * weight(i)
    118     ///
    119     double operator[](const size_t i) const;
     114    std::pair<double, double> operator()(const size_t i) const;
    120115
    121116  private:
  • trunk/yat/classifier/MatrixLookupWeighted.cc

    r1170 r1193  
    286286
    287287
    288   double MatrixLookupWeighted::operator()(const size_t row,
    289                                           const size_t column) const
     288  std::pair<double, double>
     289  MatrixLookupWeighted::operator()(const size_t row, const size_t column) const
    290290  {
    291     return (weight(row,column) ? data(row,column)*weight(row,column) : 0);
     291    return std::make_pair(data(row, column), weight(row,column));
    292292  }
    293293
  • trunk/yat/classifier/MatrixLookupWeighted.h

    r1192 r1193  
    324324    /// Access operator
    325325    ///
    326     /// @return weight * data for element (@a row, @a column)
    327     ///
    328     double operator()(const size_t row, const size_t column) const;
     326    /// @return data-weight pair (@a row, @a column)
     327    ///
     328    std::pair<double, double>
     329    operator()(const size_t row, const size_t column) const;
    329330
    330331    ///
Note: See TracChangeset for help on using the changeset viewer.