|
Developer Documentation
|
#include <OpenMesh/Core/Math/VectorT.hh>
Public Types | |
| typedef Scalar | value_type |
| the type of the scalar used in this template | |
| typedef VectorT< Scalar, DIM > | vector_type |
| type of this vector | |
Public Member Functions | |
| template<typename T , typename ... Ts, typename = typename std::enable_if<sizeof...(Ts)+1 == DIM>::type, typename = typename std::enable_if< are_convertible_to<Scalar, T, Ts...>::value>::type> | |
| constexpr | VectorT (T v, Ts... vs) |
| constexpr | VectorT () |
| default constructor creates uninitialized values. | |
| VectorT (const Scalar &v) | |
| VectorT (const VectorT &rhs)=default | |
| VectorT (VectorT &&rhs)=default | |
| VectorT & | operator= (const VectorT &rhs)=default |
| VectorT & | operator= (VectorT &&rhs)=default |
| template<typename S = Scalar, int D = DIM> | |
| auto | homogenized () const -> typename std::enable_if< D==4, VectorT< decltype(std::declval< S >()/std::declval< S >()), DIM > >::type |
| template<typename Iterator , typename = decltype( *std::declval<Iterator&>(), void(), ++std::declval<Iterator&>(), void())> | |
| VectorT (Iterator it) | |
| construct from a value array or any other iterator | |
| VectorT (container &&_array) | |
| construct from an array | |
| template<typename otherScalarType , typename = typename std::enable_if< std::is_convertible<otherScalarType, Scalar>::value>> | |
| VectorT (const VectorT< otherScalarType, DIM > &_rhs) | |
| copy & cast constructor (explicit) | |
| template<typename OtherScalar , typename = typename std::enable_if< std::is_convertible<OtherScalar, Scalar>::value>> | |
| vector_type & | operator= (const VectorT< OtherScalar, DIM > &_rhs) |
| cast from vector with a different scalar type | |
| Scalar * | data () |
| access to Scalar array | |
| const Scalar * | data () const |
| access to const Scalar array | |
| Scalar & | operator[] (size_t _i) |
| get i'th element read-write | |
| const Scalar & | operator[] (size_t _i) const |
| get i'th element read-only | |
| bool | operator== (const vector_type &_rhs) const |
| component-wise comparison | |
| bool | operator!= (const vector_type &_rhs) const |
| component-wise comparison | |
| template<typename OtherScalar > | |
| auto | operator*= (const OtherScalar &_s) -> typename std::enable_if< std::is_convertible< decltype(this->values_[0] *_s), Scalar >::value, VectorT< Scalar, DIM > & >::type |
| component-wise self-multiplication with scalar | |
| template<typename OtherScalar > | |
| auto | operator/= (const OtherScalar &_s) -> typename std::enable_if< std::is_convertible< decltype(this->values_[0]/_s), Scalar >::value, VectorT< Scalar, DIM > & >::type |
| component-wise self-division by scalar | |
| VectorT< Scalar, DIM > ::type | operator* (const OtherScalar &_s) const |
| VectorT< Scalar, DIM > ::type | operator/ (const OtherScalar &_s) const |
| template<typename OtherScalar > | |
| auto | operator*= (const VectorT< OtherScalar, DIM > &_rhs) -> typename std::enable_if< sizeof(decltype(this->values_[0] **_rhs.data())) >=0 |
| component-wise self-multiplication | |
| template<typename OtherScalar > | |
| auto | operator/= (const VectorT< OtherScalar, DIM > &_rhs) -> typename std::enable_if< sizeof(decltype(this->values_[0]/*_rhs.data())) >=0 |
| component-wise self-division | |
| template<typename OtherScalar > | |
| auto | operator-= (const VectorT< OtherScalar, DIM > &_rhs) -> typename std::enable_if< sizeof(decltype(this->values_[0] - *_rhs.data())) >=0 |
| vector difference from this | |
| template<typename OtherScalar > | |
| auto | operator+= (const VectorT< OtherScalar, DIM > &_rhs) -> typename std::enable_if< sizeof(decltype(this->values_[0]+ *_rhs.data())) >=0 |
| vector self-addition | |
| template<typename OtherScalar > | |
| auto | operator* (const VectorT< OtherScalar, DIM > &_rhs) const -> typename std::enable_if< sizeof(decltype(this->values_[0] **_rhs.data())) >=0 |
| component-wise vector multiplication | |
| template<typename OtherScalar > | |
| auto | operator/ (const VectorT< OtherScalar, DIM > &_rhs) const -> typename std::enable_if< sizeof(decltype(this->values_[0]/*_rhs.data())) >=0 |
| component-wise vector division | |
| template<typename OtherScalar > | |
| auto | operator+ (const VectorT< OtherScalar, DIM > &_rhs) const -> typename std::enable_if< sizeof(decltype(this->values_[0]+ *_rhs.data())) >=0 |
| component-wise vector addition | |
| template<typename OtherScalar > | |
| auto | operator- (const VectorT< OtherScalar, DIM > &_rhs) const -> typename std::enable_if< sizeof(decltype(this->values_[0] - *_rhs.data())) >=0 |
| component-wise vector difference | |
| vector_type | operator- (void) const |
| unary minus | |
| template<typename OtherScalar > | |
| auto | operator% (const VectorT< OtherScalar, DIM > &_rhs) const -> typename std::enable_if< DIM==3, VectorT< decltype((*this)[0] *_rhs[0] -(*this)[0] *_rhs[0]), DIM > >::type |
| template<typename OtherScalar > | |
| auto | cross (const VectorT< OtherScalar, DIM > &_rhs) const -> decltype(*this % _rhs) |
| template<typename OtherScalar > | |
| auto | operator| (const VectorT< OtherScalar, DIM > &_rhs) const -> decltype(*this->data() **_rhs.data()) |
| template<typename OtherScalar > | |
| auto | dot (const VectorT< OtherScalar, DIM > &_rhs) const -> decltype(*this|_rhs) |
| VectorT< float, 3 > | operator% (const VectorT< float, 3 > &_rhs) const |
| cross product for Vec3f | |
| VectorT< double, 3 > | operator% (const VectorT< double, 3 > &_rhs) const |
| cross product for Vec3d | |
Euclidean norm calculations | |
| template<typename S = Scalar> | |
| decltype(std::declval< S >() *std::declval< S >()) | sqrnorm () const |
| compute squared euclidean norm | |
| template<typename S = Scalar> | |
| auto | norm () const -> decltype(std::sqrt(std::declval< VectorT< S, DIM > >().sqrnorm())) |
| compute euclidean norm | |
| template<typename S = Scalar> | |
| auto | length () const -> decltype(std::declval< VectorT< S, DIM > >().norm()) |
| compute squared euclidean norm | |
| template<typename S = Scalar> | |
| auto | normalize () -> decltype(*this/=std::declval< VectorT< S, DIM > >().norm()) |
| template<typename S = Scalar> | |
| auto | normalized () const -> decltype(*this/std::declval< VectorT< S, DIM > >().norm()) |
| vector_type &::type | normalize_cond () |
| compute squared euclidean norm | |
Non-Euclidean norm calculations | |
| Scalar | l1_norm () const |
| compute L1 (Manhattan) norm | |
| Scalar | l8_norm () const |
| compute l8_norm | |
Static Public Member Functions | |
| static constexpr int | dim () |
| returns dimension of the vector (deprecated) | |
| static constexpr size_t | size () |
| returns dimension of the vector | |
Static Public Attributes | |
| static constexpr const size_t | size_ = DIM |
Private Types | |
| using | container = std::array< Scalar, DIM > |
Private Attributes | |
| container | values_ |
Related Symbols | |
(Note that these are not member symbols.) | |
| template<typename Scalar , int DIM> | |
| Scalar | dot (const VectorT< Scalar, DIM > &_v1, const VectorT< Scalar, DIM > &_v2) |
| template<typename LScalar , typename RScalar , int DIM> | |
| auto | cross (const VectorT< LScalar, DIM > &_v1, const VectorT< RScalar, DIM > &_v2) -> decltype(_v1 % _v2) |
| template<typename Scalar , int DIM> | |
| void | swap (VectorT< Scalar, DIM > &_v1, VectorT< Scalar, DIM > &_v2) noexcept(noexcept(_v1.swap(_v2))) |
| template<typename Scalar , int DIM> | |
| Scalar | norm (const VectorT< Scalar, DIM > &_v) |
| template<typename Scalar , int DIM> | |
| Scalar | sqrnorm (const VectorT< Scalar, DIM > &_v) |
| template<typename Scalar , int DIM, typename OtherScalar > | |
| VectorT< Scalar, DIM > & | vectorize (VectorT< Scalar, DIM > &_v, OtherScalar const &_val) |
| template<typename Scalar , int DIM> | |
| VectorT< Scalar, DIM > & | normalize (VectorT< Scalar, DIM > &_v) |
| template<typename Scalar , int DIM> | |
| VectorT< Scalar, DIM > & | maximize (VectorT< Scalar, DIM > &_v1, VectorT< Scalar, DIM > &_v2) |
| template<typename Scalar , int DIM> | |
| VectorT< Scalar, DIM > & | minimize (VectorT< Scalar, DIM > &_v1, VectorT< Scalar, DIM > &_v2) |
| template<typename Scalar , int DIM> | |
| VectorT< Scalar, DIM > | max (const VectorT< Scalar, DIM > &_v1, const VectorT< Scalar, DIM > &_v2) |
| template<typename Scalar , int DIM> | |
| VectorT< Scalar, DIM > | min (const VectorT< Scalar, DIM > &_v1, const VectorT< Scalar, DIM > &_v2) |
| template<typename Scalar1 , typename Scalar2 , int N> | |
| VectorT< Scalar1, N > | operator* (Scalar2 _s, const VectorT< Scalar1, N > &_v) |
| template<typename Scalar , int N> | |
| Scalar | dot (const VectorT< Scalar, N > &_v1, const VectorT< Scalar, N > &_v2) |
| template<typename Scalar , int N> | |
| VectorT< Scalar, N > | cross (const VectorT< Scalar, N > &_v1, const VectorT< Scalar, N > &_v2) |
| template<typename Scalar , int DIM> | |
| Scalar | norm (const VectorT< Scalar, DIM > &_v) |
| template<typename Scalar , int DIM> | |
| Scalar | sqrnorm (const VectorT< Scalar, DIM > &_v) |
| template<typename Scalar , int DIM, typename OtherScalar > | |
| VectorT< Scalar, DIM > & | vectorize (VectorT< Scalar, DIM > &_v, OtherScalar const &_val) |
| template<typename Scalar , int DIM> | |
| VectorT< Scalar, DIM > & | normalize (VectorT< Scalar, DIM > &_v) |
| template<typename Scalar , int DIM> | |
| VectorT< Scalar, DIM > & | maximize (VectorT< Scalar, DIM > &_v1, VectorT< Scalar, DIM > &_v2) |
| template<typename Scalar , int DIM> | |
| VectorT< Scalar, DIM > & | minimize (VectorT< Scalar, DIM > &_v1, VectorT< Scalar, DIM > &_v2) |
| template<typename Scalar , int DIM> | |
| VectorT< Scalar, DIM > | max (const VectorT< Scalar, DIM > &_v1, const VectorT< Scalar, DIM > &_v2) |
| template<typename Scalar , int DIM> | |
| VectorT< Scalar, DIM > | min (const VectorT< Scalar, DIM > &_v1, const VectorT< Scalar, DIM > &_v2) |
Component iterators | |
| using | iterator = typename container::iterator |
| using | const_iterator = typename container::const_iterator |
| using | reverse_iterator = typename container::reverse_iterator |
| using | const_reverse_iterator = typename container::const_reverse_iterator |
| iterator | begin () noexcept |
| const_iterator | begin () const noexcept |
| const_iterator | cbegin () const noexcept |
| iterator | end () noexcept |
| const_iterator | end () const noexcept |
| const_iterator | cend () const noexcept |
| reverse_iterator | rbegin () noexcept |
| const_reverse_iterator | rbegin () const noexcept |
| const_reverse_iterator | crbegin () const noexcept |
| reverse_iterator | rend () noexcept |
| const_reverse_iterator | rend () const noexcept |
| const_reverse_iterator | crend () const noexcept |
Minimum maximum and mean | |
| static vector_type | vectorized (const Scalar &_s) |
| store the same value in each component | |
| Scalar | max () const |
| return the maximal component | |
| Scalar | max_abs () const |
| return the maximal absolute component | |
| Scalar | min () const |
| return the minimal component | |
| Scalar | min_abs () const |
| return the minimal absolute component | |
| Scalar | mean () const |
| return arithmetic mean | |
| Scalar | mean_abs () const |
| return absolute arithmetic mean | |
| vector_type & | minimize (const vector_type &_rhs) |
| minimize values: same as *this = min(*this, _rhs), but faster | |
| bool | minimized (const vector_type &_rhs) |
| minimize values and signalize coordinate minimization | |
| vector_type & | maximize (const vector_type &_rhs) |
| maximize values: same as *this = max(*this, _rhs), but faster | |
| bool | maximized (const vector_type &_rhs) |
| maximize values and signalize coordinate maximization | |
| vector_type | min (const vector_type &_rhs) const |
| component-wise min | |
| vector_type | max (const vector_type &_rhs) const |
| component-wise max | |
| template<typename Functor > | |
| vector_type | apply (const Functor &_func) const |
| component-wise apply function object with Scalar operator()(Scalar). | |
| vector_type & | vectorize (const Scalar &_s) |
| store the same value in each component (e.g. to clear all entries) | |
| bool | operator< (const vector_type &_rhs) const |
| lexicographical comparison | |
| void | swap (VectorT &_other) noexcept(noexcept(std::swap(values_, _other.values_))) |
| swap with another vector | |
A vector is an array of <N> values of type <Scalar>. The actual data is stored in an VectorDataT, this class just adds the necessary operators.
Definition at line 83 of file Vector11T.hh.
| using OpenMesh::VectorT< Scalar, DIM >::const_iterator = typename container::const_iterator |
Definition at line 668 of file Vector11T.hh.
| using OpenMesh::VectorT< Scalar, DIM >::const_reverse_iterator = typename container::const_reverse_iterator |
Definition at line 670 of file Vector11T.hh.
|
private |
Definition at line 88 of file Vector11T.hh.
| using OpenMesh::VectorT< Scalar, DIM >::iterator = typename container::iterator |
Definition at line 667 of file Vector11T.hh.
| using OpenMesh::VectorT< Scalar, DIM >::reverse_iterator = typename container::reverse_iterator |
Definition at line 669 of file Vector11T.hh.
| typedef Scalar OpenMesh::VectorT< Scalar, DIM >::value_type |
the type of the scalar used in this template
Definition at line 96 of file Vector11T.hh.
| typedef VectorT<Scalar, DIM> OpenMesh::VectorT< Scalar, DIM >::vector_type |
type of this vector
Definition at line 99 of file Vector11T.hh.
|
inlineconstexpr |
Definition at line 121 of file Vector11T.hh.
|
inlineconstexpr |
default constructor creates uninitialized values.
Definition at line 129 of file Vector11T.hh.
|
inlineexplicit |
Creates a vector with all components set to v.
Definition at line 134 of file Vector11T.hh.
|
inlineexplicit |
construct from a value array or any other iterator
Definition at line 168 of file Vector11T.hh.
|
inlineexplicit |
construct from an array
Definition at line 173 of file Vector11T.hh.
|
inlineexplicit |
copy & cast constructor (explicit)
Definition at line 182 of file Vector11T.hh.
|
inline |
component-wise apply function object with Scalar operator()(Scalar).
Definition at line 631 of file Vector11T.hh.
|
inlinenoexcept |
Definition at line 673 of file Vector11T.hh.
|
inlinenoexcept |
Definition at line 672 of file Vector11T.hh.
|
inlinenoexcept |
Definition at line 674 of file Vector11T.hh.
|
inlinenoexcept |
Definition at line 678 of file Vector11T.hh.
|
inlinenoexcept |
Definition at line 682 of file Vector11T.hh.
|
inlinenoexcept |
Definition at line 686 of file Vector11T.hh.
|
inline |
cross product: only defined for Vec3* as specialization
Definition at line 389 of file Vector11T.hh.
|
inline |
access to Scalar array
Definition at line 201 of file Vector11T.hh.
|
inline |
access to const Scalar array
Definition at line 204 of file Vector11T.hh.
|
inlinestaticconstexpr |
returns dimension of the vector (deprecated)
Definition at line 102 of file Vector11T.hh.
|
inline |
compute scalar product
Definition at line 409 of file Vector11T.hh.
|
inlinenoexcept |
Definition at line 677 of file Vector11T.hh.
|
inlinenoexcept |
Definition at line 676 of file Vector11T.hh.
|
inline |
Only for 4-component vectors with division operator on their Scalar: Dehomogenization.
Definition at line 148 of file Vector11T.hh.
|
inline |
compute L1 (Manhattan) norm
Definition at line 500 of file Vector11T.hh.
|
inline |
compute l8_norm
Definition at line 506 of file Vector11T.hh.
|
inline |
compute squared euclidean norm
Definition at line 443 of file Vector11T.hh.
|
inline |
return the maximal component
Definition at line 518 of file Vector11T.hh.
|
inline |
component-wise max
Definition at line 621 of file Vector11T.hh.
|
inline |
return the maximal absolute component
Definition at line 523 of file Vector11T.hh.
|
inline |
maximize values: same as *this = max(*this, _rhs), but faster
Definition at line 588 of file Vector11T.hh.
|
inline |
maximize values and signalize coordinate maximization
Definition at line 599 of file Vector11T.hh.
|
inline |
return arithmetic mean
Definition at line 546 of file Vector11T.hh.
|
inline |
return absolute arithmetic mean
Definition at line 551 of file Vector11T.hh.
|
inline |
return the minimal component
Definition at line 532 of file Vector11T.hh.
|
inline |
component-wise min
Definition at line 616 of file Vector11T.hh.
|
inline |
return the minimal absolute component
Definition at line 537 of file Vector11T.hh.
|
inline |
minimize values: same as *this = min(*this, _rhs), but faster
Definition at line 560 of file Vector11T.hh.
|
inline |
minimize values and signalize coordinate minimization
Definition at line 571 of file Vector11T.hh.
|
inline |
compute euclidean norm
Definition at line 434 of file Vector11T.hh.
|
inline |
normalize vector, return normalized vector
Definition at line 454 of file Vector11T.hh.
|
inline |
compute squared euclidean norm
Definition at line 481 of file Vector11T.hh.
|
inline |
return normalized vector
Definition at line 465 of file Vector11T.hh.
|
inline |
component-wise comparison
Definition at line 228 of file Vector11T.hh.
|
inline |
cross product for Vec3d
Definition at line 231 of file VectorT.hh.
|
inline |
cross product for Vec3f
Definition at line 219 of file VectorT.hh.
|
inline |
cross product: only defined for Vec3* as specialization
Definition at line 375 of file Vector11T.hh.
|
inline |
Definition at line 264 of file Vector11T.hh.
|
inline |
component-wise self-multiplication with scalar
Definition at line 236 of file Vector11T.hh.
|
inline |
unary minus
Definition at line 365 of file Vector11T.hh.
|
inline |
Definition at line 274 of file Vector11T.hh.
|
inline |
component-wise self-division by scalar
Definition at line 248 of file Vector11T.hh.
|
inline |
lexicographical comparison
Definition at line 650 of file Vector11T.hh.
|
inline |
cast from vector with a different scalar type
Definition at line 192 of file Vector11T.hh.
|
inline |
component-wise comparison
Definition at line 223 of file Vector11T.hh.
|
inline |
get i'th element read-write
Definition at line 209 of file Vector11T.hh.
|
inline |
get i'th element read-only
Definition at line 215 of file Vector11T.hh.
|
inline |
compute scalar product
Definition at line 399 of file Vector11T.hh.
|
inlinenoexcept |
Definition at line 681 of file Vector11T.hh.
|
inlinenoexcept |
Definition at line 680 of file Vector11T.hh.
|
inlinenoexcept |
Definition at line 685 of file Vector11T.hh.
|
inlinenoexcept |
Definition at line 684 of file Vector11T.hh.
|
inlinestaticconstexpr |
returns dimension of the vector
Definition at line 107 of file Vector11T.hh.
|
inline |
compute squared euclidean norm
Definition at line 422 of file Vector11T.hh.
|
inlinenoexcept |
swap with another vector
Definition at line 657 of file Vector11T.hh.
|
inline |
store the same value in each component (e.g. to clear all entries)
Definition at line 639 of file Vector11T.hh.
|
inlinestatic |
store the same value in each component
Definition at line 645 of file Vector11T.hh.
|
related |
symmetric version of the cross product
Definition at line 733 of file Vector11T.hh.
|
related |
symmetric version of the cross product
Definition at line 267 of file VectorT.hh.
|
related |
symmetric version of the dot product
Definition at line 725 of file Vector11T.hh.
|
related |
symmetric version of the dot product
Definition at line 258 of file VectorT.hh.
|
related |
non-member max
Definition at line 790 of file Vector11T.hh.
|
related |
non-member max
Definition at line 323 of file VectorT.hh.
|
related |
non-member maximize
Definition at line 776 of file Vector11T.hh.
|
related |
non-member maximize
Definition at line 307 of file VectorT.hh.
|
related |
non-member min
Definition at line 797 of file Vector11T.hh.
|
related |
non-member min
Definition at line 331 of file VectorT.hh.
|
related |
non-member minimize
Definition at line 783 of file Vector11T.hh.
|
related |
non-member minimize
Definition at line 315 of file VectorT.hh.
|
related |
non-member norm
Definition at line 749 of file Vector11T.hh.
|
related |
non-member norm
Definition at line 275 of file VectorT.hh.
|
related |
non-member normalize
Definition at line 769 of file Vector11T.hh.
|
related |
non-member normalize
Definition at line 299 of file VectorT.hh.
|
related |
scalar * vector
Definition at line 249 of file VectorT.hh.
|
related |
non-member sqrnorm
Definition at line 756 of file Vector11T.hh.
|
related |
non-member sqrnorm
Definition at line 283 of file VectorT.hh.
|
related |
non-member swap
Definition at line 741 of file Vector11T.hh.
|
related |
non-member vectorize
Definition at line 762 of file Vector11T.hh.
|
related |
non-member vectorize
Definition at line 291 of file VectorT.hh.
|
staticconstexpr |
Definition at line 111 of file Vector11T.hh.
|
private |
Definition at line 89 of file Vector11T.hh.