test_mac.c
来自「快速傅立叶变换程序代码,学信号的同学,可要注意了」· C语言 代码 · 共 37 行
C
37 行
#include "../ansi/r.h"#include "../ansi/mynr.h"/* test program for macopt solution of equation A x = b. *//* */ #include "test.h"void main(int argc, char *argv[]){ gq_args param; double *x , tol = 0.00001 ; int iter , itmax = 10 , n , rich = 0 , end_on_step = 1 , type ; type = end_on_step * 10 + rich ; printf("Solving A x = b\nDimension of A?\n"); inputi(&(param.n)); n=param.n; param.A=dmatrix(1,n,1,n); param.b=dvector(1,n); x=dvector(1,n); typeindmatrix(param.A,1,n,1,n); printf("b vector?\n"); typeindvector(param.b,1,n); printf("Initial condition x?\n"); typeindvector(x,1,n); macopt ( x , param.n , type , tol , &iter , itmax , vgrad_quadratic , (void *)(¶m) ) ; printf("Solution:\n"); quadratic(x,¶m);}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?