SGSolve
SGHyperplane Class Reference

Represents a hyperplane in $\mathbb{R}^N$. More...

#include <sghyperplane.hpp>

Collaboration diagram for SGHyperplane:

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 SGPointgetNormal () 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.
 
SGHyperplaneoperator= (const SGHyperplane &rhs)
 Assignment operator.
 
SGHyperplaneoperator+= (const SGHyperplane &rhs)
 Augmented addition of tuples.
 
SGHyperplaneoperator-= (const SGHyperplane &rhs)
 Augmented subtraction of tuples.
 
SGHyperplaneoperator+= (double rhs)
 Augmented addition of tuple with a point. More...
 
SGHyperplaneoperator*= (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.
 

Detailed Description

Represents a hyperplane in $\mathbb{R}^N$.

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.

Member Function Documentation

◆ expectation()

double SGHyperplane::expectation ( const vector< double > &  prob) const

Mathematical expectation.

Returns the weighted sum of the levels using the weights in prob.

◆ operator+=()

SGHyperplane& SGHyperplane::operator+= ( double  rhs)

Augmented addition of tuple with a point.

Adds rhs to each level.

Member Data Documentation

◆ levels

vector<double> SGHyperplane::levels
private

Level attained in each state.

◆ normal

SGPoint SGHyperplane::normal
private

Normal normal to the hyperplanes.


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