point.hh

来自「用于计算矩阵的特征值,及矩阵的其他运算.可以用与稀疏矩阵」· HH 代码 · 共 57 行

HH
57
字号
#ifndef __Point_h__#define __Point_h__    // Simple point template classes.  // Probably only make sense for intrinsic types.    // 2D Points    template < class T > class Point2D  {  public:Point2D() {        x = 0;        y = 0;    }    Point2D(T x, T y) {        this->x = x;        this->y = y;    }    T x, y;};template < class T > inline int operator==(const Point2D < T > &a,                                              const Point2D < T > &b) {    return (a.x == b.x) && (a.y == b.y);}template < class T > inline int operator!=(const Point2D < T > &a,                                              const Point2D < T > &b) {    return (a.x != b.x) || (a.y != b.y);}typedef Point2D < int >Pixel;// 3D Points    template < class T > class Point3D  {  public:Point3D() {        x = 0;        y = 0;        z = 0;    } Point3D(T x, T y) {        this->x = x;        this->y = y;        this->z = z;    } T x, y, z;};template < class T > inline int operator==(const Point3D < T > &a,                                              const Point3D < T > &b) {    return (a.x == b.x) && (a.y == b.y) && (a.z == b.z);}template < class T > inline int operator!=(const Point3D < T > &a,                                              const Point3D < T > &b) {    return (a.x != b.x) || (a.y != b.y) || (a.z != b.z);}typedef Point3D < int >Voxel;#endif                          // __Point_h__

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?