⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cmatrix.h

📁 c 编写的矩阵运算包括加减乘
💻 H
字号:
//used for matrixs' basic function
#define TRUE 1
#define FALSE 0
#define SPECIAL -1
#define MAXSIZE 100
//define matrixs' elemtype ,chang as need
typedef double ElemType;

typedef int status;

struct spot{
        int x;
        int y;
        }respot;
typedef struct spot spot, *sqSpot;//used for store spot
        
        
typedef struct MElemType{
        spot n;//stored for the plot of element
        ElemType num; //elememt
        }MElemType;


struct matrix{
       struct MElemType elem[MAXSIZE];
       int length,arow,aline;
       }rematrix;
       
typedef struct matrix matrix, *sqMatrix;
       


//creat new matrix
sqMatrix initMatrix( int row, int line );

//va
status va(sqMatrix m,int x,int y,ElemType value);

//ott
status ott_x(int length,int row,int line);
status ott_y(int length,int row,int line);

//transpose
sqMatrix transpose(sqMatrix n);

//inputMatrix
status inputMatrix(sqMatrix m);

//outputMatrix
status outputMatrix(sqMatrix m);

//det
ElemType det(sqMatrix detv);

//element in adjoin matrix
ElemType adjMatrix_elem(sqMatrix m,int x,int y);

//adjoin matrix
sqMatrix adjMatrix(sqMatrix m);

//multiplicate a number with a matrix
sqMatrix multiNMatrix(sqMatrix m,ElemType t);

//multiplicate a matrix with a matrix
sqMatrix multiMatrix(sqMatrix m,sqMatrix n);

//copy matrix m to n
sqMatrix copyMatrix(sqMatrix m);

//get value
ElemType v(sqMatrix m,int x,int y);

status RMatrix(sqMatrix r,ElemType v,ElemType w,ElemType k);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -