Displaying 1 result from an estimated 1 matches for "decompositio".
Did you mean:
decomposition
2012 Sep 24
1
passing a matrix from R to C code
...h>
#include<Rinternals.h>
void lu1(int *n, float *a, float *b, float *ab)
{
int i,k,j,p,na=*n+10;
float sum, l[200][200],u[200][200]z[200];
for(i=0;i<na;i++) {
for(j=0;j<na;j++) {
l[i,j]=0.0;
u[i,j]=0.0;
}
z[i] =0.0;
}
//********** LU decompositio*n *****//
for(k=1;k<=*n;k++)
{
u[k][k]=1;
for(i=k;i<=*n;i++)
{
sum=0;
for(p=1;p<=k-1;p++)
sum+=l[i][p]*u[p][k];
l[i][k]=a[i][k]-sum;
}
for(j=k+1;j<=*n;j++)
{
sum=0;...