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

#include <Dual.hpp>

Inheritance diagram for matrix::Vector< Type, M >:
Collaboration diagram for matrix::Vector< Type, M >:

Public Types

typedef Matrix< Type, M, 1 > MatrixM1
 

Public Member Functions

 Vector ()=default
 
 Vector (const MatrixM1 &other)
 
 Vector (const Type data_[M])
 
template<size_t P, size_t Q>
 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, size_t M>
class matrix::Vector< Type, M >

Definition at line 22 of file Dual.hpp.

Member Typedef Documentation

◆ MatrixM1

template<typename Type, size_t M>
typedef Matrix<Type, M, 1> matrix::Vector< Type, M >::MatrixM1

Definition at line 23 of file Vector.hpp.

Constructor & Destructor Documentation

◆ Vector() [1/4]

template<typename Type, size_t M>
matrix::Vector< Type, M >::Vector ( )
default

Referenced by matrix::Vector< Type, 3 >::operator*(), and matrix::Vector< Type, 3 >::unit_or_zero().

Here is the caller graph for this function:

◆ Vector() [2/4]

template<typename Type, size_t M>
matrix::Vector< Type, M >::Vector ( const MatrixM1 other)
inline

Definition at line 27 of file Vector.hpp.

◆ Vector() [3/4]

template<typename Type, size_t M>
matrix::Vector< Type, M >::Vector ( const Type  data_[M])
inlineexplicit

Definition at line 32 of file Vector.hpp.

◆ Vector() [4/4]

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

Definition at line 38 of file Vector.hpp.

Member Function Documentation

◆ dot()

template<typename Type, size_t M>
Type matrix::Vector< Type, M >::dot ( const MatrixM1 b) const
inline

Definition at line 55 of file Vector.hpp.

Referenced by CollisionPrevention::_calculateConstrainedSetpoint(), FlightTaskAutoLineSmoothVel::_generateTrajectory(), ControlMath::constrainXY(), main(), TEST_F(), and MatrixTest::vectorTests().

Here is the caller graph for this function:

◆ length()

◆ longerThan()

template<typename Type, size_t M>
bool matrix::Vector< Type, M >::longerThan ( Type  testVal) const
inline

Definition at line 107 of file Vector.hpp.

Referenced by main().

Here is the caller graph for this function:

◆ norm()

◆ norm_squared()

template<typename Type, size_t M>
Type matrix::Vector< Type, M >::norm_squared ( ) const
inline

Definition at line 78 of file Vector.hpp.

Referenced by RoverPositionControl::control_position(), matrix::Vector< Type, 3 >::longerThan(), main(), and StraightLine::setLineFromTo().

Here is the caller graph for this function:

◆ normalize()

template<typename Type, size_t M>
void matrix::Vector< Type, M >::normalize ( )
inline

◆ normalized()

template<typename Type, size_t M>
Vector matrix::Vector< Type, M >::normalized ( ) const
inline

Definition at line 103 of file Vector.hpp.

Referenced by FlightTaskManualPosition::_scaleSticks(), ManualSmoothingXY::_velocitySlewRate(), ControlMath::constrainXY(), main(), ECL_L1_Pos_Controller::navigate_waypoints(), PrecLand::slewrate(), and TEST_F().

Here is the caller graph for this function:

◆ operator()() [1/2]

template<typename Type, size_t M>
Type matrix::Vector< Type, M >::operator() ( size_t  i) const
inline

Definition at line 43 of file Vector.hpp.

◆ operator()() [2/2]

template<typename Type, size_t M>
Type& matrix::Vector< Type, M >::operator() ( size_t  i)
inline

Definition at line 49 of file Vector.hpp.

◆ operator*() [1/2]

template<typename Type, size_t M>
Type matrix::Vector< Type, M >::operator* ( const MatrixM1 b) const
inline

Definition at line 64 of file Vector.hpp.

Referenced by matrix::Vector3< Type >::operator*().

Here is the caller graph for this function:

◆ operator*() [2/2]

template<typename Type, size_t M>
Vector matrix::Vector< Type, M >::operator* ( Type  b) const
inline

Definition at line 69 of file Vector.hpp.

◆ sqrt()

template<typename Type, size_t M>
Vector matrix::Vector< Type, M >::sqrt ( ) const
inline

Definition at line 111 of file Vector.hpp.

Referenced by control::BlockStats< float, n_y_lidar >::getStdDev(), main(), and MatrixTest::vectorTests().

Here is the caller graph for this function:

◆ unit()

template<typename Type, size_t M>
Vector matrix::Vector< Type, M >::unit ( ) const
inline

Definition at line 91 of file Vector.hpp.

Referenced by matrix::AxisAngle< Type >::axis(), matrix::AxisAngle< Type >::AxisAngle(), main(), matrix::Vector< Type, 3 >::normalized(), and MatrixTest::run_tests().

Here is the caller graph for this function:

◆ unit_or_zero()

template<typename Type, size_t M>
Vector matrix::Vector< Type, M >::unit_or_zero ( const Type  eps = Type(1e-5)) const
inline

Definition at line 95 of file Vector.hpp.

Referenced by FlightTaskAutoLineSmoothVel::_prepareSetpoints(), FlightTaskOrbit::generate_circle_approach_setpoints(), FlightTaskOrbit::generate_circle_setpoints(), StraightLine::generateSetpoints(), and main().

Here is the caller graph for this function:

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