STK++ 0.9.13
STK::AdditiveBSplineRegressionPage Class Reference

In this Page, we manage the options for the computation of the Additive BSpline regression. More...

#include <STK_AdditiveBSplineRegressionPage.h>

Inheritance diagram for STK::AdditiveBSplineRegressionPage:
Inheritance graph

Public Member Functions

 AdditiveBSplineRegressionPage (int const &level)
 constructor.
 
 AdditiveBSplineRegressionPage (AdditiveBSplineRegressionPage const &page)
 copy constructor.
 
virtual ~AdditiveBSplineRegressionPage ()
 destructor.
 
int nbControlPoints () const
 number of control points
 
int degree () const
 degree of the BSpline
 
Regress::KnotsPosition const & knotsPositions () const
 get the method for positioning the knots.
 
virtual bool validate ()
 validate the options.
 
virtual AdditiveBSplineRegressionPage * clone () const
 Create a copy of the AdditiveBSplineRegressionPage.
 
- Public Member Functions inherited from STK::IPage
 IPage (String const &name, int const &level, bool isOptional)
 Constructor.
 
 IPage (IPage const &page)
 Copy constructor.
 
virtual ~IPage ()
 Destructor.
 
String const & name () const
 name of the IPage.
 
bool isOptional () const
 is this Option optional ?.
 
ContOption const & options () const
 get the options of the IPage
 
String const & msg_error () const
 name of the IPage.
 
Option & option (String const &name)
 bookkeeping function.
 
Option const & option (String const &name) const
 bookkeeping function.
 
Option const & option (int const &pos) const
 get the ith constant option of the IPage
 
Option & option (int const &pos)
 get the ith option of the IPage
 
Option const & operator[] (int const &pos) const
 get the ith constant option of the IPage
 
Option & operator[] (int const &pos)
 get the ith option of the IPage
 
void addOption (Option const &opt)
 add an option to the page
 
void addPage (IPage const &page)
 add a sub-page as an option to the page
 
void read (istream &is)
 read in options from an input steam stream
 
void write (ostream &os) const
 write out options in a stream
 

Protected Attributes

int nbControlPoints_
 Number of control points.
 
int degree_
 degree of the splines
 
Regress::KnotsPosition position_
 positions of the knots.
 
- Protected Attributes inherited from STK::IPage
bool isOptional_
 true if the Page is optinal, false otherwise
 
ContOption options_
 array of the options
 
String msg_error_
 Contain the last error message.
 

Additional Inherited Members

- Public Types inherited from STK::IPage
typedef std::vector< Option > ContOption
 Container for the options.
 

Detailed Description

In this Page, we manage the options for the computation of the Additive BSpline regression.

The AdditiveBSplineRegression page have the form

# AdditiveBSplineRegression options
# number of control point
# degree of the BSpline
degree = 3
# disposition of the knots uniform/periodic
int nbControlPoints() const
number of control points
Regress::KnotsPosition const & knotsPositions() const
get the method for positioning the knots.
Compute an additive BSpline, multivalued, regression function using BSpline basis.
The MultidimRegression class allows to regress a multidimensional output variable among a multivariat...

Definition at line 59 of file STK_AdditiveBSplineRegressionPage.h.

Constructor & Destructor Documentation

◆ AdditiveBSplineRegressionPage() [1/2]

STK::AdditiveBSplineRegressionPage::AdditiveBSplineRegressionPage ( int const &  level)

constructor.

Parameters
levelthe level of the option page

Definition at line 51 of file STK_AdditiveBSplineRegressionPage.cpp.

52 : IPage(_T("AdditiveBSplineRegression"), level, true)
54 , degree_(3)
56
57
58{
59 // reserve for the 4 options
60 options_.reserve(3);
61 // first option : standardize or no the data set
62 options_.push_back(Option(_T("nbControlPoints"), Option::integer_, true));
63 options_.back().setValue(_T("7"));
64 // degree f the spline
65 options_.push_back(Option(_T("degree"), Option::integer_, true));
66 options_.back().setValue(_T("2"));
67 // first option : type of model
68 options_.push_back(Option(_T("knotsPositions"), Option::string_, true));
69 options_.back().setValue(_T("uniform"));
70}
#define _T(x)
Let x unmodified.
Regress::KnotsPosition position_
positions of the knots.
ContOption options_
array of the options
Definition STK_IPage.h:201
IPage(String const &name, int const &level, bool isOptional)
Constructor.
Definition STK_IPage.cpp:72
@ integer_
discrete number
Definition STK_Option.h:76
@ string_
characters
Definition STK_Option.h:74
@ periodicKnotsPositions_
periodic knots

References _T, STK::Option::integer_, STK::IPage::options_, and STK::Option::string_.

