Changeset 42 for trunk/src/SVM.h


Ignore:
Timestamp:
Feb 26, 2004, 4:06:20 PM (19 years ago)
Author:
Jari Häkkinen
Message:

Made a major revision of matrix and vector classes. Everything compiles
but the binaries have not been tested.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/SVM.h

    r37 r42  
    1414
    1515
    16 namespace thep_cpp_tools
    17 {
     16namespace theplu {
     17namespace cpptools { 
    1818 
    1919  class SVM
     
    2424       Constructor taking the kernel matrix and the target vector as input
    2525    */
    26     SVM(const thep_gsl_api::matrix&, const thep_gsl_api::vector&);
     26    SVM(const gslapi::matrix&, const gslapi::vector&);
    2727           
    2828    /**
     
    3434       Function will return \f$\alpha\f$
    3535    */
    36     inline thep_gsl_api::vector get_alpha() const;
     36    inline gslapi::vector get_alpha() const;
    3737
    3838    /**
    3939       Function will return the output from SVM
    4040    */
    41     inline thep_gsl_api::vector get_output() const;
     41    inline gslapi::vector get_output() const;
    4242
    4343   
     
    4545  private:
    4646    bool trained_;
    47     thep_gsl_api::matrix kernel_;
    48     thep_gsl_api::vector target_;
    49     thep_gsl_api::vector alpha_;
     47    gslapi::matrix kernel_;
     48    gslapi::vector target_;
     49    gslapi::vector alpha_;
    5050    double bias_;
    5151
     
    5858
    5959    */
    60     bool SVM::stop(const thep_gsl_api::vector& target_,
    61        const thep_gsl_api::matrix& kernel_,
    62        const thep_gsl_api::vector& alpha_);
     60    bool SVM::stop(const gslapi::vector& target_,
     61       const gslapi::matrix& kernel_,
     62       const gslapi::vector& alpha_);
    6363  };
    6464 
    6565    // class SVM
    66   thep_gsl_api::vector SVM::get_alpha() const 
     66  gslapi::vector SVM::get_alpha() const 
    6767  {
    6868    return alpha_;
    6969  }
    7070
    71   thep_gsl_api::vector SVM::get_output() const 
     71  gslapi::vector SVM::get_output() const 
    7272  {
    73     thep_gsl_api::vector bias(target_.size(), false, false);
     73    gslapi::vector bias(target_.size());
    7474    bias.set_all(bias_);
    7575    return kernel_ * alpha_.mul_elements(target_) + bias;
    7676   
    7777  }
    78 }; // namespace thep_c++_tools
     78
     79}} // of namespace cpptools and namespace theplu
    7980
    8081#endif
Note: See TracChangeset for help on using the changeset viewer.