📄 matrixinverse.h
字号:
/*
* A byproduct of my project, I hope it can be a little useful to us.
* only used for intercommunacation, anyone who is interested in this
* arithmetic can contact with the author
* Version: 1.0
* Author: SEwind
* Date: 2005.7
* Email: zhchangan@yahoo.com.cn
*/
#ifndef MATRIXINVERSE_H
#define MATRIXINVERSE_H
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
typedef struct
{
double re;
double im;
}doubleComplex;
typedef struct
{
int row;
int col;
doubleComplex **a;
}doubleComplexMatrix;
const double eps = 1e-6;
/* Dynamically allocate memory for a matrix */
doubleComplexMatrix *doubleComplexMatrixAlloc(int row,int col);
/* Free the allocated memory for a matrix */
void doubleComplexMatrixFree(doubleComplexMatrix *mat);
/* Print a matrix */
void doublePrintComplexMatrix(doubleComplexMatrix *mat);
/* Two matrix's multiplication:A*B */
doubleComplexMatrix *doubleComplexMatrixMpy(doubleComplexMatrix *mat1,doubleComplexMatrix *mat2);
/* Get the inverse of a matrix */
doubleComplexMatrix *doubleComplexMatrixInverse(doubleComplexMatrix *mat);
/* Set valure for a doubleComplex type variable */
doubleComplex doubleComplexSet(double real,double imag);
/* Get the modulus of a doubleComplex type variable */
double doubleComplexAbs(doubleComplex x);
/* Two variable's addition:x+y */
doubleComplex doubleCAdd(doubleComplex x,doubleComplex y);
/* Two variable's addition:x-y */
doubleComplex doubleCSub(doubleComplex x,doubleComplex y);
/* Two variable's multiplication:x*y */
doubleComplex doubleCMpy(doubleComplex x,doubleComplex y);
doubleComplex doubleCDiv(doubleComplex x);
doubleComplex doubleDMpy(double c,doubleComplex y);
//对复数开根号
doubleComplex sqrtC(doubleComplex z);
doubleComplex expC(doubleComplex z);
doubleComplex TanhC(doubleComplex z);
doubleComplex SinhC(doubleComplex z);
doubleComplex CoshC(doubleComplex z);
doubleComplex SinC(doubleComplex z);
doubleComplex CosC(doubleComplex z);
void doubleCprint(doubleComplex z);
doubleComplex doubleCintegrat(double a,double b,doubleComplex (*f)(double zi));
#endif /*MATRIXINVERSE_H*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -