# Re: Jama+matrix arrays

• Subject: Re: Jama+matrix arrays
• From: Ray Conner <rconner@objectsciences.com>
• Date: Mon, 17 Mar 2003 08:11:19 -0500
• Content-Transfer-Encoding: 7bit
• Content-Type: text/plain; charset=us-ascii; format=flowed
• References: <Pine.LNX.4.51L0.0303151451510.14110@serek>
• User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.1) Gecko/20020826

```
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);
>