PointVector
v1.0
Header-only n-dimensional point and vector implementations for C++11
|
Represents n-dimensional points. More...
#include <Point.hxx>
Public Types | |
using | value_type = T |
value type, first keyword, expected to be a primitive type. | |
using | size_type = std::size_t |
size type, second keyword, expected to be a positive number. | |
using | iterator = T * |
iterator type. | |
Public Member Functions | |
Point () | |
Default constructor. | |
Point (const Point< value_type, S > &rhs) | |
Copy constructor. More... | |
Point (std::initializer_list< value_type > values) | |
Aggregate constructor from a brace-init-list. More... | |
Point (T *values) | |
Initializes the point from an array. More... | |
Point (T value) | |
Initializes all components of the point to the same value. More... | |
Point< value_type, S > & | operator= (const Point< value_type, S > &rhs) |
Copy assignment operator. More... | |
Point< value_type, S > & | operator= (Point< value_type, S > &&rhs) |
Move assignment operator. More... | |
Point< value_type, S > & | operator+= (const Point< value_type, S > &rhs) |
Compound assignment operator (complex addition). More... | |
Point< value_type, S > & | operator-= (const Point< value_type, S > &rhs) |
Compound assignment operator (complex subtraction). More... | |
Point< value_type, S > & | operator+= (const T &rhs) |
Compound assignment operator (primitive addition). More... | |
Point< value_type, S > & | operator-= (const T &rhs) |
Compound assignment operator (primitive subtraction). More... | |
Point< value_type, S > & | operator*= (const T &rhs) |
Compound assignment operator (primitive multiplication). More... | |
Point< value_type, S > & | operator/= (const T &rhs) |
Compound assignment operator (primitive division). More... | |
value_type & | operator[] (size_type idx) |
Array subscript operator. More... | |
const value_type & | operator[] (size_type idx) const |
Array subscript operator (const). More... | |
iterator | begin () |
Iterator begin. More... | |
iterator | end () |
Iterator end. More... | |
value_type * | data () |
Access data. More... | |
Friends | |
Point< value_type, S > | operator+ (Point< value_type, S > lhs, const Point< value_type, S > &rhs) |
Arithmetic operator (complex addition). More... | |
Point< value_type, S > | operator- (Point< value_type, S > lhs, const Point< value_type, S > &rhs) |
Arithmetic operator (complex subtraction). More... | |
Point< value_type, S > | operator+ (Point< value_type, S > lhs, const T &rhs) |
Arithmetic operator (primitive addition). More... | |
Point< value_type, S > | operator- (Point< value_type, S > lhs, const T &rhs) |
Arithmetic operator (primitive subtraction). More... | |
Point< value_type, S > | operator* (Point< value_type, S > lhs, const T &rhs) |
Arithmetic operator (primitive multiplication). More... | |
Point< value_type, S > | operator/ (Point< value_type, S > lhs, const T &rhs) |
Arithmetic operator (primitive division). More... | |
bool | operator== (const Point< value_type, S > &lhs, const Point< value_type, S > &rhs) |
Equality operator. More... | |
bool | operator!= (const Point< value_type, S > &lhs, const Point< value_type, S > &rhs) |
Inequality operator. More... | |
std::ostream & | operator<< (std::ostream &lhs, Point< value_type, S > &rhs) |
Stream extraction operator. More... | |
std::istream & | operator>> (std::istream &lhs, Point< value_type, S > &rhs) |
Stream insertion operator. More... | |
Represents n-dimensional points.
T | type of the values contained, e.g. float, double |
S | dimension |
|
inline |
Copy constructor.
rhs | object on the right hand side |
|
inline |
Aggregate constructor from a brace-init-list.
values | brace-init-list |
|
inlineexplicit |
Initializes the point from an array.
values | array containing the initial values |
|
inlineexplicit |
Initializes all components of the point to the same value.
value | initial value |
|
inline |
Iterator begin.
|
inline |
Access data.
Returns the direct pointer to the array used internally.
|
inline |
Iterator end.
|
inline |
Compound assignment operator (primitive multiplication).
rhs | object to be multiplicated |
|
inline |
Compound assignment operator (complex addition).
rhs | object to be added |
|
inline |
Compound assignment operator (primitive addition).
rhs | object to be added |
|
inline |
Compound assignment operator (complex subtraction).
rhs | object to be subtracted |
|
inline |
Compound assignment operator (primitive subtraction).
rhs | object to be subtracted |
|
inline |
Compound assignment operator (primitive division).
rhs | object to be divided |
|
inline |
Copy assignment operator.
rhs | object to be copied |
|
inline |
Move assignment operator.
rhs | object to be moved |
|
inline |
Array subscript operator.
idx | array index |
|
inline |
Array subscript operator (const).
idx | array index |
|
friend |
Inequality operator.
lhs | object on the left hand side |
rhs | object on the right hand side |
|
friend |
Arithmetic operator (primitive multiplication).
lhs | object on the left hand side |
rhs | object on the right hand side |
|
friend |
Arithmetic operator (complex addition).
lhs | object on the left hand side |
rhs | object on the right hand side |
|
friend |
Arithmetic operator (primitive addition).
lhs | object on the left hand side |
rhs | object on the right hand side |
|
friend |
Arithmetic operator (complex subtraction).
lhs | object on the left hand side |
rhs | object on the right hand side |
|
friend |
Arithmetic operator (primitive subtraction).
lhs | object on the left hand side |
rhs | object on the right hand side |
|
friend |
Arithmetic operator (primitive division).
lhs | object on the left hand side |
rhs | object on the right hand side |
|
friend |
Stream extraction operator.
lhs | object on the left hand side |
rhs | object on the right hand side |
|
friend |
Equality operator.
lhs | object on the left hand side |
rhs | object on the right hand side |
|
friend |
Stream insertion operator.
lhs | object on the left hand side |
rhs | object on the right hand side |