eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'MatrixAccessor':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: MatrixAccessor


Inheritance:

   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

Description:


Matrix-Access for arbitrary sequenceable collections.
Allows arbitrary collections which offer access by an integer index
to function as matrices.


[instance variables:]

[class variables:]

copyright

COPYRIGHT (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.

Class protocol:

instance creation
o  collection: coll dimensions: dimensions


Instance protocol:

accessing
o  at: index
Modified (comment): / 28-02-2021 / 18:05:07 / cg

o  at: index put: val
Modified (comment): / 28-02-2021 / 18:05:11 / cg

o  size
(comment from inherited method)
return the number of elements in the collection.
concrete implementations must define this

private-initialization
o  collection: arrayArg

o  collection: arrayArg dimensions: dimensionsArg

species instance creation
o  speciesNew: size
create a new instance of my species.
MUST be redefined especially for MatrixAccessor


Examples:


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     


ST/X 7.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Sun, 22 Dec 2024 04:05:32 GMT