PLaSK library
|
#include <plask/vector/lateral.hpp>
Public Types | |
typedef T * | iterator |
Type of iterator over components. | |
typedef const T * | const_iterator |
Type of const iterator over components. | |
Public Member Functions | |
T & | lon () |
constexpr const T & | tran () const |
T & | tran () |
constexpr const T & | vert () const |
LateralVec () | |
Construct uninitialized vector. | |
template<typename OtherT > | |
constexpr | LateralVec (const LateralVec< OtherT > &p) |
Copy constructor from all other lateral vectors. | |
template<int other_dim, typename OtherT > | |
PLASK_NO_CONVERSION_WARNING_BEGIN constexpr | LateralVec (const Vec< other_dim, OtherT > &p) |
Copy constructor from 2D vectors. | |
PLASK_NO_WARNING_END constexpr | LateralVec (T c0, T c1) |
Construct vector with given components. | |
template<typename T0 , typename T1 > | |
constexpr | LateralVec (const std::pair< T0, T1 > &comp) |
Construct vector components given in std::pair. | |
iterator | begin () |
Get begin iterator over components. | |
const_iterator | begin () const |
Get begin const iterator over components. | |
iterator | end () |
Get end iterator over components. | |
const_iterator | end () const |
Get end const iterator over components. | |
template<typename OtherT > | |
constexpr bool | operator== (const LateralVec< OtherT > &p) const |
Compare two vectors, this and p . | |
template<typename OtherT , typename SuprType > | |
constexpr bool | equals (const LateralVec< OtherT > &p, const SuprType &abs_supremum) const |
Check if two vectors, this and p are almost equal. | |
template<typename OtherT > | |
constexpr bool | equals (const LateralVec< OtherT > &p) const |
Check if two vectors, this and p are almost equal. | |
template<typename OtherT > | |
constexpr bool | operator!= (const LateralVec< OtherT > &p) const |
Compare two vectors, this and p . | |
T & | operator[] (size_t i) |
Get i-th component WARNING This function does not check if it is valid (for efficiency reasons) | |
const T & | operator[] (size_t i) const |
Get i-th component WARNING This function does not check if it is valid (for efficiency reasons) | |
template<typename OtherT > | |
constexpr auto | operator+ (const LateralVec< OtherT > &other) const -> LateralVec< decltype(c0+other.c0)> |
Calculate sum of two vectors, this and other . | |
LateralVec< T > & | operator+= (const LateralVec< T > &other) |
Increase coordinates of this vector by coordinates of other vector other . | |
template<typename OtherT > | |
constexpr auto | operator- (const LateralVec< OtherT > &other) const -> LateralVec< decltype(c0 - other.c0)> |
Calculate difference of two vectors, this and other . | |
LateralVec< T > & | operator-= (const LateralVec< T > &other) |
Decrease coordinates of this vector by coordinates of other vector other . | |
template<typename OtherT > | |
constexpr auto | operator* (const OtherT scale) const -> LateralVec< decltype(c0 *scale)> |
Calculate this vector multiplied by scalar scale . | |
LateralVec< T > & | operator*= (const T scalar) |
Multiple coordinates of this vector by scalar . | |
constexpr LateralVec< T > | operator/ (const T scale) const |
Calculate this vector divided by scalar scale . | |
LateralVec< T > & | operator/= (const T scalar) |
Divide coordinates of this vector by scalar . | |
constexpr LateralVec< T > | operator- () const |
Calculate vector opposite to this. | |
LateralVec< T > | sqr () const |
Square each component of tensor. | |
LateralVec< T > & | sqr_inplace () |
Square each component of tensor in place. | |
template<typename OtherT > | |
LateralVec< T > | pow (OtherT a) const |
Power of each component of tensor. | |
void | flip (size_t i) |
Change i-th coordinate to oposite. | |
LateralVec< T > | flipped (size_t i) |
Get vector similar to this but with changed i-th component to oposite. | |
template<class OT > | |
bool | operator< (LateralVec< OT > const &v) const |
A lexical comparison of two vectors, allow to use vector in std::set and std::map as key type. | |
Static Public Member Functions | |
template<typename InputIteratorType > | |
static LateralVec< T > | fromIterator (InputIteratorType inputIt) |
Construct vector with components read from input iterator (including C array). | |
Public Attributes | |
T | c0 |
T | c1 |
Static Public Attributes | |
static const int | DIMS = 2 |
Friends | |
std::ostream & | operator<< (std::ostream &out, const LateralVec< T > &to_print) |
Print vector to stream using format (where c0 and c1 are vector components): [c0, c1]. | |
Definition at line 23 of file lateral.hpp.
typedef const T* plask::LateralVec< T >::const_iterator |
Type of const iterator over components.
Definition at line 43 of file lateral.hpp.
typedef T* plask::LateralVec< T >::iterator |
Type of iterator over components.
Definition at line 38 of file lateral.hpp.
|
inline |
Construct uninitialized vector.
Definition at line 46 of file lateral.hpp.
|
inlineconstexpr |
Copy constructor from all other lateral vectors.
p | vector to copy from |
Definition at line 53 of file lateral.hpp.
|
inlineconstexpr |
Copy constructor from 2D vectors.
p | vector to copy from |
Definition at line 61 of file lateral.hpp.
|
inlineconstexpr |
Construct vector with given components.
c0,c1 | components |
Definition at line 68 of file lateral.hpp.
|
inlineconstexpr |
Construct vector components given in std::pair.
comp | components |
Definition at line 75 of file lateral.hpp.
|
inline |
Get begin iterator over components.
Definition at line 94 of file lateral.hpp.
|
inline |
Get begin const iterator over components.
Definition at line 100 of file lateral.hpp.
|
inline |
Get end iterator over components.
Definition at line 106 of file lateral.hpp.
|
inline |
Get end const iterator over components.
Definition at line 112 of file lateral.hpp.
|
inlineconstexpr |
Check if two vectors, this and p
are almost equal.
p | vector to compare |
true
only if this vector and p
have almost equals coordinates Definition at line 138 of file lateral.hpp.
|
inlineconstexpr |
Check if two vectors, this and p
are almost equal.
p | vector to compare |
abs_supremum | maximal allowed difference for one coordinate |
true
only if this vector and p
have almost equals coordinates Definition at line 129 of file lateral.hpp.
|
inline |
Change i-th coordinate to oposite.
WARNING This function does not check if it is valid (for efficiency reasons)
i | number of coordinate |
Definition at line 293 of file lateral.hpp.
|
inline |
Get vector similar to this but with changed i-th component to oposite.
WARNING This function does not check if it is valid (for efficiency reasons)
i | number of coordinate |
Definition at line 304 of file lateral.hpp.
|
inlinestatic |
Construct vector with components read from input iterator (including C array).
inputIt | input iterator with minimum 3 objects available |
InputIteratorType | input iterator type, must allow for postincrementation and dereference operation |
Definition at line 83 of file lateral.hpp.
|
inline |
Definition at line 29 of file lateral.hpp.
|
inlineconstexpr |
Compare two vectors, this and p
.
p | vector to compare |
p
don't have equals coordinates Definition at line 147 of file lateral.hpp.
|
inlineconstexpr |
Calculate this vector multiplied by scalar scale
.
scale | scalar |
Definition at line 219 of file lateral.hpp.
|
inline |
Multiple coordinates of this vector by scalar
.
scalar | scalar |
Definition at line 230 of file lateral.hpp.
|
inlineconstexpr |
Calculate sum of two vectors, this
and other
.
other | vector to add, can have different data type (than result type will be found using C++ types promotions rules) |
Definition at line 177 of file lateral.hpp.
|
inline |
Increase coordinates of this vector by coordinates of other vector other
.
other | vector to add |
Definition at line 186 of file lateral.hpp.
|
inlineconstexpr |
Calculate vector opposite to this.
Definition at line 258 of file lateral.hpp.
|
inlineconstexpr |
Calculate difference of two vectors, this
and other
.
other | vector to subtract from this, can have different data type (than result type will be found using C++ types promotions rules) |
Definition at line 198 of file lateral.hpp.
|
inline |
Decrease coordinates of this vector by coordinates of other vector other
.
other | vector to subtract |
Definition at line 207 of file lateral.hpp.
|
inlineconstexpr |
Calculate this vector divided by scalar scale
.
scale | scalar |
Definition at line 241 of file lateral.hpp.
|
inline |
Divide coordinates of this vector by scalar
.
scalar | scalar |
Definition at line 248 of file lateral.hpp.
|
inline |
A lexical comparison of two vectors, allow to use vector in std::set and std::map as key type.
It supports NaN-s (which, due to this method, is greater than all other numbers).
v | vectors to compare |
true
only if this
is smaller than the v
Definition at line 328 of file lateral.hpp.
|
inlineconstexpr |
Compare two vectors, this and p
.
p | vector to compare |
p
have equals coordinates Definition at line 120 of file lateral.hpp.
|
inline |
Get i-th component WARNING This function does not check if it is valid (for efficiency reasons)
i | number of coordinate |
Definition at line 155 of file lateral.hpp.
|
inline |
Get i-th component WARNING This function does not check if it is valid (for efficiency reasons)
i | number of coordinate |
Definition at line 166 of file lateral.hpp.
|
inline |
Power of each component of tensor.
Definition at line 284 of file lateral.hpp.
|
inline |
|
inline |
Square each component of tensor in place.
Definition at line 274 of file lateral.hpp.
|
inline |
Definition at line 32 of file lateral.hpp.
|
inlineconstexpr |
Definition at line 30 of file lateral.hpp.
|
inlineconstexpr |
Definition at line 33 of file lateral.hpp.
|
friend |
Print vector to stream using format (where c0 and c1 are vector components): [c0, c1].
out | print destination, output stream |
to_print | vector to print |
Definition at line 316 of file lateral.hpp.
T plask::LateralVec< T >::c0 |
Definition at line 27 of file lateral.hpp.
T plask::LateralVec< T >::c1 |
Definition at line 27 of file lateral.hpp.
|
static |
Definition at line 25 of file lateral.hpp.