function
Tests.Assertions.maxAbsMatrix
Maximum absolute element of a matrix
Public declarations
Explicit source declarations; dimensions, modifications and defaults are shown as written, without evaluation.
| Role | Name | Type | Dimensions / attributes / default | Description |
|---|---|---|---|---|
| input | values | Real | [:, :] | |
| output | result | Real | |
Modelica declarations and implementation
Show parameters, interfaces and source
Parameters, inputs, outputs, defaults and equations from the source file.
function maxAbsMatrix "Maximum absolute element of a matrix"
input Real values[:, :];
output Real result;
algorithm
result := 0.0;
for row in 1:size(values, 1) loop
for column in 1:size(values, 2) loop
result := max(result, abs(values[row, column]));
end for;
end for;
end maxAbsMatrix;