// 秒寻科技
// 矩阵运算，包括转置、相乘和求逆
// 周涛
// 2023-04-08

#ifndef __MATRIX_H__
#define __MATRIX_H__

#include "../sysdefine/sysdef.h"

void matrix_transpose(flt32 *pfSourceM, flt32 *pfTargetM, uint8 byRow, uint8 byCol);
uint8 matrix_multi(flt32 *pfM1, uint8 byRow1, uint8 byCol1, flt32 *pfM2, uint8 byRow2, uint8 byCol2, flt32 *pfResultM);

uint8 matrix_inversion(flt32 *pfM1, flt32 *pfM2, uint8 bySize);
void matrix_gen_unit_matrix(flt32 *pfM, uint8 bySize);
void matrix_exchange_row(flt32 *pfM, uint8 byCol, uint8 byRow1, uint8 byRow2);
void matrix_print(flt32 *pfM, uint8 byRow, uint8 byCol);
#endif