Changeset 815 for trunk/yat


Ignore:
Timestamp:
Mar 17, 2007, 1:10:44 AM (15 years ago)
Author:
Peter
Message:

added constructor for DataLookup1D from a utility::vector

Location:
trunk/yat/classifier
Files:
2 edited

Legend:

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

    r766 r815  
    7373
    7474
     75  DataLookup1D::DataLookup1D(const utility::vector& v)
     76    : column_vector_(true), index_(0), owner_(true)
     77  {
     78    utility::matrix* m = new utility::matrix(1,v.size());
     79    for (size_t i=0; i<v.size(); ++i){
     80      (*m)(0,i)=v(i);
     81    }
     82    matrix_ = new MatrixLookup(*m, true);
     83  }
     84
     85
    7586  DataLookup1D::~DataLookup1D()
    7687  {
  • trunk/yat/classifier/DataLookup1D.h

    r767 r815  
    7676    DataLookup1D(const utility::vector& vec, const std::vector<size_t>& index);
    7777
     78    /**
     79       @brief Create general view from utility::vector
     80   
     81       Constructor creates a proper MatrixLookup that object can view
     82       into. Object is owner of this underlying MatrixLookup. Object fulfills
     83       \f$ x(i) = vec(i) \f$
     84    */
     85    DataLookup1D(const utility::vector& vec);
     86
    7887    ///
    7988    /// @brief Destructor deletes underlying DataLookup2D if object is owner
Note: See TracChangeset for help on using the changeset viewer.