From: Ruby Student Date: 2009-04-09T21:59:44+09:00 Subject: Re: Array question - How dynamic is dynamic? --0016e644dd44b6cad604671ed165 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On Tue, Apr 7, 2009 at 11:59 AM, Robert Klemme wrote: > On 07.04.2009 15:38, Mark Thomas wrote: > >> On Apr 7, 8:50 am, Ruby Student wrote: >> >>> Main Array: >>> >>> mA = [ >>> [A, B, C, D], >>> [B, A, C, D], >>> [D, C, B, A], >>> [C, A, D, B] >>> ] >>> >>> Sub Arrays: >>> sAr0 (sub array row 0 to row n, where n is 3 for this case) >>> sAr0 = [A, B, C, D] >>> sAr1 = [B, A, C, D] >>> sAr2 = [D, C, B, A] >>> sAr3 = [C, A, D, B] >>> >> >> I suggest you use the Matrix class (in the standard library). >> > > Are you sure this works? It seems, when I create a row Vector of the > Matrix it is read only. At least []= is defined private. > > But I agree to the general advice to use a special class for this and not > try to work with nested Arrays. That's what OO is for. Defining a two > dimensional matrix with Vector proxies isn't too hard. > > Kind regards > > robert > > Thank you all for your input and suggestions! -- Ruby Student --0016e644dd44b6cad604671ed165--