[Newbies] Nested Intervals
peterstewart at telus.net
Fri Mar 14 14:26:37 UTC 2008
Thanks Bert. You did not misunderstand my question. I'm very new
to squeak and
find it a lot of fun. I'm having trouble with syntax and I haven't found
examples that help me.
In this method, 'numerators', 'determinant' is a Matrix. I want this method,
'numerators', to make three matrices from 'determinant',
replacing successive columns (k) with the elements in an OrderedCollection
('constants') Then add these
matrices to an OrderedCollection ('numerators') and return that
When I inspect the 'numerators' returned, it contains a single Matrix, each
column of which is filled with the replacement
column. I tried the Matrix class instance method called "column at: put:".
It put the new column in the wrong place,
spread across two columns, and left all the other elements 'nil'
I'd appreciate any help on this. Thanks
The instance variables are all assigned values in the 'initialize' method.
Object subclass: #Structure
instanceVariableNames: 'determinant constants data denominator
| tempMatrix |
"determinant is a Matrix. constants is an OrderedCollection."
numerators := OrderedCollection new.
tempMatrix := determinant.
(1 to: size) do: [ :k |
(1 to: size) do: [ :row |
(1 to: size) do: [ :column | (tempMatrix
at: row at: k put: (constants at: row))
(numerators add: tempMatrix)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Beginners