SHOGUN  3.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PNorm.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation; either version 3 of the License, or
5  * (at your option) any later version.
6  *
7  * Written (W) 2012 Viktor Gal
8  * Copyright (C) 2012 Viktor Gal
9  */
10 
11 #ifndef _PNORM_ONE__H__
12 #define _PNORM_ONE__H__
13 
14 #include <shogun/lib/config.h>
15 
18 #include <shogun/lib/common.h>
19 
20 
21 namespace shogun
22 {
32 class CPNorm : public CDensePreprocessor<float64_t>
33 {
34  public:
36  CPNorm ();
37 
41  CPNorm (double p);
42 
44  virtual ~CPNorm ();
45 
47  virtual bool init (CFeatures* features);
49  virtual void cleanup ();
51  virtual bool load (FILE* f);
53  virtual bool save (FILE* f);
54 
59 
63 
65  virtual const char* get_name () const { return "PNorm"; }
66 
68  virtual EPreprocessorType get_type () const { return P_PNORM; }
69 
74  void set_pnorm (double pnorm);
75 
80  double get_pnorm () const;
81 
82  private:
83  void register_param ();
84  inline float64_t get_pnorm (float64_t* vec, int32_t vec_len) const;
85 
86  private:
87  double m_p;
88 };
89 }
90 #endif /* _PNORM_ONE__H__ */

SHOGUN Machine Learning Toolbox - Documentation