SGSolve
SGTuple Class Reference
Collaboration diagram for SGTuple:

Public Member Functions

 SGTuple (int numStates)
 Initializes tuple to _numStates zero-vectors.
 
 SGTuple (int _numStates, const SGPoint &point)
 Initializes tuple to _numPoints copies of point.
 
 SGTuple ()
 Default constructor for empty tuple.
 
SGPoint expectation (const vector< double > &prob) const
 Mathematical expectation. More...
 
double expectation (const vector< double > &prob, int player) const
 Mathematical expectation for one player. More...
 
SGPoint average () const
 Returns the average of the points in the tuple.
 
double average (int player) const
 Returns the average coordinate for a player in the tuple.
 
bool strictlyLessThan (const SGTuple &tuple, int coordinate) const
 Strictly less than. More...
 
bool anyNaN () const
 Check if any of the entries are NaN.
 
void roundTuple (double tol)
 Round off significant digits smaller than tol.
 
double max (int coordinate) const
 Returns the maximum in a given coordinate.
 
double min (int coordinate) const
 Returns the minimum in a given coordinate.
 
double max (int coordinate, int &index) const
 Max and puts argmax in index.
 
double min (int coordinate, int &index) const
 Min and puts argmin in index.
 
SGPoint max () const
 Returns a point equal to the pointwise maximum.
 
SGPoint min () const
 Returns a point equal to the pointwise minimum.
 
void maxmin (int coordinate, double &max, int &maxIndex, double &min, int &minIndex) const
 Max and min. More...
 
void push_back (const SGPoint &point)
 Adds a new point to the back of the tuple.
 
void clear ()
 Sets the tuple equal to an empty tuple.
 
void erase (int start, int end)
 Erases elements.
 
void emplace (int location, const SGPoint &point)
 Adds an element at the location.
 
void unique (double tol)
 Removes non-unique elements.
 
int size () const
 Returns the number of points in the tuple.
 
SGPointoperator[] (int state)
 Random access operator.
 
const SGPointoperator[] (int state) const
 Const random access operator.
 
SGTupleoperator= (const SGTuple &rhs)
 Assignment operator.
 
SGTupleoperator+= (const SGTuple &rhs)
 Augmented addition of tuples.
 
SGTupleoperator-= (const SGTuple &rhs)
 Augmented subtraction of tuples.
 
SGTupleoperator+= (const SGPoint &rhs)
 Augmented addition of tuple with a point. More...
 
SGTupleoperator-= (const SGPoint &rhs)
 Augmented subtraction of tuple with a point. More...
 
SGTupleoperator*= (double d)
 Scalar multiplication of the tuple.
 
SGTupleoperator/= (double d)
 Scalar division of the tuple.
 
const SGTuple operator+ (const SGTuple &rhs) const
 Adds corresponding elements of lhs and rhs.
 
const SGTuple operator+ (const SGPoint &rhs) const
 Adds rhs to each element of lhs.
 
const SGTuple operator- (const SGTuple &rhs) const
 Subtracts corresponding elements of rhs from lhs.
 
const SGTuple operator- (const SGPoint &rhs) const
 Subtracts rhs from each element of lhs.
 
template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 Serialize using boost.
 

Static Public Member Functions

static double distance (const SGTuple &t0, const SGTuple &t1)
 Calculates the distance between t0 and t1 in the sup norm.
 

Private Attributes

vector< SGPointpoints
 

Friends

class boost::serialization::access
 
SGTuple operator* (double d, const SGTuple &point)
 Left scalar multiplication of a tuple.
 
SGTuple operator* (const SGTuple &point, double d)
 Right scalar multiplication of a tuple.
 
SGTuple operator/ (const SGTuple &point, double d)
 Right scalar division of a tuple.
 
ostream & operator<< (ostream &out, const SGTuple &rhs)
 Output formatted tuple to file stream.
 

Member Function Documentation

◆ expectation() [1/2]

SGPoint SGTuple::expectation ( const vector< double > &  prob) const

Mathematical expectation.

Returns the weighted sum of the points in the tuple using the weights in prob.

◆ expectation() [2/2]

double SGTuple::expectation ( const vector< double > &  prob,
int  player 
) const

Mathematical expectation for one player.

Returns the weighted sum of the player coordinate of the SGPoint objects in the tuple using the weights in prob.

◆ maxmin()

void SGTuple::maxmin ( int  coordinate,
double &  max,
int &  maxIndex,
double &  min,
int &  minIndex 
) const

Max and min.

Sets both the max, argmax, min, argmin in a given coordinate.

◆ operator+=()

SGTuple & SGTuple::operator+= ( const SGPoint rhs)

Augmented addition of tuple with a point.

Adds rhs to each element of the tuple.

◆ operator-=()

SGTuple & SGTuple::operator-= ( const SGPoint rhs)

Augmented subtraction of tuple with a point.

Subtracts rhs from each element of the tuple.

◆ strictlyLessThan()

bool SGTuple::strictlyLessThan ( const SGTuple tuple,
int  coordinate 
) const

Strictly less than.

Returns true if the calling object is strictly less than tuple in the player coordinate.

Member Data Documentation

◆ points

vector<SGPoint> SGTuple::points
private

Vector of SGTuple objects.


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