Softanza
StartFrançais
Softanza
The library documents itself · Numeric & optimization

stzMatrix

99 own methods · 25 forms written with extensions, listed under their method · Also inherits from stzListOfLists (38) · stzList (874)

the source: base/number/stzMatrix.ring(opens in a new tab) · All classes · The area reference: Numeric & optimization

Under each method, its extensions (Q CS XT Z ZZ IB W U): bold and ticked, it exists; struck, it does not. The extensions and what they mean

Examples: 6 come from the library's tests; 33 were composed from each method's signature and run for this page, on a fresh object, for example o1 = new stzMatrix([ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ] ]). 60 methods have none yet. Examples run on 2026-10-03 20:34 inside the library at commit 0e72e2e2c.

Method
Explanation, as the source carries it
ClassName
(no comment in the source: the name reads as a sentence) class namealso written: StzClassName
composed example
o1 = new stzMatrix([ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ] ])
? o1.ClassName()
#--> stzmatrix
composed from the signature, run for this page
no extension
init
Constructor with flexible initializationno extension
Raw matrix access 3 examples runQCSXTZZZIBWU
Copy
(no comment in the source: the name reads as a sentence) copyno extension
Rows
Matrix Structure Queries
composed example
o1 = new stzMatrix([ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ] ])
? o1.Rows()
#--> 3
composed from the signature, run for this page
no extension
Cols
(no comment in the source: the name reads as a sentence) cols
composed example
o1 = new stzMatrix([ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ] ])
? o1.Cols()
#--> 3
composed from the signature, run for this page
no extension
Size
(no comment in the source: the name reads as a sentence) size
composed example
o1 = new stzMatrix([ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ] ])
? @@( o1.Size() )
#--> [ 3, 3 ]
composed from the signature, run for this page
no extension
Add
Adds a value to each matrix elementQCSXTZZZIBWUMany
AddCV
element-level operations
composed example
o1 = new stzMatrix([ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ] ])
o1.AddCV(2, 5)
? @@( o1.Content() )
#--> [ [ 1, 7, 3 ], [ 4, 10, 6 ], [ 7, 13, 9 ] ]
composed from the signature, run for this page
no extension
AddVC
element-level operationsno extension
AddRV
Same as AddInRow: Instead of this: for i = 1 to @nRows @aContent[i][pnCol] += pnValue next Adds a value to a specific row
composed example
o1 = new stzMatrix([ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ] ])
o1.AddRV(2, 5)
? @@( o1.Content() )
#--> [ [ 1, 2, 3 ], [ 9, 10, 11 ], [ 7, 8, 9 ] ]
composed from the signature, run for this page
no extension
AddVR
Same as AddInRow: Instead of this: for i = 1 to @nRows @aContent[i][pnCol] += pnValue next Adds a value to a specific row
composed example
o1 = new stzMatrix([ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ] ])
o1.AddVR(2, 2)
? @@( o1.Content() )
#--> [ [ 1, 2, 3 ], [ 6, 7, 8 ], [ 7, 8, 9 ] ]
composed from the signature, run for this page
no extension
AddToCol
The "To" spelling, which test 01 has always documented -- both the names and the resulting matrices -- while nothing defined them.
composed example
o1 = new stzMatrix([ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ] ])
o1.AddToCol(2, 5)
? @@( o1.Content() )
#--> [ [ 1, 7, 3 ], [ 4, 10, 6 ], [ 7, 13, 9 ] ]
composed from the signature, run for this page
no extension
AddToColumn
element-level operations
composed example
o1 = new stzMatrix([ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ] ])
o1.AddToColumn(2, 5)
? @@( o1.Content() )
#--> [ [ 1, 7, 3 ], [ 4, 10, 6 ], [ 7, 13, 9 ] ]
composed from the signature, run for this page
no extension
AddToRow
Same as AddInRow: Instead of this: for i = 1 to @nRows @aContent[i][pnCol] += pnValue next Adds a value to a specific row
composed example
o1 = new stzMatrix([ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ] ])
o1.AddToRow(2, 5)
? @@( o1.Content() )
#--> [ [ 1, 2, 3 ], [ 9, 10, 11 ], [ 7, 8, 9 ] ]
composed from the signature, run for this page
no extension
AddInCol
element-level operations
composed example
o1 = new stzMatrix([ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ] ])
o1.AddInCol(2, 5)
? @@( o1.Content() )
#--> [ [ 1, 7, 3 ], [ 4, 10, 6 ], [ 7, 13, 9 ] ]
composed from the signature, run for this page
no extension
AddInRow
Instead of this: for i = 1 to @nRows @aContent[i][pnCol] += pnValue next Adds a value to a specific row
composed example
o1 = new stzMatrix([ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ] ])
o1.AddInRow(2, 5)
? @@( o1.Content() )
#--> [ [ 1, 2, 3 ], [ 9, 10, 11 ], [ 7, 8, 9 ] ]
composed from the signature, run for this page
no extension
AddInCols
Instead of this: for j = 1 to @nCols @aContent[pnRow][j] += pnValue next Adds a value to multiple columns
composed example
o1 = new stzMatrix([ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ] ])
o1.AddInCols([ 2, 3 ], 2)
? @@( o1.Content() )
#--> [ [ 1, 4, 5 ], [ 4, 7, 8 ], [ 7, 10, 11 ] ]
composed from the signature, run for this page
no extension
AddInRows
Adds a value to multiple rows A copy of AddInCols that was never finished being renamed: every reference below said `paColumns`, which is not a parameter of this method, and the fallback loop read `panRows` and `_nRow_`, which do not exist either -- while adding the value TWICE per cell. The method could not run on any input.
composed example
o1 = new stzMatrix([ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ] ])
o1.AddInRows([ 2, 3 ], 2)
? @@( o1.Content() )
#--> [ [ 1, 2, 3 ], [ 6, 7, 8 ], [ 9, 10, 11 ] ]
composed from the signature, run for this page
no extension
AddInDiagonal
Add value to main diagonal elements
composed example
o1 = new stzMatrix([ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ] ])
o1.AddInDiagonal(2)
? @@( o1.Content() )
#--> [ [ 3, 2, 3 ], [ 4, 7, 6 ], [ 7, 8, 11 ] ]
composed from the signature, run for this page
no extension
AddInDiagonal2
Add value to secondary diagonal elements
composed example
o1 = new stzMatrix([ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ] ])
o1.AddInDiagonal2(2)
? @@( o1.Content() )
#--> [ [ 1, 2, 5 ], [ 4, 7, 6 ], [ 9, 8, 9 ] ]
composed from the signature, run for this page
no extension
Multiply
element-wise multiplicationno extension
MultiplyCV
Same as MultiplyCol: Multiply a specific column by a valueno extension
MultiplyVC
Same as MultiplyCol: Multiply a specific column by a valueno extension
MultiplyRV
Same as MultiplyRow: Multiply a specific row by a valueno extension
MultiplyVR
Same as MultiplyRow: Multiply a specific row by a valueno extension
MultiplyBy
element-wise multiplicationQCSXTZZZIBWU
MultiplyCol
Multiply a specific column by a valueno extension
MultiplyColBy
element-wise multiplicationno extension
MultiplyByInCol
element-wise multiplicationno extension
Multiply many columns at one time 1 examples run
oM = new stzMatrix([ [1,0,3], [4,0,6], [7,0,9] ])
oM.MultiplyCols([1, 3], :By = 2)
# columns 1 and 3 doubled, column 2 untouched
? @@(oM.Content())
#--> [ [ 2, 0, 6 ], [ 8, 0, 12 ], [ 14, 0, 18 ] ]
library testno extension
MultiplyRow
Multiply a specific row by a valueno extension
MultiplyRowBy
element-wise multiplicationno extension
MultiplyByInRow
element-wise multiplicationno extension
MultiplyRows
Multiply many rows at one timeno extension
MultiplyDiagonal1
Multiply main diagonal elements by a valueno extension
MultiplyDiagonal
Same as MultiplyDiagonal1: Multiply main diagonal elements by a valueno extension
MultiplyByInDiagonal1
Same as MultiplyDiagonal1: Multiply main diagonal elements by a valueno extension
MultiplyByInDiagonal
Same as MultiplyDiagonal1: Multiply main diagonal elements by a valueno extension
MultiplyDiagonal2
Multiply secondary diagonal elements by a valueno extension
MultiplyByInDagonal2
Same as MultiplyDiagonal2: Multiply secondary diagonal elements by a valueno extension
AddMatrix
(no comment in the source: the name reads as a sentence) add matrixin the section matrix-to-matrix operationsno extension
SubtractMatrix
R4 step 1 -- MATRIX HYGIENE: the training prerequisites (elementwise ops, trace, norm, Ax=b). Haro floor; the engine tier accelerates behind the same surface later.no extension
MultiplyElementwise
(no comment in the source: the name reads as a sentence) multiply elementwisein the section matrix-to-matrix operationsno extension
HadamardProduct
(no comment in the source: the name reads as a sentence) hadamard productin the section matrix-to-matrix operationsno extension
DivideElementwise
(no comment in the source: the name reads as a sentence) divide elementwisein the section matrix-to-matrix operationsno extension
Trace
(no comment in the source: the name reads as a sentence) tracein the section matrix-to-matrix operations
composed example
o1 = new stzMatrix([ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ] ])
? o1.Trace()
#--> 15
composed from the signature, run for this page
no extension
FrobeniusNorm
(no comment in the source: the name reads as a sentence) frobenius normalso written: Normin the section matrix-to-matrix operations
composed example
o1 = new stzMatrix([ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ] ])
? o1.FrobeniusNorm()
#--> 16.88
composed from the signature, run for this page
no extension
SolveFor
A note on what NOT to do here: this method already existed, and the first instinct on adding an engine solve was to write a new one beside it. That is exactly how LCM and GCD became second, divergent implementations that answered 0 instead of 24. A short name must alias the full method, and a faster path must replace the slow one INSIDE it -- never sit next to it.also written: Solveno extension
(no comment in the source: the name reads as a sentence) multiply by matrix 1 examples runin the section matrix-to-matrix operationsQCSXTZZZIBWU
Sum
Calculates the sum of all elements
composed example
o1 = new stzMatrix([ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ] ])
? o1.Sum()
#--> 45
composed from the signature, run for this page
no extension
Mean
Calculates the mean of all elements
composed example
o1 = new stzMatrix([ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ] ])
? o1.Mean()
#--> 5
composed from the signature, run for this page
no extension
Max
Finds the maximum value in the matrix
composed example
o1 = new stzMatrix([ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ] ])
? o1.Max()
#--> 9
composed from the signature, run for this page
no extension
Min
Finds the minimum value in the matrix
composed example
o1 = new stzMatrix([ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ] ])
? o1.Min()
#--> 1
composed from the signature, run for this page
no extension
Power
Calculates the power of all elementsQCSXTZZZIBWU
RaiseToPower
Same as Power: Calculates the power of all elementsQCSXTZZZIBWU
ToPower
Same as Power: Calculates the power of all elementsQCSXTZZZIBWU
(no comment in the source: the name reads as a sentence) find element 1 examples runin the section finding thing in the matrix
o1 = new stzMatrix([
	[ 80, 85, 99 ],
	[ 70, 75, 80 ],
	[ 99, 65, 99 ]
])
? @@( o1.FindElement(99) )
#--> [ [ 1, 3 ], [ 3, 1 ], [ 3, 3 ] ]
library testno extension
(no comment in the source: the name reads as a sentence) find elements 1 examples runin the section finding thing in the matrix
o1 = new stzMatrix([
	[ 88, 85, 99 ],
	[ 70, 88, 80 ],
	[ 99, 65, 99 ]
])
? @@( o1.FindElements([ 88, 99 ]) )
#--> [ [ 1, 1 ], [ 2, 2 ], [ 1, 3 ], [ 3, 1 ], [ 3, 3 ] ]
library testno extension
`def`, not `func`. Inside a class body `func` does not define a method, so FindCol was unreachable and FindCols -- its only caller -- raised R14. It was the sole `func` among 95 definitions here; FindRow, FindRows and FindCols all use `def`. 2 examples run
o1 = new stzMatrix([
	[ 88, 85, 88 ],
	[ 70, 88, 70 ],
	[ 99, 65, 99 ]
])
? @@( o1.FindCol([ 88, 70, 99 ]) )
#--> [ 1, 3 ]
library testno extension
(no comment in the source: the name reads as a sentence) find cols 2 examples runin the section finding thing in the matrix
oM = new stzMatrix([ [88,85,88], [70,88,70], [99,65,99] ])
# FindCol
? @@(oM.FindCol([ 88, 70, 99 ]))
oM2 = new stzMatrix([ [88,85,88,1], [70,88,70,1], [99,65,99,1] ])
# ...and FindCols, which could not work without it
? @@(oM2.FindCols([ [1,1,1], [88,70,99] ]))
#--> [ 1, 3 ]
#--> [ 1, 3, 4 ]
library testno extension
(no comment in the source: the name reads as a sentence) find row 1 examples runin the section finding thing in the matrix
o1 = new stzMatrix([
	[ 7, 21, 88 ],
	[ 1, 11, 11 ],
	[ 7, 21, 88 ]
])
? @@( o1.FindRow([ 7, 21, 88 ]) )
#--> [ 1, 3 ]
library testno extension
(no comment in the source: the name reads as a sentence) find rows 1 examples runin the section finding thing in the matrixno extension
Getting the section of elements between two positions 1 examples runalso written: FindNumbersInSection
composed example
o1 = new stzMatrix([ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ] ])
? @@( o1.FindElementsInSection([ 2, 3 ], [ 2, 3 ]) )
#--> [ [ 3, 2 ] ]
composed from the signature, run for this page
no extension
(no comment in the source: the name reads as a sentence) find in section 1 examples runin the section finding thing in the matrixno extension
FindElementInSection
(no comment in the source: the name reads as a sentence) find element in sectionalso written: FindNumberInSection · FindThisNumberInSection · FindThisElementInSectionin the section finding thing in the matrixno extension
FindTheseElementsInSection
(no comment in the source: the name reads as a sentence) find these elements in sectionalso written: FindTheseNumbersInSectionin the section finding thing in the matrixno extension
(no comment in the source: the name reads as a sentence) section 2 examples runalso written: NumbersInSection · ElementsInSectionin the section finding thing in the matrix
composed example
o1 = new stzMatrix([ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ] ])
? @@( o1.Section([ 2, 3 ], [ 2, 3 ]) )
#--> [ [ 8 ] ]
composed from the signature, run for this page
QCSXTZZZIBWUQQ
SubMatrix
Creates a submatrix by extracting specific rows and columnsQCSXTZZZIBWU
Replaces a specific column with a given list 1 examples runno extension
ReplaceCols
Replace multiple columnsno extension
Replace a specific row 2 examples runno extension
ReplaceRows
Replace multiple rowsno extension
Replacing all the occurrence of an element by a new element 1 examples run
composed example
o1 = new stzMatrix([ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ] ])
o1.ReplaceElement(2, 5)
? @@( o1.Content() )
#--> [ [ 1, 5, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ] ]
composed from the signature, run for this page
no extension
ReplaceAllOccurrences
Same as ReplaceElement: Replacing all the occurrence of an element by a new element
composed example
o1 = new stzMatrix([ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ] ])
o1.ReplaceAllOccurrences(2, 5)
? @@( o1.Content() )
#--> [ [ 1, 5, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ] ]
composed from the signature, run for this page
QCSXTZZZIBWU
ReplaceNumber
Same as ReplaceElement: Replacing all the occurrence of an element by a new element
composed example
o1 = new stzMatrix([ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ] ])
o1.ReplaceNumber(2, 5)
? @@( o1.Content() )
#--> [ [ 1, 5, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ] ]
composed from the signature, run for this page
no extension
Replacing any element at the given position by a new element 1 examples run
composed example
o1 = new stzMatrix([ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ] ])
o1.ReplaceElementAt([ 2, 3 ], 2)
? @@( o1.Content() )
#--> [ [ 1, 2, 3 ], [ 4, 5, 2 ], [ 7, 8, 9 ] ]
composed from the signature, run for this page
no extension
ReplaceNumberAt
Same as ReplaceElementAt: Replacing any element at the given position by a new element
composed example
o1 = new stzMatrix([ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ] ])
o1.ReplaceNumberAt([ 2, 3 ], 2)
? @@( o1.Content() )
#--> [ [ 1, 2, 3 ], [ 4, 5, 2 ], [ 7, 8, 9 ] ]
composed from the signature, run for this page
no extension
ReplaceThisElementAt
Replacing a given element by a new element, only if it exists at the given posisitonno extension
ReplaceThisNumberAt
Same as ReplaceThisElementAt: Replacing a given element by a new element, only if it exists at the given posisitonno extension
ReplaceTheseElementsAt
Replacing the occureences of the given elements in the matrix by the given new element, only they exist at the given positionsno extension
ReplaceTheseNumbersAt
Same as ReplaceTheseElementsAt: Replacing the occureences of the given elements in the matrix by the given new element, only they exist at the given positionsno extension
ReplaceElementByMany
Replacing all the occurrences of an element by the given new elementQCSXTZZZIBWU
ReplaceAllOccurrencesByMany
Same as ReplaceElementByMany: Replacing all the occurrences of an element by the given new elementno extension
ReplaceNumberByMany
Same as ReplaceElementByMany: Replacing all the occurrences of an element by the given new elementQCSXTZZZIBWU
ReplaceTheseElementsAtByMany
Replacing the occureences of the given elements in the matrix by the given new elements, only if they exist at the given positionsQCSXTZZZIBWU
ReplaceTheseNumbersAtByMany
Same as ReplaceTheseElementsAtByMany: Replacing the occureences of the given elements in the matrix by the given new elements, only if they exist at the given positionsQCSXTZZZIBWU
(no comment in the source: the name reads as a sentence) replace elements at 1 examples runin the section replacement by many elementsno extension
ReplaceElementsAtByMany
(no comment in the source: the name reads as a sentence) replace elements at by manyin the section replacement by many elementsQCSXTZZZIBWU
(no comment in the source: the name reads as a sentence) replace section 1 examples runin the section replacement by many elements
composed example
o1 = new stzMatrix([ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ] ])
o1.ReplaceSection([ 2, 3 ], [ 2, 3 ], TRUE)
? @@( o1.Content() )
#--> [ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 1, 9 ] ]
composed from the signature, run for this page
QCSXTZZZIBWU
ReplaceSectionByMany
(no comment in the source: the name reads as a sentence) replace section by manyin the section replacement by many elements
composed example
o1 = new stzMatrix([ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ] ])
o1.ReplaceSectionByMany([ 2, 3 ], [ 2, 3 ], [ 2, 3 ])
? @@( o1.Content() )
#--> [ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 2, 9 ] ]
composed from the signature, run for this page
QCSXTZZZIBWU
ReplaceElementsInSectionByMany
(no comment in the source: the name reads as a sentence) replace elements in section by manyin the section replacement by many elements
composed example
o1 = new stzMatrix([ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ] ])
o1.ReplaceElementsInSectionByMany([ 2, 3 ], [ 2, 3 ], [ 2, 3 ])
? @@( o1.Content() )
#--> [ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 2, 9 ] ]
composed from the signature, run for this page
no extension
ReplaceElementInSection
(no comment in the source: the name reads as a sentence) replace element in sectionin the section replacement by many elementsno extension
ReplaceThisElementInSection
(no comment in the source: the name reads as a sentence) replace this element in sectionin the section replacement by many elementsno extension
(no comment in the source: the name reads as a sentence) replace element in section by many 1 examples runin the section replacement by many elementsQCSXTZZZIBWU
ReplaceThisElementInSectionByMany
(no comment in the source: the name reads as a sentence) replace this element in section by manyin the section replacement by many elementsQCSXTZZZIBWU
ReplaceTheseElementsInSection
(no comment in the source: the name reads as a sentence) replace these elements in sectionin the section replacement by many elementsno extension
ReplaceTheseElementsInSectionByMany
(no comment in the source: the name reads as a sentence) replace these elements in section by manyin the section replacement by many elementsQCSXTZZZIBWU
Diagonal
Extracts diagonal elements
composed example
o1 = new stzMatrix([ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ] ])
? @@( o1.Diagonal() )
#--> [ 1, 5, 9 ]
composed from the signature, run for this page
no extension