22 #ifndef _SGHYPERPLANE_HPP
23 #define _SGHYPERPLANE_HPP
25 #include "sgcommon.hpp"
26 #include "sgpoint.hpp"
27 #include "sgexception.hpp"
51 const vector<double> & _levels):
63 double expectation(
const vector<double> & prob)
const;
111 void round(
double tol);
114 template<
class Archive>
120 friend class boost::serialization::access;
SGHyperplane(int numStates)
Initializes tuple to _numStates zero-vectors.
Definition: sghyperplane.hpp:46
const vector< double > & getLevels() const
Get the levels.
Definition: sghyperplane.hpp:84
SGHyperplane & operator+=(const SGHyperplane &rhs)
Augmented addition of tuples.
Definition: sghyperplane.cpp:65
vector< double > levels
Definition: sghyperplane.hpp:42
const SGPoint & getNormal() const
Get the normal.
Definition: sghyperplane.hpp:81
SGHyperplane & operator=(const SGHyperplane &rhs)
Assignment operator.
Definition: sghyperplane.cpp:55
static double distance(const SGHyperplane &t0, const SGHyperplane &t1)
Calculates the distance between t0 and t1 in the sup norm.
Definition: sghyperplane.cpp:98
friend SGHyperplane operator*(double d, const SGHyperplane &hp)
Left scalar multiplication of a tuple.
Definition: sghyperplane.cpp:92
SGHyperplane(const SGPoint &_normal, const vector< double > &_levels)
Initializes tuple to _numPoints copies of point.
Definition: sghyperplane.hpp:50
Represents a hyperplane in .
Definition: sghyperplane.hpp:39
SGHyperplane & operator*=(double d)
Scalar multiplication of the hyperplane.
Definition: sghyperplane.cpp:85
void clear()
Sets the levels equal to an empty vector.
Definition: sghyperplane.cpp:121
void setNormal(const SGPoint &newNorm)
Set the normal.
Definition: sghyperplane.hpp:78
void serialize(Archive &ar, const unsigned int version)
Serialize using boost.
Definition: sghyperplane.hpp:115
A vector in .
Definition: sgpoint.hpp:35
void round(double tol)
Round off significant digits smaller than tol.
Definition: sghyperplane.cpp:126
friend ostream & operator<<(ostream &out, const SGHyperplane &rhs)
Output formatted tuple to file stream.
Definition: sghyperplane.cpp:133
SGPoint normal
Definition: sghyperplane.hpp:41
int size() const
Returns the number of levels in the tuple.
Definition: sghyperplane.hpp:75
void push_back(double level)
Adds a new level to the back of the hyperplane.
Definition: sghyperplane.cpp:116
double expectation(const vector< double > &prob) const
Mathematical expectation.
Definition: sghyperplane.cpp:26
double & operator[](int state)
Random access the elements of the tuple.
Definition: sghyperplane.cpp:37
SGHyperplane & operator+=(double rhs)
Augmented addition of tuple with a point.
SGHyperplane & operator-=(const SGHyperplane &rhs)
Augmented subtraction of tuples.
Definition: sghyperplane.cpp:75
SGHyperplane()
Default constructor for empty tuple.
Definition: sghyperplane.hpp:57