iCub-main
LinearScaler.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2007-2011 RobotCub Consortium, European Commission FP6 Project IST-004370
3  * author: Arjan Gijsberts
4  * email: arjan.gijsberts@iit.it
5  * website: www.robotcub.org
6  * Permission is granted to copy, distribute, and/or modify this program
7  * under the terms of the GNU General Public License, version 2 or any
8  * later version published by the Free Software Foundation.
9  *
10  * A copy of the license can be found at
11  * http://www.robotcub.org/icub/license/gpl.txt
12  *
13  * This program is distributed in the hope that it will be useful, but
14  * WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
16  * Public License for more details
17  */
18 
19 #ifndef LM_LINEARSCALER__
20 #define LM_LINEARSCALER__
21 
23 
24 namespace iCub {
25 namespace learningmachine {
26 
38 class LinearScaler : public IScaler {
39 protected:
40  /*
41  * Inherited from IScaler
42  */
43  virtual void writeBottle(yarp::os::Bottle& bot);
44 
45  /*
46  * Inherited from IScaler
47  */
48  virtual void readBottle(yarp::os::Bottle& bot);
49 
50 public:
57  LinearScaler(double s = 1, double o = 0);
58 
59  /*
60  * Inherited from IScaler
61  */
62  virtual std::string getInfo();
63 
64  /*
65  * Inherited from IScaler.
66  */
67  virtual bool configure(yarp::os::Searchable& config);
68 
69  /*
70  * Inherited from IScaler.
71  */
73  return new LinearScaler(*this);
74  }
75 
79  virtual double getScale() { return this->scale; }
80 
86  virtual void setScale(double s) { this->scale = s; }
87 
91  virtual double getOffset() { return this->offset; }
92 
98  virtual void setOffset(double o) { this->offset = o; }
99 
100 };
101 
102 } // learningmachine
103 } // iCub
104 
105 #endif
The IScaler is a linear scaler based scaler.
Definition: IScaler.h:41
double scale
The scale for the linear transformation.
Definition: IScaler.h:51
double offset
The offset for the linear transformation.
Definition: IScaler.h:46
A class that implements linear scaling as a preprocessing step.
Definition: LinearScaler.h:38
LinearScaler * clone()
Asks the scaler to return a new object of its type.
Definition: LinearScaler.h:72
virtual void setOffset(double o)
Mutator for the offset.
Definition: LinearScaler.h:98
virtual void setScale(double s)
Mutator for the scaling factor.
Definition: LinearScaler.h:86
virtual bool configure(yarp::os::Searchable &config)
virtual double getOffset()
Accessor for the offset.
Definition: LinearScaler.h:91
virtual void readBottle(yarp::os::Bottle &bot)
Unserializes a scaler from a bottle.
virtual void writeBottle(yarp::os::Bottle &bot)
Writes a serialization of the scaler into a bottle.
virtual double getScale()
Accessor for the scaling factor.
Definition: LinearScaler.h:79
LinearScaler(double s=1, double o=0)
Constructor.
virtual std::string getInfo()
Asks the learning machine to return a string containing statistics on its operation so far.
This file contains the definition of unique IDs for the body parts and the skin parts of the robot.