42 #ifndef _LINEAR_ALGEBRA_H_ 43 #define _LINEAR_ALGEBRA_H_ 60 Point3D(
int _x,
int _y,
int _z) :
x(1.0*_x),
y(1.0*_y),
z(1.0*_z) {}
61 Point3D(
double _x,
double _y,
double _z) :
x(_x),
y(_y),
z(_z) {}
66 return strm <<
"Point3D=(" << p.
x <<
"," << p.
y <<
"," << p.
z <<
")";
89 bool Equals(
const Point3D& p)
const {
return (x==p.
x && y==p.
y && z==p.
z); }
90 int CompareTo(
const Point3D& p)
const {
return (x>p.
x&&y>p.
y&&z>p.
z) ? 1 : ( (x<p.
x&&y<p.
y&&z<p.
z) ? -1 : 0); }
bool operator>(const Point3D &p) const
bool operator==(const Point3D &p) const
Point3D operator+(const double a) const
Point3D operator/(const double a) const
Point3D operator-(const Point3D &p) const
double dist(Point3D &p1, Point3D &p2)
bool operator>=(const Point3D &p) const
double norm2(const Point3D &p)
calculate norm^2
bool operator<=(const Point3D &p) const
Point3D(double _x, double _y, double _z)
Point3D operator*(const double a) const
Point3D operator*(const Point3D &p) const
bool operator<(const Point3D &p) const
friend std::ostream & operator<<(std::ostream &strm, const Point3D &p)
Point3D(int _x, int _y, int _z)
double norm(const Point3D &p)
Point3D operator-(const double a) const
Point3D operator/(const Point3D &p) const
Point3D operator+(const Point3D &p) const
bool operator!=(const Point3D &p) const