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

#include <Vector3.hpp>

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

Public Types

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

Public Member Functions

 Vector3 ()=default
 
 Vector3 (const Matrix31 &other)
 
 Vector3 (const Type data_[3])
 
 Vector3 (Type x, Type y, Type z)
 
template<size_t P, size_t Q>
 Vector3 (const Slice< Type, 3, 1, P, Q > &slice_in)
 
Vector3 cross (const Matrix31 &b) const
 
Vector3 operator+ (Vector3 other) const
 Override matrix ops so Vector3 type is returned. More...
 
Vector3 operator- (Vector3 other) const
 
Vector3 operator- () const
 
Vector3 operator* (Type scalar) const
 
Type operator* (Vector3 b) const
 
Vector3 operator% (const Matrix31 &b) const
 
Vector3 unit () const
 Override vector ops so Vector3 type is returned. More...
 
Vector3 normalized () const
 
const Slice< Type, 2, 1, 3, 1 > xy () const
 
Slice< Type, 2, 1, 3, 1 > xy ()
 
Dcm< Type > hat () const
 
- Public Member Functions inherited from matrix::Vector< Type, 3 >
 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::Vector3< Type >

Definition at line 29 of file Vector3.hpp.

Member Typedef Documentation

◆ Matrix31

template<typename Type>
typedef Matrix<Type, 3, 1> matrix::Vector3< Type >::Matrix31

Definition at line 33 of file Vector3.hpp.

Constructor & Destructor Documentation

◆ Vector3() [1/5]

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

Referenced by matrix::Vector3< Type >::unit().

Here is the caller graph for this function:

◆ Vector3() [2/5]

template<typename Type>
matrix::Vector3< Type >::Vector3 ( const Matrix31 other)
inline

Definition at line 37 of file Vector3.hpp.

◆ Vector3() [3/5]

template<typename Type>
matrix::Vector3< Type >::Vector3 ( const Type  data_[3])
inlineexplicit

Definition at line 42 of file Vector3.hpp.

◆ Vector3() [4/5]

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

Definition at line 47 of file Vector3.hpp.

◆ Vector3() [5/5]

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

Definition at line 55 of file Vector3.hpp.

Member Function Documentation

◆ cross()

template<typename Type>
Vector3 matrix::Vector3< Type >::cross ( const Matrix31 b) const
inline

Definition at line 59 of file Vector3.hpp.

Referenced by Sih::equations_of_motion(), main(), matrix::Vector3< Type >::operator%(), matrix::Quaternion< Type >::Quaternion(), Tailsitter::update_transition_state(), and MatrixTest::vector3Tests().

Here is the caller graph for this function:

◆ hat()

template<typename Type>
Dcm<Type> matrix::Vector3< Type >::hat ( ) const
inline

Definition at line 119 of file Vector3.hpp.

Referenced by main().

Here is the caller graph for this function:

◆ normalized()

template<typename Type>
Vector3 matrix::Vector3< Type >::normalized ( ) const
inline

Definition at line 104 of file Vector3.hpp.

References matrix::Vector3< Type >::unit().

Referenced by main(), FollowTarget::on_active(), matrix::Dcm< float >::renormalize(), and ControlMath::thrustToAttitude().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator%()

template<typename Type>
Vector3 matrix::Vector3< Type >::operator% ( const Matrix31 b) const
inline

Definition at line 93 of file Vector3.hpp.

References matrix::Vector3< Type >::cross().

Here is the call graph for this function:

◆ operator*() [1/2]

template<typename Type>
Vector3 matrix::Vector3< Type >::operator* ( Type  scalar) const
inline

Definition at line 83 of file Vector3.hpp.

References matrix::Matrix< Type, M, N >::operator*().

Here is the call graph for this function:

◆ operator*() [2/2]

template<typename Type>
Type matrix::Vector3< Type >::operator* ( Vector3< Type >  b) const
inline

Definition at line 88 of file Vector3.hpp.

References matrix::Vector< Type, M >::operator*().

Here is the call graph for this function:

◆ operator+()

template<typename Type>
Vector3 matrix::Vector3< Type >::operator+ ( Vector3< Type >  other) const
inline

Override matrix ops so Vector3 type is returned.

Definition at line 68 of file Vector3.hpp.

References matrix::Matrix< Type, M, N >::operator+().

Here is the call graph for this function:

◆ operator-() [1/2]

template<typename Type>
Vector3 matrix::Vector3< Type >::operator- ( Vector3< Type >  other) const
inline

Definition at line 73 of file Vector3.hpp.

References matrix::Matrix< Type, M, N >::operator-().

Here is the call graph for this function:

◆ operator-() [2/2]

template<typename Type>
Vector3 matrix::Vector3< Type >::operator- ( ) const
inline

Definition at line 78 of file Vector3.hpp.

References matrix::Matrix< Type, M, N >::operator-().

Here is the call graph for this function:

◆ unit()

template<typename Type>
Vector3 matrix::Vector3< Type >::unit ( ) const
inline

Override vector ops so Vector3 type is returned.

Definition at line 100 of file Vector3.hpp.

References matrix::Vector3< Type >::Vector3().

Referenced by main(), and matrix::Vector3< Type >::normalized().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ xy() [1/2]

template<typename Type>
const Slice<Type, 2, 1, 3, 1> matrix::Vector3< Type >::xy ( ) const
inline

Definition at line 108 of file Vector3.hpp.

Referenced by main(), and TEST_F().

Here is the caller graph for this function:

◆ xy() [2/2]

template<typename Type>
Slice<Type, 2, 1, 3, 1> matrix::Vector3< Type >::xy ( )
inline

Definition at line 113 of file Vector3.hpp.


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