quadmx.c

来自「适合大型数值计算代码 现在网络上已经找不到了 购买需要20$」· C语言 代码 · 共 30 行

C
30
字号
#include <math.h>#define NRANSI#include "nrutil.h"#define PI 3.14159265double x;void quadmx(float **a, int n){	void kermom(double w[], double y, int m);	void wwghts(float wghts[], int n, float h,		void (*kermom)(double [], double ,int));	int j,k;	float h,*wt,xx,cx;	wt=vector(1,n);	h=PI/(n-1);	for (j=1;j<=n;j++) {		x=xx=(j-1)*h;		wwghts(wt,n,h,kermom);		cx=cos(xx);		for (k=1;k<=n;k++) a[j][k]=wt[k]*cx*cos((k-1)*h);		++a[j][j];	}	free_vector(wt,1,n);}#undef PI#undef NRANSI

⌨️ 快捷键说明

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