CogniPilot

MODELICA LIBRARY · ENGINEERING REFERENCE

function

Tests.Assertions.spdAccepted

Return one when an SPD solve is accepted, zero otherwise

Public declarations

Explicit source declarations; dimensions, modifications and defaults are shown as written, without evaluation.

RoleNameTypeDimensions / attributes / defaultDescription
inputAReal[:, size(A, 1)]
outputacceptedReal

Modelica declarations and implementation

Show parameters, interfaces and source

Parameters, inputs, outputs, defaults and equations from the source file.

function spdAccepted "Return one when an SPD solve is accepted, zero otherwise"
  input Real A[:, size(A, 1)];
  output Real accepted;
protected
  Real X[size(A, 1), 1];
  Boolean ok;
algorithm
  (X, ok) := LinearAlgebra.solveSPD(A, ones(size(A, 1), 1));
  accepted := if ok then 1.0 else 0.0;
end spdAccepted;