45#ifndef MATH_VECTOR2_HPP
46#define MATH_VECTOR2_HPP
55 template<
typename Real>
58 typedef Real ElemType;
59 typedef Real* ElemPoinerType;
73 inline Vector2<Real>& operator=(
const Vector<Real, 2>& v) {
74 if (
this == &v) {
return *
this; }
83 inline Real&
x() {
return this->data_[0]; }
89 inline Real
x()
const {
return this->data_[0]; }
95 inline Real&
y() {
return this->data_[1]; }
101 inline Real
y()
const {
return this->data_[1]; }
113 return std::size_t(p.
y() * s.
x() + p.
x());
116 typedef Vector2<int> Vector2i;
118 typedef Vector2<RealType> Vector2d;
120 const Vector2d V2Zero(0.0, 0.0);
121 const Vector2d V2X(1.0, 0.0);
122 const Vector2d V2Y(0.0, 1.0);
Real x() const
Returns the first element of Vector2.
Real & y()
Returns reference of the second element of Vector2.
Vector2(Real *array)
Constructs and initializes from an array.
Vector2(Real x, Real y)
Constructs and initializes a Vector2 from x and y coordinates.
Real & x()
Returns reference of the first element of Vector2.
Real y() const
Returns the second element of Vector2.
Vector< Real, Dim > & operator=(const Vector< Real, Dim > &v)
copy assignment operator
This basic Periodic Table class was originally taken from the data.cpp file in OpenBabel.
std::size_t Vlinear(const Vector2< std::size_t > &p, const Vector2< std::size_t > &s)
Returns the linear indexing for size_t vectors.