matrixinverse.h
来自「计算了在有耗介质中半波天线的近场和原场的电场和磁场分量」· C头文件 代码 · 共 75 行
H
75 行
/*
* 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 + =
减小字号Ctrl + -
显示快捷键?