|
Class: MatrixAccessor
Object
|
+--Collection
|
+--SequenceableCollection
|
+--AbstractMultidimensionalArray
|
+--AbstractMatrix
|
+--MatrixAccessor
- Package:
- stx:libbasic
- Category:
- Collections-MultiDimensional
- Version:
- rev:
1.8
date: 2021/02/28 17:25:16
- user: cg
- file: MatrixAccessor.st directory: libbasic
- module: stx stc-classLibrary: libbasic
Matrix-Access for arbitrary sequenceable collections.
Allows arbitrary collections which offer access by an integer index
to function as matrices.
[instance variables:]
[class variables:]
copyrightCOPYRIGHT (c) 2018 by eXept Software AG
All Rights Reserved
This software is furnished under a license and may be used
only in accordance with the terms of that license and with the
inclusion of the above copyright notice. This software may not
be provided or otherwise made available to, or used by, any
other person. No title to or ownership of the software is
hereby transferred.
instance creation
-
collection: coll dimensions: dimensions
-
accessing
-
at: index
-
Modified (comment): / 28-02-2021 / 18:05:07 / cg
-
at: index put: val
-
Modified (comment): / 28-02-2021 / 18:05:11 / cg
-
size
-
(comment from inherited method)
return the number of elements in the collection.
concrete implementations must define this
private-initialization
-
collection: arrayArg
-
-
collection: arrayArg dimensions: dimensionsArg
-
species instance creation
-
speciesNew: size
-
create a new instance of my species.
MUST be redefined especially for MatrixAccessor
You have to enable the Parser's arrayIndexingExtension support
in order to be able to execute the examples below.
Parser allowArrayIndexSyntaxExtension:true
|m|
m := FloatArray[3][3].
m [2][1] := 1.
m [2][2] := 2.
m [2][3] := 3.
m
|
this will be a benchmark, once we start tuning.
|sz m1 m2|
sz := 100.
m1 := FloatArray[sz][sz].
m2 := FloatArray[sz][sz].
1 to:(sz*sz) do:[:i |
m1 at:i put:(Random next).
m2 at:i put:(Random next).
].
m1 * m2
|
|