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

📄 cmatgen.c

📁 数值算法库
💻 C
字号:
/*  cmatgen.c    CCM mathematics library source code. * *  Copyright (C)  2000   Daniel A. Atkinson    All rights reserved. *  This code may be redistributed under the terms of the GNU general *  public license. ( See the gpl.license file for details.) * ------------------------------------------------------------------------ */#include <stdio.h>#include <time.h>#include "ccmath.h"main(na,av)int na; char **av;{ Cpx *a,*p; double nrml();  int n,m,j; unsigned long seed;  FILE *fp;  if(na!=3){ printf("para: dim o_file\n"); exit(1);}  n=atoi(*++av); m=n*n;  fp=fopen(*++av,"wb");  a=(Cpx *)calloc(m,sizeof(Cpx));  seed=(unsigned long)time(NULL); setnrml(seed);  for(j=0,p=a; j<m ;++j){ p->re=nrml(); (p++)->im=nrml();}  fwrite((void *)&n,sizeof(int),1,fp);  fwrite((void *)a,sizeof(Cpx),m,fp);}

⌨️ 快捷键说明

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