SGSolve
|
A vector in . More...
#include <sgpoint.hpp>
Public Member Functions | |
SGPoint () | |
Default constructor that sets vector equal to zero. | |
SGPoint (double _x) | |
Sets both elements of the vector equal to x. | |
SGPoint (int n) | |
Creates an n dimensional zero vector. | |
SGPoint (int n, double _x) | |
Creates an n dimensional zero vector. | |
SGPoint (vector< double > _x) | |
Creates an SGPoint from the two-vector _x. | |
SGPoint (double _x0, double _x1) | |
Creates an SGPoint with elements x and y. | |
~SGPoint () | |
Destructor. | |
int | size () const |
Returns the number of coordinates. | |
SGPoint | getNormal () const |
Returns the counter-clockwise normal vector. | |
double | norm () const |
Returns the Euclidean norm. | |
double | angle (const SGPoint &base) const |
Returns the angle in radians relative to base. | |
bool | rotateCCW (double pi) |
Rotates the point clockwise by pi radians. | |
bool | rotateCW (double pi) |
Rotates the point clockwise by pi radians. | |
bool | normalize () |
Normalizes so that the norm is one. | |
bool | anyNaN () const |
Checks if any of the entries are NaN. | |
void | roundPoint (double tol) |
Rounds off significant digits smaller than tol. | |
void | max (const SGPoint &p) |
Takes the pointwise minimum with another SGPoint. | |
void | min (const SGPoint &p) |
Takes the pointwise minimum with another SGPoint. | |
void | plusWithWeight (const SGPoint &p, double w) |
Plus with weight. | |
double & | operator[] (int player) |
Access operator. | |
const double & | operator[] (int player) const |
Constant access operator. | |
SGPoint & | operator= (const SGPoint &rhs) |
Assignment operator. | |
SGPoint & | operator= (double d) |
Sets both coordinates equal to d. | |
SGPoint & | operator+= (const SGPoint &rhs) |
Augmented addition. | |
SGPoint & | operator-= (const SGPoint &rhs) |
Augmented subtraction. | |
SGPoint & | operator-= (double d) |
Augmented subtraction. | |
SGPoint & | operator*= (double d) |
Augmented scalar multiplication. | |
SGPoint & | operator/= (double d) |
Augmented scalar division. | |
const SGPoint | operator+ (const SGPoint &rhs) const |
Vector addition. | |
const SGPoint | operator- (const SGPoint &rhs) const |
Vector subtraction. | |
const SGPoint | operator- (double d) const |
Vector subtraction. | |
double | operator* (const SGPoint &rhs) const |
Dot product. | |
bool | operator== (const SGPoint &rhs) const |
Equality. | |
bool | operator!= (const SGPoint &rhs) const |
Not equls. | |
bool | operator>= (const SGPoint &rhs) const |
Greater than or equal. | |
bool | operator> (const SGPoint &rhs) const |
Strictly greater. | |
bool | operator<= (const SGPoint &rhs) const |
Less than or equal. | |
bool | operator< (const SGPoint &rhs) const |
Strictly less. | |
bool | operator>= (double rhs) const |
Greater than or equal to a scalar. | |
bool | operator> (double rhs) const |
Strictly greater than a scalar. | |
bool | operator<= (double rhs) const |
Less than or equal to a scalar. | |
bool | operator< (double rhs) const |
Strictly less than a scalar. | |
template<class Archive > | |
void | serialize (Archive &ar, const unsigned int version) |
Serialize an SGPoint. | |
Static Public Member Functions | |
static double | distance (const SGPoint &p0, const SGPoint &p1) |
Calculates distance between p0 and p1 in the sup-norm. | |
static SGPoint | cross (const SGPoint &p0, const SGPoint &p1) |
Cross product for 3-vectors. | |
static double | invertSystem (SGPoint &x, const SGPoint &b, const SGPoint &a0, const SGPoint &a1) |
Inverts a linear system. More... | |
static double | intersectRay (SGPoint &intersection, SGPoint &weights, const SGPoint &pivot, const SGPoint &direction, const SGPoint &t0, const SGPoint &t1) |
Calculates intersection of a segment with a ray. More... | |
static double | signedArea (const SGPoint &p0, const SGPoint &p1, const SGPoint &p2) |
Calculates determinant. More... | |
Protected Attributes | |
vector< double > | x |
Friends | |
class | boost::serialization::access |
class | SGTuple |
SGPoint | operator* (double d, const SGPoint &point) |
Left-scalar multiplication. | |
SGPoint | operator* (const SGPoint &point, double d) |
Right-scalar multiplication. | |
SGPoint | operator/ (const SGPoint &point, double d) |
Right scalar division. | |
ostream & | operator<< (ostream &out, const SGPoint &rhs) |
Output SGPoint to ostream. | |
A vector in .
A simple two-dimensional vector that supports arithmetic operations.
|
static |
Calculates intersection of a segment with a ray.
Calculates the intersection of the ray defined by with the line segment for .
|
static |
Inverts a linear system.
Solves the system of equations .
Calculates determinant.
Calculates the signed area of the parallelogram starting at and going in the directions and .
|
protected |
Two dimensional vector of doubles.