#ifndef OERSTED_NODE_H #define OERSTED_NODE_H // TODO: Const #include #include "Mesh.hpp" template class SmallVector { private: double Value[N]; }; template class SmallMatrix { }; template class SquareMatrix : public SmallMatrix { }; template<> class SmallVector<2> { public: SmallVector() : Value{} {}; SmallVector(Point const& p) : Value{p.X, p.Y} {}; SmallVector(double x, double y) : Value{x, y} {}; double value(size_t i) const { return Value[i]; }; double x() const { return Value[0]; }; void x(double val) { Value[0] = val; }; double y() const { return Value[1]; }; void y(double val) { Value[1] = val; }; private: double Value[2]; }; using XY = SmallVector<2>; template<> class SmallVector<3> { public: SmallVector() : Value{} {}; SmallVector(double x, double y, double z) : Value{x, y, z} {}; double value(size_t i) const { return Value[i]; } double x() const { return Value[0]; } double y() const { return Value[1]; } double z() const { return Value[2]; } private: double Value[3]; }; using XYZ = SmallVector<3>; template<> class SquareMatrix<2, true> { public: SquareMatrix() : Value{} {}; SquareMatrix(double xx, double xy, double yy) : Value{xx, xy, yy} {}; double xx() const { return Value[0]; }; double xy() const { return Value[1]; }; double yx() const { return Value[1]; }; double yy() const { return Value[2]; }; private: double Value[3]; }; template<> class SquareMatrix<2, false> { public: SquareMatrix() : Value{} {}; SquareMatrix(double xx, double xy, double yx, double yy) : Value{xx, xy, yx, yy} {}; double xx() const { return Value[0]; }; double xy() const { return Value[1]; }; double yx() const { return Value[2]; }; double yy() const { return Value[3]; }; private: double Value[4]; }; #endif //OERSTED_NODE_H