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

📄 vanded.c

📁 seismic software,very useful
💻 C
字号:
/* Copyright (c) Colorado School of Mines, 1990./* All rights reserved.                       *//*FUNCTION:  solve Vandermonde system of equations Vx=b (double version)PARAMETERS:n			i dimension of systemv			i array of 2nd row of Vandermonde matrix (1st row is all ones)b			i array of right-hand-side column vectorx			o array of solution column vectorNOTES:The arrays b and x may be equivalenced.Adapted from Algorithm 5.6-2 in Golub, G. H., and Van Loan, C. F., 1983,Matrix Computations, John-Hopkins University Press.AUTHOR:  Dave Hale, Colorado School of Mines, 06/02/89*/void vanded (int n, double v[], double b[], double x[]){	int i,j;	for (i=0; i<n; i++)		x[i] = b[i];	for (i=0; i<n-1; i++)		for (j=n-1; j>i; j--)			x[j] -= v[i]*x[j-1];	for (i=n-1; i>0; i--) {		for (j=i; j<n; j++)			x[j] /= (v[j]-v[j-i]);		for (j=i; j<n; j++)			x[j-1] -= x[j];	}}

⌨️ 快捷键说明

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