📄 cmatrix.h
字号:
/// \brief Subtract 1.0 from all elements, e.g. M--.
///
/// \return TRUE if successful, FALSE otherwise.
BOOL MTX_Decrement( MTX *M );
/// \brief Add A += B, inplace.
///
/// \return TRUE if successful, FALSE otherwise.
BOOL MTX_Add_Inplace( MTX *A, const MTX *B );
/// \brief Subtract A -= B, inplace.
///
/// \return TRUE if successful, FALSE otherwise.
BOOL MTX_Subtract_Inplace( MTX *A, const MTX *B );
/// \brief Multiply A = B*A, inplace.
///
/// \return TRUE if successful, FALSE otherwise.
BOOL MTX_PreMultiply_Inplace( MTX *A, const MTX *B ); // A = B*A
/// \brief Multiply A = tranpose(B)*A, inplace.
///
/// \return TRUE if successful, FALSE otherwise.
BOOL MTX_TransposePreMultiply_Inplace( MTX *A, const MTX *B ); // A = tranpose(B)*A
/// \brief Multiply A = A*B, inplace.
///
/// \return TRUE if successful, FALSE otherwise.
BOOL MTX_PostMultiply_Inplace( MTX *A, const MTX* B ); // A = A*B
/// \brief Multiply A = A*transpose(B), inplace.
///
/// \return TRUE if successful, FALSE otherwise.
BOOL MTX_PostMultiplyTranspose_Inplace( MTX *A, const MTX* B ); // A = A*tranpose(B)
/// \brief Dot multiply A .*= B, inplace (A.data[col][row] = A.data[col][row]*B.data[col][row]).
///
/// \return TRUE if successful, FALSE otherwise.
BOOL MTX_DotMultiply_Inplace( MTX *A, const MTX *B );
/// \brief Dot divide A ./= B, inplace (A.data[col][row] = A.data[col][row]/B.data[col][row]).
///
/// \return TRUE if successful, FALSE otherwise.
BOOL MTX_DotDivide_Inplace( MTX *A, const MTX *B );
/// \brief Add A = B+C.
///
/// \return TRUE if successful, FALSE otherwise.
BOOL MTX_Add( MTX *A, const MTX *B, const MTX *C );
/// \brief Subtract A = B-C.
///
/// \return TRUE if successful, FALSE otherwise.
BOOL MTX_Subtract( MTX *A, const MTX *B, const MTX *C );
/// \brief Multiply A = B*C.
///
/// \return TRUE if successful, FALSE otherwise.
BOOL MTX_Multiply( MTX *A, const MTX *B, const MTX *C );
/// \brief Multiply A = transpose(B)*C.
///
/// \return TRUE if successful, FALSE otherwise.
BOOL MTX_TransposeMultiply( MTX *A, const MTX* B, const MTX* C );
/// \brief Multiply A = B*transpose(C).
///
/// \return TRUE if successful, FALSE otherwise.
BOOL MTX_MultiplyTranspose( MTX *A, const MTX* B, const MTX* C ); // A = B*transpose(C)
/// \brief Rest if A == B to within the specified tolerance.
///
/// \return TRUE if successful, FALSE otherwise.
BOOL MTX_IsEqual( const MTX *A, const MTX *B, const double tolerance, BOOL *isEqual );
/// \brief Add this matrix and an identity matrix. Adds 1.0 to the diagonal even if not square.
///
/// \return TRUE if successful, FALSE otherwise.
BOOL MTX_AddIdentity( const MTX *src, MTX *dst );
/// \brief Add this matrix and an identity matrix. Adds 1.0 to the diagonal even if not square.
///
/// \return TRUE if successful, FALSE otherwise.
BOOL MTX_AddIdentity_Inplace( MTX *src );
/// \brief Subtract an identity matrix from this matrix. Subtracts 1.0 from the diagonal even if not square.
///
/// \return TRUE if successful, FALSE otherwise.
BOOL MTX_MinusIdentity( const MTX *src, MTX *dst );
/// \brief Subtract an identity matrix from this matrix. Subtracts 1.0 from the diagonal even if not square.
///
/// \return TRUE if successful, FALSE otherwise.
BOOL MTX_MinusIdentity_Inplace( MTX *src );
/// \brief Subtract this matrix from an identity matrix. Subtracts the diagonal from 1.0 even if not square.
///
/// \return TRUE if successful, FALSE otherwise.
BOOL MTX_IdentityMinus( const MTX *src, MTX *dst );
/// \brief Subtract this matrix from an identity matrix. Subtracts the diagonal from 1.0 even if not square.
///
/// \return TRUE if successful, FALSE otherwise.
BOOL MTX_IdentityMinus_Inplace( MTX *src );
/// \brief Difference and approximte derivative for column col.
/// The Diff is the column difference vector.
/// diff = col[1:N-2] - col[0:N-1].
///
/// \return TRUE if successful, FALSE otherwise.
BOOL MTX_ColumnDiff( const MTX *M, MTX *Diff, const unsigned col );
/// \brief Difference and approximate derivative.
/// The Diff matrix is composed of the column difference vectors.
/// for(i=0:M-1){ diff_i = col_i[1:N-2] - col_i[0:N-1] }
///
/// \return TRUE if successful, FALSE otherwise.
BOOL MTX_Diff( const MTX *M, MTX *Diff );
////
// Statistics
/// \brief Computes the maximum element in the specified column and its index.
/// If the matrix is real, only the real value, re is set, im = 0.
/// If the matrix is complex, both re and im are set.
/// If there are several equal maximum elements, the first index from the beginning is returned.
///
/// \return TRUE if successful, FALSE otherwise.
BOOL MTX_MaxColIndex( const MTX *M, const unsigned col, double *re, double *im, unsigned *row );
/// \brief Computes the maximum element in the specified row and its index.
/// If the matrix is real, only the real value, re is set, im = 0.
/// If the matrix is complex, both re and im are set.
/// If there are several equal maximum elements, the first index from the beginning is returned.
///
/// \return TRUE if successful, FALSE otherwise.
BOOL MTX_MaxRowIndex( const MTX *M, const unsigned row, double *re, double *im, unsigned *col );
/// \brief Computes the minimum element in the specified column and its index.
/// If the matrix is real, only the real value, re is set, im = 0.
/// If the matrix is complex, both re and im are set.
/// If there are several equal minimum elements, the first index from the beginning is returned.
///
/// \return TRUE if successful, FALSE otherwise.
BOOL MTX_MinColIndex( const MTX *M, const unsigned col, double *re, double *im, unsigned *row );
/// \brief Computes the minimum element in the specified row and its index.
/// If the matrix is real, only the real value, re is set, im = 0.
/// If the matrix is complex, both re and im are set.
/// If there are several equal minimum elements, the first index from the beginning is returned.
///
/// \return TRUE if successful, FALSE otherwise.
BOOL MTX_MinRowIndex( const MTX *M, const unsigned row, double *re, double *im, unsigned *col );
/// \brief Computes the absolute maximum element in the specified column and its index.
/// If there are several equal maximum elements, the first index from the beginning is returned.
///
/// \return TRUE if successful, FALSE otherwise.
BOOL MTX_MaxAbsColIndex( const MTX *M, const unsigned col, double *value, unsigned *row );
/// \brief Computes the absolue maximum element in the specified row and a its column index.
/// If there are several equal maximum elements, the first index from the beginning is returned.
///
/// \return TRUE if successful, FALSE otherwise.
BOOL MTX_MaxAbsRowIndex( const MTX *M, const unsigned row, double *value, unsigned *col );
/// \brief Computes the absolute minimum element in the specified column and its index.
/// If there are several equal minimum elements, the first index from the beginning is returned.
///
/// \return TRUE if successful, FALSE otherwise.
BOOL MTX_MinAbsColIndex( const MTX *M, const unsigned col, double *value, unsigned *row );
/// \brief Computes the absolute minimum element in the specified row and its index.
/// If there are several equal minimum elements, the first index from the beginning is returned.
///
/// \return TRUE if successful, FALSE otherwise.
BOOL MTX_MinAbsRowIndex( const MTX *M, const unsigned row, double *value, unsigned *col );
/// \brief Computes the maximum element in the specified column.
/// If the matrix is real, only the real value, re is set, im = 0.
/// If the matrix is complex, both re and im are set.
///
/// \return TRUE if successful, FALSE otherwise.
BOOL MTX_MaxColumn( const MTX *M, const unsigned col, double *re, double *im );
/// \brief Computes the maximum element in the specified row.
/// If the matrix is real, only the real value, re is set, im = 0.
/// If the matrix is complex, both re and im are set.
///
/// \return TRUE if successful, FALSE otherwise.
BOOL MTX_MaxRow( const MTX *M, const unsigned row, double *re, double *im );
/// \brief Computes the minimum element in the specified column.
/// If the matrix is real, only the real value, re is set, im = 0.
/// If the matrix is complex, both re and im are set.
///
/// \return TRUE if successful, FALSE otherwise.
BOOL MTX_MinColumn( const MTX *M, const unsigned col, double *re, double *im );
/// \brief Computes the minimum element in the specified row.
/// If the matrix is real, only the real value, re is set, im = 0.
/// If the matrix is complex, both re and im are set.
///
/// \return TRUE if successful, FALSE otherwise.
BOOL MTX_MinRow( const MTX *M, const unsigned row, double *re, double *im );
/// \brief Computes the absolute maximum element in the specified column.
///
/// \return TRUE if successful, FALSE otherwise.
BOOL MTX_MaxAbsColumn( const MTX *M, const unsigned col, double *value );
/// \brief Computes the absolute maximum element in the specified row.
///
/// \return TRUE if successful, FALSE otherwise.
BOOL MTX_MaxAbsRow( const MTX *M, const unsigned row, double *value );
/// \brief Computes the absolute minimum element in the specified column.
///
/// \return TRUE if successful, FALSE otherwise.
BOOL MTX_MinAbsColumn( const MTX *M, const unsigned col, double *value );
/// \brief Computes the absolute minimum element in the specified row.
///
/// \return TRUE if successful, FALSE otherwise.
BOOL MTX_MinAbsRow( const MTX *M, const unsigned row, double *value );
/// \brief Computes the absolute maximum element for the entire matrix and its row and column index.
/// If there are several equal maximum elements, the first index from the beginning is returned.
///
/// \return TRUE if successful, FALSE otherwise.
BOOL MTX_MaxAbsIndex( const MTX *M, double* value, unsigned *row, unsigned *col );
/// \brief Computes the maximum element for the entire matrix and its row and column index.
/// If there are several equal maximum elements, the first index from the beginning is returned.
///
/// \return TRUE if successful, FALSE otherwise.
BOOL MTX_MaxIndex( const MTX *M, double *re, double *im, unsigned *row, unsigned *col );
/// \brief Computes the absolute maximum element for the entire matrix.
///
/// \return TRUE if successful, FALSE otherwise.
BOOL MTX_MaxAbs( const MTX *M, double* value );
/// \brief Computes the maximum element for the entire matrix.
///
/// \return TRUE if successful, FALSE otherwise.
BOOL MTX_Max( const MTX *M, double *re, double *im );
/// \brief Computes the absolute minimum element for the entire matrix and its row and column index.
/// If there are several equal minimum elements, the first index from the beginning is returned.
///
/// \return TRUE if successful, FALSE otherwise.
BOOL MTX_MinAbsIndex( const MTX *M, double* value, unsigned *row, unsigned *col );
/// \brief Computes the minimum element for the entire matrix and its row and column index.
/// If there are several equal minimum elements, the first index from the beginning is returned.
///
/// \return TRUE if successful, FALSE otherwise.
BOOL MTX_MinIndex( const MTX *M, double *re, double *im, unsigned *row, unsigned *col );
/// \brief Computes the absolute minimum element for the entire matrix.
///
/// \return TRUE if successful, FALSE otherwise.
BOOL MTX_MinAbs( const MTX *M, double* value );
/// \brief Computes the minimum element for the entire matrix.
///
/// \return TRUE if successful, FALSE otherwise.
BOOL MTX_Min( const MTX *M, double *re, double *im );
/// \brief Computes the range of the data in the specified column.
/// Range = MaxVal - MinVal.
/// If the matrix is real, only the real value, re is set, im = 0.
/// If the matrix is complex, both re and im are set.
///
/// \return TRUE if successful, FALSE otherwise.
BOOL MTX_ColumnRange( const MTX *M, const unsigned col, double *re, double *im );
/// \brief Computes the range of the data in the specified row.
/// Range = MaxVal - MinVal.
/// If the matrix is real, only the real value, re is set, im = 0.
/// If the matrix is complex, both re and im are set.
///
/// \return TRUE if successful, FALSE otherwise.
BOOL MTX_RowRange( const MTX *M, const unsigned row, double *re, double *im );
/// \brief Computes the range of the data in the matrix.
/// Range = MaxVal - MinVal.
/// If the matrix is real, only the real value, re is set, im = 0.
/// If the matrix is complex, both re and im are set.
///
/// \return TRUE if successful, FALSE otherwise.
BOOL MTX_Range( const MTX *M, double *re, double *im );
/// \brief Computes the sum for the specified column.
/// If the matrix is real, only the real value, re is set, im = 0.
/// If the matrix is complex, both re and im are set.
///
/// \return TRUE if successful, FALSE otherwise.
BOOL MTX_ColumnSum( const MTX *M, const unsigned col, double *re, double *im );
/// \brief Computes the sum of the absolute values for the specified column.
///
/// \return TRUE if successful, FALSE otherwise.
BOOL MTX_ColumnSumAbs( const MTX *M, const unsigned col, double *value );
/// \brief Computes the sum for the specified row.
/// If the matrix is real, only the real value, re is set, im = 0.
/// If the matrix is complex, both re and im are set.
///
/// \return TRUE if successful, FALSE otherwise.
BOOL MTX_RowSum( const MTX *M, const unsigned row, double *re, double *im );
/// \brief Computes the sum of the data in the matrix .
/// If the matrix is real, only the real value, re is set, im = 0.
/// If the matrix is complex, both re and im are set.
///
/// \return TRUE if successful, FALSE otherwise.
BOOL MTX_Sum( const MTX *M, double *re, double *im );
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -