2 i1@(Integer traits) matrixA: i2@(Integer traits)
4 1.0 / (i1 + i2 * (i1 + i2 + 1) / 2 + i1 + 1)
7 a@(Array traits) multiplyAv
10 av := (Array new &capacity: n) atAllPut: 0.0.
11 0 below: n do: [| :i |
12 0 below: n do: [| :j |
13 av at: i put: (av at: i) + ((i matrixA: j) * (a at: j))]].
17 a@(Array traits) multiplyAtv
20 atv := ((Array new &capacity: n) atAllPut: 0.0).
21 0 below: n do: [| :i |
22 0 below: n do: [| :j |
23 atv at: i put: (atv at: i) + ((j matrixA: i) * (a at: j))]].
27 a@(Array traits) multiplyAtAv
29 a multiplyAv multiplyAtv
32 n@(Integer traits) spectralnorm
34 u := (Array new &capacity: n) atAllPut: 1.0.
35 v := (Array new &capacity: n) atAllPut: 0.0.
44 vBv += (u at: i) * (v at: i).
45 vv += (v at: i) * (v at: i)].
46 (vBv / vv) sqrt printString &precision: 9