Changeset 1035 for trunk/yat/classifier


Ignore:
Timestamp:
Feb 5, 2008, 6:17:13 PM (13 years ago)
Author:
Peter
Message:

Constructor creating a MatrixLookupWeighted? from MatrixLookup?

Location:
trunk/yat/classifier
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/classifier/MatrixLookup.h

    r1000 r1035  
    282282   
    283283  private:
     284    friend class MatrixLookupWeighted;
     285
    284286    const utility::matrix* data_;
    285287  }; 
  • trunk/yat/classifier/MatrixLookupWeighted.cc

    r1000 r1035  
    2424
    2525#include "MatrixLookupWeighted.h"
     26#include "MatrixLookup.h"
    2627#include "yat/utility/matrix.h"
    2728
     
    4748      column_index_.push_back(i);
    4849  }
     50
    4951
    5052  MatrixLookupWeighted::MatrixLookupWeighted(const utility::matrix& data)
     
    6062      column_index_.push_back(i);
    6163  }
    62  
    63 
     64
     65
     66  MatrixLookupWeighted::MatrixLookupWeighted(const MatrixLookup& ml)
     67    : DataLookup2D(ml), data_(ml.data_)
     68  {
     69    weights_= new utility::matrix(data_->rows(), data_->columns(), 1.0);
     70    ref_count_weights_=new u_int(1);
     71    ref_count_=ml.ref_count_;
     72    if (ref_count_)
     73      ++(*ref_count_);
     74
     75  }
     76 
    6477
    6578  MatrixLookupWeighted::MatrixLookupWeighted(const utility::matrix& data,
  • trunk/yat/classifier/MatrixLookupWeighted.h

    r1000 r1035  
    3939
    4040namespace classifier { 
     41
     42  class MatrixLookup;
    4143
    4244  ///
     
    9193    ///
    9294    MatrixLookupWeighted(const utility::matrix& matrix);
     95
     96
     97    /**
     98       Constructor creating a MatrixLookupWeighted from a MatrixLookup. A
     99       weight matrix with unitary weights are created internally.
     100
     101       \note no check for nan is performed.
     102       
     103       \see   bool utility::nan(const matrix&, matrix&);
     104       
     105       @note If @a matrix goes out of scope or
     106       is deleted, the MatrixLookupWeighted becomes invalid and the
     107       result of further use is undefined.
     108    */
     109    MatrixLookupWeighted(const MatrixLookup& matrix);
    93110
    94111
Note: See TracChangeset for help on using the changeset viewer.