国外的c数值算法书籍源程序(Numerical Recipes Source- C2.02)

源代码在线查看: mpdiv.c

软件大小: 731 K
上传用户: anlan001
关键词: Numerical Recipes Source 2.02
下载地址: 免注册下载 普通下载 VIP

相关代码

				#define NRANSI
				#include "nrutil.h"
				#define MACC 3
				
				void mpdiv(unsigned char q[], unsigned char r[], unsigned char u[],
					unsigned char v[], int n, int m)
				{
					void mpinv(unsigned char u[], unsigned char v[], int n, int m);
					void mpmov(unsigned char u[], unsigned char v[], int n);
					void mpmul(unsigned char w[], unsigned char u[], unsigned char v[], int n,
						int m);
					void mpsub(int *is, unsigned char w[], unsigned char u[], unsigned char v[],
						int n);
					int is;
					unsigned char *rr,*s;
				
					rr=cvector(1,(n+MACC)					s=cvector(1,n+MACC);
					mpinv(s,v,n-m+MACC,m);
					mpmul(rr,s,u,n-m+MACC,n);
					mpmov(q,&rr[1],n-m+1);
					mpmul(rr,q,v,n-m+1,m);
					mpsub(&is,&rr[1],u,&rr[1],n);
					if (is) nrerror("MACC too small in mpdiv");
					mpmov(r,&rr[n-m+1],m);
					free_cvector(s,1,n+MACC);
					free_cvector(rr,1,(n+MACC)				}
				#undef MACC
				#undef NRANSI
							

相关资源