PX4 Firmware
PX4 Autopilot Software http://px4.io
matrix::Vector2< Type > Class Template Reference

#include <Vector2.hpp>

Inheritance diagram for matrix::Vector2< Type >:
Collaboration diagram for matrix::Vector2< Type >:

Public Types

typedef Matrix< Type, 2, 1 > Matrix21
 
typedef Vector< Type, 3 > Vector3
 
- Public Types inherited from matrix::Vector< Type, 2 >
typedef Matrix< Type, M, 1 > MatrixM1
 

Public Member Functions

 Vector2 ()=default
 
 Vector2 (const Matrix21 &other)
 
 Vector2 (const Type data_[2])
 
 Vector2 (Type x, Type y)
 
template<size_t P, size_t Q>
 Vector2 (const Slice< Type, 2, 1, P, Q > &slice_in)
 
 Vector2 (const Vector3 &other)
 
Type cross (const Matrix21 &b) const
 
Type operator% (const Matrix21 &b) const
 
- Public Member Functions inherited from matrix::Vector< Type, 2 >
 Vector ()=default
 
 Vector (const MatrixM1 &other)
 
 Vector (const Type data_[M])
 
 Vector (const Slice< Type, M, 1, P, Q > &slice_in)
 
Type operator() (size_t i) const
 
Type & operator() (size_t i)
 
Type dot (const MatrixM1 &b) const
 
Type operator* (const MatrixM1 &b) const
 
Vector operator* (Type b) const
 
Type norm () const
 
Type norm_squared () const
 
Type length () const
 
void normalize ()
 
Vector unit () const
 
Vector unit_or_zero (const Type eps=Type(1e-5)) const
 
Vector normalized () const
 
bool longerThan (Type testVal) const
 
Vector sqrt () const
 
- Public Member Functions inherited from matrix::Matrix< Type, M, 1 >
 Matrix ()=default
 
 Matrix (const Type data_[M *N])
 
 Matrix (const Type data_[M][N])
 
 Matrix (const Matrix &other)
 
 Matrix (const Slice< Type, M, N, P, Q > &in_slice)
 
Type operator() (size_t i, size_t j) const
 Accessors/ Assignment etc. More...
 
Type & operator() (size_t i, size_t j)
 
Matrix< Type, M, N > & operator= (const Matrix< Type, M, N > &other)
 
void copyTo (Type dst[M *N]) const
 
void copyToColumnMajor (Type dst[M *N]) const
 
Matrix< Type, M, Poperator* (const Matrix< Type, N, P > &other) const
 Matrix Operations. More...
 
Matrix< Type, M, N > operator* (Type scalar) const
 Scalar Operations. More...
 
Matrix< Type, M, N > emult (const Matrix< Type, M, N > &other) const
 
Matrix< Type, M, N > edivide (const Matrix< Type, M, N > &other) const
 
Matrix< Type, M, N > operator+ (const Matrix< Type, M, N > &other) const
 
Matrix< Type, M, N > operator+ (Type scalar) const
 
Matrix< Type, M, N > operator- (const Matrix< Type, M, N > &other) const
 
Matrix< Type, M, N > operator- () const
 
Matrix< Type, M, N > operator- (Type scalar) const
 
void operator+= (const Matrix< Type, M, N > &other)
 
void operator+= (Type scalar)
 
void operator-= (const Matrix< Type, M, N > &other)
 
void operator-= (Type scalar)
 
void operator*= (const Matrix< Type, N, P > &other)
 
void operator*= (Type scalar)
 
Matrix< Type, M, N > operator/ (Type scalar) const
 
void operator/= (Type scalar)
 
bool operator== (const Matrix< Type, M, N > &other) const
 
bool operator!= (const Matrix< Type, M, N > &other) const
 
void write_string (char *buf, size_t n) const
 Misc. More...
 
void print (FILE *stream=stdout) const
 
Matrix< Type, N, M > transpose () const
 
Matrix< Type, N, M > T () const
 
const Slice< Type, P, Q, M, N > slice (size_t x0, size_t y0) const
 
Slice< Type, P, Q, M, N > slice (size_t x0, size_t y0)
 
const Slice< Type, 1, N, M, N > row (size_t i) const
 
Slice< Type, 1, N, M, N > row (size_t i)
 
const Slice< Type, M, 1, M, N > col (size_t j) const
 
Slice< Type, M, 1, M, N > col (size_t j)
 
void setRow (size_t i, const Matrix< Type, N, 1 > &row_in)
 
void setCol (size_t j, const Matrix< Type, M, 1 > &column)
 
void setZero ()
 
void zero ()
 
void setAll (Type val)
 
void setOne ()
 
void setNaN ()
 
void setIdentity ()
 
void identity ()
 
void swapRows (size_t a, size_t b)
 
void swapCols (size_t a, size_t b)
 
Matrix< Type, M, N > abs () const
 
Type max () const
 
Type min () const
 
bool isAllNan () const
 

Detailed Description

template<typename Type>
class matrix::Vector2< Type >

Definition at line 20 of file Vector2.hpp.

Member Typedef Documentation

◆ Matrix21

template<typename Type >
typedef Matrix<Type, 2, 1> matrix::Vector2< Type >::Matrix21

Definition at line 24 of file Vector2.hpp.

◆ Vector3

template<typename Type >
typedef Vector<Type, 3> matrix::Vector2< Type >::Vector3

Definition at line 25 of file Vector2.hpp.

Constructor & Destructor Documentation

◆ Vector2() [1/6]

template<typename Type >
matrix::Vector2< Type >::Vector2 ( )
default

◆ Vector2() [2/6]

template<typename Type >
matrix::Vector2< Type >::Vector2 ( const Matrix21 other)
inline

Definition at line 29 of file Vector2.hpp.

◆ Vector2() [3/6]

template<typename Type >
matrix::Vector2< Type >::Vector2 ( const Type  data_[2])
inlineexplicit

Definition at line 34 of file Vector2.hpp.

◆ Vector2() [4/6]

template<typename Type >
matrix::Vector2< Type >::Vector2 ( Type  x,
Type  y 
)
inline

Definition at line 39 of file Vector2.hpp.

◆ Vector2() [5/6]

template<typename Type >
template<size_t P, size_t Q>
matrix::Vector2< Type >::Vector2 ( const Slice< Type, 2, 1, P, Q > &  slice_in)
inline

Definition at line 47 of file Vector2.hpp.

◆ Vector2() [6/6]

template<typename Type >
matrix::Vector2< Type >::Vector2 ( const Vector3 other)
inlineexplicit

Definition at line 51 of file Vector2.hpp.

Member Function Documentation

◆ cross()

template<typename Type >
Type matrix::Vector2< Type >::cross ( const Matrix21 b) const
inline

Definition at line 58 of file Vector2.hpp.

◆ operator%()

template<typename Type >
Type matrix::Vector2< Type >::operator% ( const Matrix21 b) const
inline

Definition at line 63 of file Vector2.hpp.


The documentation for this class was generated from the following file: