/* thmgen.c CCMATH mathematics library source code. * * Copyright (C) 2000 Daniel A. Atkinson All rights reserved. * This code may be redistributed under the terms of the GNU library * public license (LGPL). ( See the lgpl.license file for details.) * ------------------------------------------------------------------------ */ /* Test: hmgen unitary Uses: cmprt Input parameter: n -> size of matrix is n by n */ #include "ccmath.h" unsigned int seed=123456789; void main(int na,char **av) { Cpx *h,*u,*p; int i,j,n; double *e,s; if(na!=2){ printf("para: size\n"); exit(1);} n=atoi(*++av); h=(Cpx *)calloc(n*n,sizeof(Cpx)); u=(Cpx *)calloc(n*n,sizeof(Cpx)); e=(double *)calloc(n,sizeof(double)); /* initialize real eigenvalues */ for(i=0,s=1.; i