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

#include <SquareMatrix.hpp>

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

Public Member Functions

 SquareMatrix ()=default
 
 SquareMatrix (const Type data_[M][M])
 
 SquareMatrix (const Type data_[M *M])
 
 SquareMatrix (const Matrix< Type, M, M > &other)
 
template<size_t P, size_t Q>
 SquareMatrix (const Slice< Type, M, M, P, Q > &in_slice)
 
SquareMatrix< Type, M > & operator= (const Matrix< Type, M, M > &other)
 
template<size_t P, size_t Q>
SquareMatrix< Type, M > & operator= (const Slice< Type, M, M, P, Q > &in_slice)
 
SquareMatrix< Type, M > I () const
 
bool I (SquareMatrix< Type, M > &i) const
 
Vector< Type, M > diag () const
 
Vector< Type, M *(M+1)/2 > upper_right_triangle () const
 
Type trace () const
 
- Public Member Functions inherited from matrix::Matrix< Type, M, M >
 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::SquareMatrix< Type, M >

Definition at line 26 of file SquareMatrix.hpp.

Constructor & Destructor Documentation

◆ SquareMatrix() [1/5]

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

◆ SquareMatrix() [2/5]

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

Definition at line 31 of file SquareMatrix.hpp.

◆ SquareMatrix() [3/5]

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

Definition at line 36 of file SquareMatrix.hpp.

◆ SquareMatrix() [4/5]

template<typename Type, size_t M>
matrix::SquareMatrix< Type, M >::SquareMatrix ( const Matrix< Type, M, M > &  other)
inline

Definition at line 41 of file SquareMatrix.hpp.

◆ SquareMatrix() [5/5]

template<typename Type, size_t M>
template<size_t P, size_t Q>
matrix::SquareMatrix< Type, M >::SquareMatrix ( const Slice< Type, M, M, P, Q > &  in_slice)
inline

Definition at line 47 of file SquareMatrix.hpp.

Member Function Documentation

◆ diag()

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

Definition at line 83 of file SquareMatrix.hpp.

Referenced by main(), and MatrixTest::squareMatrixTests().

Here is the caller graph for this function:

◆ I() [1/2]

template<typename Type, size_t M>
SquareMatrix<Type, M> matrix::SquareMatrix< Type, M >::I ( ) const
inline

Definition at line 65 of file SquareMatrix.hpp.

Referenced by polyfitter< PolyfitOrder+1 >::fit(), main(), and run_lm_sphere_fit().

Here is the caller graph for this function:

◆ I() [2/2]

template<typename Type, size_t M>
bool matrix::SquareMatrix< Type, M >::I ( SquareMatrix< Type, M > &  i) const
inline

Definition at line 77 of file SquareMatrix.hpp.

◆ operator=() [1/2]

template<typename Type, size_t M>
SquareMatrix<Type, M>& matrix::SquareMatrix< Type, M >::operator= ( const Matrix< Type, M, M > &  other)
inline

Definition at line 51 of file SquareMatrix.hpp.

◆ operator=() [2/2]

template<typename Type, size_t M>
template<size_t P, size_t Q>
SquareMatrix<Type, M>& matrix::SquareMatrix< Type, M >::operator= ( const Slice< Type, M, M, P, Q > &  in_slice)
inline

Definition at line 58 of file SquareMatrix.hpp.

◆ trace()

template<typename Type, size_t M>
Type matrix::SquareMatrix< Type, M >::trace ( ) const
inline

Definition at line 111 of file SquareMatrix.hpp.

Referenced by main().

Here is the caller graph for this function:

◆ upper_right_triangle()

template<typename Type, size_t M>
Vector<Type, M * (M + 1) / 2> matrix::SquareMatrix< Type, M >::upper_right_triangle ( ) const
inline

Definition at line 95 of file SquareMatrix.hpp.

Referenced by main().

Here is the caller graph for this function:

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