SGSolve
|
Represents a hyperplane in . More...
#include <sghyperplane.hpp>
Public Member Functions | |
SGHyperplane (int numStates) | |
Initializes tuple to _numStates zero-vectors. | |
SGHyperplane (const SGPoint &_normal, const vector< double > &_levels) | |
Initializes tuple to _numPoints copies of point. | |
SGHyperplane () | |
Default constructor for empty tuple. | |
double | expectation (const vector< double > &prob) const |
Mathematical expectation. More... | |
void | push_back (double level) |
Adds a new level to the back of the hyperplane. | |
void | clear () |
Sets the levels equal to an empty vector. | |
int | size () const |
Returns the number of levels in the tuple. | |
void | setNormal (const SGPoint &newNorm) |
Set the normal. | |
const SGPoint & | getNormal () const |
Get the normal. | |
const vector< double > & | getLevels () const |
Get the levels. | |
double & | operator[] (int state) |
Random access the elements of the tuple. | |
const double & | operator[] (int state) const |
Constant random access to elements of the tuple. | |
SGHyperplane & | operator= (const SGHyperplane &rhs) |
Assignment operator. | |
SGHyperplane & | operator+= (const SGHyperplane &rhs) |
Augmented addition of tuples. | |
SGHyperplane & | operator-= (const SGHyperplane &rhs) |
Augmented subtraction of tuples. | |
SGHyperplane & | operator+= (double rhs) |
Augmented addition of tuple with a point. More... | |
SGHyperplane & | operator*= (double d) |
Scalar multiplication of the hyperplane. | |
void | round (double tol) |
Round off significant digits smaller than tol. | |
template<class Archive > | |
void | serialize (Archive &ar, const unsigned int version) |
Serialize using boost. | |
Static Public Member Functions | |
static double | distance (const SGHyperplane &t0, const SGHyperplane &t1) |
Calculates the distance between t0 and t1 in the sup norm. | |
Private Attributes | |
SGPoint | normal |
vector< double > | levels |
Friends | |
class | boost::serialization::access |
SGHyperplane | operator* (double d, const SGHyperplane &hp) |
Left scalar multiplication of a tuple. | |
SGHyperplane | operator* (const SGHyperplane &hp, double d) |
Right scalar multiplication of a tuple. | |
ostream & | operator<< (ostream &out, const SGHyperplane &rhs) |
Output formatted tuple to file stream. | |
Represents a hyperplane in .
Consists of a normal direction and a vector of levels, one for each state.
Used to represent half spaces in SGSolver_MaxMinMax and SGSolver_MaxMinMax_3Player.
double SGHyperplane::expectation | ( | const vector< double > & | prob | ) | const |
Mathematical expectation.
Returns the weighted sum of the levels using the weights in prob.
SGHyperplane& SGHyperplane::operator+= | ( | double | rhs | ) |
Augmented addition of tuple with a point.
Adds rhs to each level.
|
private |
Level attained in each state.
|
private |
Normal normal to the hyperplanes.