25 #include "sgcommon.hpp"
26 #include "sgpoint.hpp"
27 #include "sgexception.hpp"
80 double expectation(
const vector<double> & prob,
int player)
const;
85 double average(
int player)
const;
102 double max(
int coordinate)
const;
104 double min(
int coordinate)
const;
107 double max(
int coordinate,
int & index)
const;
109 double min(
int coordinate,
int & index)
const;
118 void maxmin(
int coordinate,
119 double &
max,
int & maxIndex,
120 double &
min,
int & minIndex)
const;
127 void erase(
int start,
int end);
197 template<
class Archive>
203 friend class boost::serialization::access;
vector< SGPoint > points
Definition: sgtuple.hpp:54
static double distance(const SGPoint &p0, const SGPoint &p1)
Calculates distance between p0 and p1 in the sup-norm.
Definition: sgpoint.cpp:96
void maxmin(int coordinate, double &max, int &maxIndex, double &min, int &minIndex) const
Max and min.
Definition: sgtuple.cpp:320
const SGTuple operator+(const SGTuple &rhs) const
Adds corresponding elements of lhs and rhs.
Definition: sgtuple.cpp:159
int size() const
Returns the number of points in the tuple.
Definition: sgtuple.hpp:134
SGPoint average() const
Returns the average of the points in the tuple.
Definition: sgtuple.cpp:50
void serialize(Archive &ar, const unsigned int version)
Serialize using boost.
Definition: sgtuple.hpp:198
bool strictlyLessThan(const SGTuple &tuple, int coordinate) const
Strictly less than.
Definition: sgtuple.cpp:206
Tuple of SGPoint objects.
Definition: sgtuple.hpp:37
double tol
Definition: sgtuple.hpp:39
const SGTuple operator-(const SGTuple &rhs) const
Subtracts corresponding elements of rhs from lhs.
Definition: sgtuple.cpp:165
friend SGTuple operator*(double d, const SGTuple &point)
Left scalar multiplication of a tuple.
Definition: sgtuple.cpp:171
SGPoint & operator[](int state)
Random access operator.
Definition: sgtuple.hpp:138
SGTuple & operator*=(double d)
Scalar multiplication of the tuple.
Definition: sgtuple.cpp:142
SGPoint min() const
Returns a point equal to the pointwise minimum.
Definition: sgtuple.cpp:285
void roundTuple(double tol)
Round off significant digits smaller than tol.
Definition: sgtuple.cpp:341
void erase(int start, int end)
Erases elements.
Definition: sgtuple.cpp:246
SGTuple(int _numStates, const SGPoint &point)
Initializes tuple to _numPoints copies of point.
Definition: sgtuple.hpp:62
SGTuple & operator/=(double d)
Scalar division of the tuple.
Definition: sgtuple.cpp:149
void emplace(int location, const SGPoint &point)
Adds an element at the location.
Definition: sgtuple.cpp:251
bool anyNaN() const
Check if any of the entries are NaN.
Definition: sgtuple.cpp:226
static double distance(const SGTuple &t0, const SGTuple &t1)
Calculates the distance between t0 and t1 in the sup norm.
Definition: sgtuple.cpp:193
SGPoint max() const
Returns a point equal to the pointwise maximum.
Definition: sgtuple.cpp:280
friend SGTuple operator/(const SGTuple &point, double d)
Right scalar division of a tuple.
Definition: sgtuple.cpp:177
SGTuple & operator=(const SGTuple &rhs)
Assignment operator.
Definition: sgtuple.cpp:96
A vector in .
Definition: sgpoint.hpp:35
void unique(double tol)
Removes non-unique elements.
Definition: sgtuple.cpp:256
SGTuple & operator+=(const SGTuple &rhs)
Augmented addition of tuples.
Definition: sgtuple.cpp:105
void clear()
Sets the tuple equal to an empty tuple.
Definition: sgtuple.cpp:241
friend ostream & operator<<(ostream &out, const SGTuple &rhs)
Output formatted tuple to file stream.
Definition: sgtuple.cpp:180
SGTuple(int numStates)
Initializes tuple to _numStates zero-vectors.
Definition: sgtuple.hpp:58
SGTuple & operator-=(const SGTuple &rhs)
Augmented subtraction of tuples.
Definition: sgtuple.cpp:125
const SGPoint & operator[](int state) const
Const random access operator.
Definition: sgtuple.hpp:151
SGPoint expectation(const vector< double > &prob) const
Mathematical expectation.
Definition: sgtuple.cpp:27
void push_back(const SGPoint &point)
Adds a new point to the back of the tuple.
Definition: sgtuple.cpp:236
Definition: sgtuple.hpp:52
SGTuple()
Default constructor for empty tuple.
Definition: sgtuple.hpp:69