Changeset 1146 for trunk/yat


Ignore:
Timestamp:
Feb 25, 2008, 10:03:48 PM (13 years ago)
Author:
Peter
Message:

DataLookup1D is now a lookup into a MatrixLookup? closes #327

Location:
trunk/yat/classifier
Files:
5 edited

Legend:

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

    r1121 r1146  
    2525
    2626#include "DataLookup1D.h"
    27 #include "DataLookup2D.h"
    2827#include "MatrixLookup.h"
    2928
     
    3938namespace classifier {
    4039
    41   DataLookup1D::DataLookup1D(const DataLookup2D& m, const size_t i,
     40  DataLookup1D::DataLookup1D(const MatrixLookup& m, const size_t i,
    4241                             const bool row_vector)
    4342    : column_vector_(!row_vector), index_(i), matrix_(&m), owner_(false)
  • trunk/yat/classifier/DataLookup1D.h

    r1110 r1146  
    2727*/
    2828
    29 #include "DataLookup2D.h"
     29#include "MatrixLookup.h"
    3030#include "yat/utility/Container2DIterator.h"
    3131#include "yat/utility/iterator_traits.h"
     
    5151    /// 'Read Only' iterator
    5252    typedef utility::StrideIterator<
    53     utility::Container2DIterator<const DataLookup2D, const double, void,
     53    utility::Container2DIterator<const MatrixLookup, const double, void,
    5454                                 const double> >
    5555    const_iterator;
     
    6262    /// column. @param index which row/column to look into.
    6363    ///
    64     DataLookup1D(const DataLookup2D&, const size_t index,
     64    DataLookup1D(const MatrixLookup&, const size_t index,
    6565                 const bool row_vector);
    6666
     
    135135    const bool column_vector_;
    136136    const size_t index_;
    137     const DataLookup2D* matrix_;
     137    const MatrixLookup* matrix_;
    138138    const bool owner_;
    139139   
  • trunk/yat/classifier/Kernel.cc

    r1134 r1146  
    104104      return kf_->operator()(vec, DataLookupWeighted1D(*data_w_,i, false));
    105105    else
    106       return kf_->operator()(vec, DataLookup1D(*data_,i, false));
     106      return kf_->operator()(vec,DataLookup1D(dynamic_cast<const MatrixLookup&>
     107                                              (*data_),i, false));
    107108  }
    108109
     
    113114      return kf_->operator()(vec, DataLookupWeighted1D(*data_w_,i, false));
    114115    else
    115       return kf_->operator()(vec, DataLookup1D(*data_,i, false));
     116      return kf_->operator()(vec, DataLookup1D(dynamic_cast<const MatrixLookup&>
     117                                              (*data_),i, false));
    116118  }
    117119
  • trunk/yat/classifier/Kernel_MEV.cc

    r1000 r1146  
    7272                    DataLookupWeighted1D(*data_w_,column,false));
    7373    else
    74       return (*kf_)(DataLookup1D(*data_,row,false),
    75                     DataLookup1D(*data_,column,false));
     74      return (*kf_)(DataLookup1D(dynamic_cast<const MatrixLookup&>
     75                                 (*data_),row,false),
     76                    DataLookup1D(dynamic_cast<const MatrixLookup&>
     77                                 (*data_),column,false));
    7678  }
    7779
  • trunk/yat/classifier/Kernel_SEV.cc

    r1121 r1146  
    7070      for (size_t j=i; j<kernel_matrix_.columns(); j++)
    7171        kernel_matrix_(i,j) = kernel_matrix_(j,i) =
    72           (*kf_)(DataLookup1D(*data_,i,false),DataLookup1D(*data_,j,false));
     72          (*kf_)(DataLookup1D(dynamic_cast<const MatrixLookup&>(*data_),i,false),
     73                 DataLookup1D(dynamic_cast<const MatrixLookup&>(*data_),j,false));
    7374  }
    7475
Note: See TracChangeset for help on using the changeset viewer.