Re: Jama+matrix arrays



RaNdoM wrote:
> Hello!
> 
> I have a simple question.
> How to declare an array of matrix? f.ex.
> 
> 	Matrix z[5];
> 
> Let's say that we have:
> 
> 	double[][] foo={{1,4},{2,3},{1,1},{3,5}};
> 
> And now I want to put these 4 vectors into 4 matrix.
> 
> 	for(i=0;i<4;i++) {
> 		Matrix z[i]=new Matrix(foo[i],1);

Should be just:
   z[i] = new Matrix...

I assume that you declared the array earlier.

> 	}
> 
> But it does not work...
> It is a stupid idea to write it like this, using independent z0,z1,z2 and
> z3 variables:
> 
>         Matrix z0 = new Matrix(vB[0],1);
>         Matrix z1 = new Matrix(vB[1],1);
>         Matrix z2 = new Matrix(vB[2],1);
>         Matrix z3 = new Matrix(vB[3],1);
> 
> How to solve this problem? Please help.
> 
> Greg Bauman
> 






Date Index | Thread Index | Problems or questions? Contact list-master@nist.gov