http://latex.codecog...e j}^{n}x_i-x_j
So far Ive got this:
double ljmi[max];
int i=0;
int j;
int p = 0;
for(j=0;j<k, i<k;j++) //k <=> n in this case
{
if(j=i && j-1<0)
{
j = j+1;
do
{
ljmi[p] *= (x[i]-x[j]);
}
while(j=k);
{
p+1;
i+1;
}
}
else if(j=i && j-1>0)
{
j = j-1;
do
{
ljmi[p] *= (x[i]-x[j]);
}
while(j=k);
p+1;
i+1;
}
else
{
do
{
ljmi[p] *= (x[i]-x[j]);
}
while(j=k);
p+1;
i+1;
}
}
(I used conditions instead i!=j because it gave me bad result)This should fill me an array ljmi[max].
Now when I do:
cout << arraysum(ljmi, k);or
cout << ljmi[a]; //"a" is any number between 0 and k-1Nothing happens, there is no value printed and I cant exit window with ENTER.
Yeah its a mess but I dont have much experience with cycles - where is mistake and is there a way to make it Small and Stupid?
thx4re


Sign In
Create Account


Back to top