◆ AdditiveBSplineRegressionPage() [2/2]

STK::AdditiveBSplineRegressionPage::AdditiveBSplineRegressionPage ( AdditiveBSplineRegressionPage const &  page)

copy constructor.

Parameters
pagethe page to copy

Definition at line 73 of file STK_AdditiveBSplineRegressionPage.cpp.

74 : IPage(page)
75 , nbControlPoints_(page.nbControlPoints_)
76 , degree_(page.degree_)
77 , position_(page.position_)
78{}

◆ ~AdditiveBSplineRegressionPage()

STK::AdditiveBSplineRegressionPage::~AdditiveBSplineRegressionPage ( )
virtual

destructor.

Definition at line 81 of file STK_AdditiveBSplineRegressionPage.cpp.

82{ }

Member Function Documentation

◆ clone()

virtual AdditiveBSplineRegressionPage * STK::AdditiveBSplineRegressionPage::clone ( ) const
inlinevirtual

Create a copy of the AdditiveBSplineRegressionPage.

Returns
a pointer on the clone of this

Reimplemented from STK::IPage.

Definition at line 93 of file STK_AdditiveBSplineRegressionPage.h.

94 { return new AdditiveBSplineRegressionPage(*this);}
AdditiveBSplineRegressionPage(int const &level)
constructor.

◆ degree()

int STK::AdditiveBSplineRegressionPage::degree ( ) const
inline

degree of the BSpline

Returns
the degree of the spline

Definition at line 80 of file STK_AdditiveBSplineRegressionPage.h.

80{ return degree_;}

References degree_.

◆ knotsPositions()

Regress::KnotsPosition const & STK::AdditiveBSplineRegressionPage::knotsPositions ( ) const
inline

get the method for positioning the knots.

Returns
the method for positioning the knots

Definition at line 84 of file STK_AdditiveBSplineRegressionPage.h.

85 { return position_;}

References position_.

◆ nbControlPoints()

int STK::AdditiveBSplineRegressionPage::nbControlPoints ( ) const
inline

number of control points

Returns
the number of control point

Definition at line 76 of file STK_AdditiveBSplineRegressionPage.h.

76{ return nbControlPoints_;}

References nbControlPoints_.

◆ validate()

bool STK::AdditiveBSplineRegressionPage::validate ( )
virtual

validate the options.

Check if the values are coherent.

Reimplemented from STK::IPage.

Definition at line 85 of file STK_AdditiveBSplineRegressionPage.cpp.

86{
87 // first option
88 nbControlPoints_ = options_[0].get(int());
89 if ( (nbControlPoints_ <= 0))
90 {
91 msg_error_ = BSPLINEERRORCODES[1];
92 msg_error_ += "nbControlPoints must be strictly positive\n";
93 return false;
94 }
95 // second option
96 degree_ = options_[1].get(int());
97 if ( (degree_ <= 0))
98 {
99 msg_error_ = BSPLINEERRORCODES[1];
100 msg_error_ += "degree must be strictly positive\n";
101 return false;
102 }
103 if ( (nbControlPoints_ <= degree_))
104 {
105 msg_error_ = BSPLINEERRORCODES[1];
106 msg_error_ += "nbControlPoints must be strictly greater than degree.\n";
107 return false;
108 }
109
110 // third option
113 {
114 msg_error_ = BSPLINEERRORCODES[1];
115 msg_error_ += "knots position is unknown.\n";
116 return false;
117 }
118 // validation done
119 return true;
120}
String msg_error_
Contain the last error message.
Definition STK_IPage.h:204
@ unknown_Knots_Position_
unknown positions
std::basic_string< Char > String
STK fundamental type of a String.
KnotsPosition stringToKnotsPosition(String const &type)
convert a String to a KnotsPosition.

References degree_, STK::IPage::msg_error_, nbControlPoints_, STK::IPage::options_, position_, STK::Regress::stringToKnotsPosition(), and STK::Regress::unknown_Knots_Position_.

Member Data Documentation

◆ degree_

int STK::AdditiveBSplineRegressionPage::degree_
protected

degree of the splines

Definition at line 100 of file STK_AdditiveBSplineRegressionPage.h.

Referenced by degree(), and validate().

◆ nbControlPoints_

int STK::AdditiveBSplineRegressionPage::nbControlPoints_
protected

Number of control points.

Definition at line 98 of file STK_AdditiveBSplineRegressionPage.h.

Referenced by nbControlPoints(), and validate().

◆ position_

Regress::KnotsPosition STK::AdditiveBSplineRegressionPage::position_
protected

positions of the knots.

Definition at line 102 of file STK_AdditiveBSplineRegressionPage.h.

Referenced by knotsPositions(), and validate().


The documentation for this class was generated from the following files: