MatrixNxM< TYPE > Class Template Reference Math Library

#include <matrix_nxm.h>

详细描述

template<typename TYPE>
class maxon::MatrixNxM< TYPE >

General n x m matrix.

Public Types

using  ValueType = TYPE

公共成员函数

  MatrixNxM ()
  MatrixNxM ( MatrixNxM && src )
  MAXON_OPERATOR_MOVE_ASSIGNMENT ( MatrixNxM )
Result < void >  Resize ( Int new_xcnt, Int new_ycnt)
Result < void >  CopyFrom (const MatrixNxM & src )
TYPE &  operator() ( Int x, Int y)
const TYPE &  operator() (const Int x, const Int y) const
Int   GetXCount () const
Int   GetYCount () const
Result < void >  ShiftMatrix ()
String   ToString (const FormatStatement *formatStatement=nullptr) const
  MAXON_OPERATOR_EQUALITY_HASHCODE ( MatrixNxM , _xcnt , _ycnt , _arr )

私有成员函数

  MAXON_DISALLOW_COPY_AND_ASSIGN ( MatrixNxM )

Private Attributes

BaseArray < TYPE >  _arr
Int   _xcnt
Int   _ycnt

Member Typedef Documentation

◆  ValueType

using ValueType = TYPE

构造函数 & 析构函数文档编制

◆  MatrixNxM() [1/2]

MatrixNxM ( )

Creates a matrix with no rows or columns.

◆  MatrixNxM() [2/2]

MatrixNxM ( MatrixNxM < TYPE > &&  src )

成员函数文档编制

◆  MAXON_DISALLOW_COPY_AND_ASSIGN()

MAXON_DISALLOW_COPY_AND_ASSIGN ( MatrixNxM < TYPE >  )
private

◆  MAXON_OPERATOR_MOVE_ASSIGNMENT()

MAXON_OPERATOR_MOVE_ASSIGNMENT ( MatrixNxM < TYPE >  )

◆  Resize()

Result <void> Resize ( Int   new_xcnt ,
Int   new_ycnt  
)

Resizes the matrix to contain new_xcnt*new_ycnt elements. If new_xcnt or new_ycnt differ from the existing values the internal array is expanded.

参数
[in] new_xcnt new number of columns
[in] new_ycnt new number of rows

◆  CopyFrom()

Result <void> CopyFrom ( const MatrixNxM < TYPE > &  src )

Copy matrix elements from src matrix. The number of rows and columns are resized if necessary.

参数
[in] src source matrix

◆  operator()() [1/2]

TYPE& operator() ( Int   x ,
Int   y  
)

Operator to access a matrix element.

参数
[in] x column
[in] y row
返回
matrix element value

◆  operator()() [2/2]

const TYPE& operator() ( const Int   x ,
const Int   y  
) const

Operator to access a matrix element.

参数
[in] x column
[in] y row
返回
matrix element value

◆  GetXCount()

Int GetXCount ( ) const

Get number of columns.

返回
number of columns

◆  GetYCount()

Int GetYCount ( ) const

Get number of rows.

返回
number of rows

◆  ShiftMatrix()

Result <void> ShiftMatrix ( )

Reorganises the matrix so that the four quadrants

| A | B |

| C | D |

are then

| D | C |

| B | A |

This function is especially useful for dealing with FFT transformed data Note: If either number of rows or columns are not a multiple of 2 you get an error.

◆  ToString()

String ToString ( const FormatStatement formatStatement = nullptr ) const

Returns a readable string of the content.

参数
[in] formatStatement Nullptr or additional formatting instruction. See also Formatting Floating point values .
返回
The converted result.

◆  MAXON_OPERATOR_EQUALITY_HASHCODE()

MAXON_OPERATOR_EQUALITY_HASHCODE ( MatrixNxM < TYPE >  ,
_xcnt   ,
_ycnt   ,
_arr    
)

Member Data Documentation

◆  _arr

BaseArray <TYPE> _arr
private

◆  _xcnt

Int _xcnt
private

◆  _ycnt

Int _ycnt
private