add numerical recipes library
This commit is contained in:
26
lib/nr/ansi/recipes/dsvbksb.c
Normal file
26
lib/nr/ansi/recipes/dsvbksb.c
Normal file
@@ -0,0 +1,26 @@
|
||||
|
||||
#define NRANSI
|
||||
#include "nrutil.h"
|
||||
|
||||
void dsvbksb(double **u, double w[], double **v, int m, int n, double b[], double x[])
|
||||
{
|
||||
int jj,j,i;
|
||||
double s,*tmp;
|
||||
|
||||
tmp=dvector(1,n);
|
||||
for (j=1;j<=n;j++) {
|
||||
s=0.0;
|
||||
if (w[j]) {
|
||||
for (i=1;i<=m;i++) s += u[i][j]*b[i];
|
||||
s /= w[j];
|
||||
}
|
||||
tmp[j]=s;
|
||||
}
|
||||
for (j=1;j<=n;j++) {
|
||||
s=0.0;
|
||||
for (jj=1;jj<=n;jj++) s += v[j][jj]*tmp[jj];
|
||||
x[j]=s;
|
||||
}
|
||||
free_dvector(tmp,1,n);
|
||||
}
|
||||
#undef NRANSI
|
||||
Reference in New Issue
Block a user