 |
ʻOhana
Population structure, admixture history, and selection using learning methods.
|
7 #ifndef JADE_VEC2_HPP__
8 #define JADE_VEC2_HPP__
10 #include "jade.system.hpp"
17 template <
typename TValue>
53 return (lhs.
x * rhs.
y) - (lhs.
y * rhs.
x);
63 return (a - b).get_length();
73 return (a - b).get_length_squared();
99 return (
x *
x) + (
y *
y);
111 return src + (dst - src) * percent;
274 template <
typename TValue>
287 template <
typename TValue>
288 std::istream & operator << (
292 return lhs >> rhs.
x >> rhs.
y;
300 template <
typename TValue>
301 std::ostream & operator << (
305 return lhs << rhs.
x <<
' ' << rhs.
y;
308 #endif // JADE_VEC2_HPP__
value_type get_length_squared() const
A template for a class that implements rank-two vector operations.
static basic_vec2 normalize(const basic_vec2 &v)
basic_vec2 & operator/=(const value_type &rhs)
static value_type cross(const basic_vec2 &lhs, const basic_vec2 &rhs)
value_type x
The X coordinate.
basic_vec2 & operator-=(const basic_vec2 &rhs)
basic_vec2(const value_type x_, const value_type y_)
Implements a new insatnce of the class with the specified values.
value_type get_length() const
static basic_vec2 max(const basic_vec2 &a, const basic_vec2 &b)
static value_type distance(const basic_vec2 &a, const basic_vec2 &b)
static basic_vec2 dot(const basic_vec2 &a, const basic_vec2 &b)
TValue value_type
The value type.
basic_vec2 & operator+=(const basic_vec2 &rhs)
value_type y
The Y coordinate.
basic_vec2 operator+(const value_type &rhs) const
static basic_vec2 min(const basic_vec2 &a, const basic_vec2 &b)
basic_vec2 operator/(const value_type &rhs) const
basic_vec2 & operator*=(const value_type &rhs)
static value_type distance_squared(const basic_vec2 &a, const basic_vec2 &b)
basic_vec2()
Implements a new insatnce of the class.
static basic_vec2 lerp(const basic_vec2 &src, const basic_vec2 &dst, const value_type percent)
basic_vec2 operator*(const value_type &rhs) const
basic_vec2 operator-(const value_type &rhs) const