1 --/////////////////////////////////////////////////////////////////////////////
2 -- Copyright (c) 2000-2014 Ericsson Telecom AB
3 -- All rights reserved. This program and the accompanying materials
4 -- are made available under the terms of the Eclipse Public License v1.0
5 -- which accompanies this distribution, and is available at
6 -- http://www.eclipse.org/legal/epl-v10.html
7 --/////////////////////////////////////////////////////////////////////////////
8 ObjectClass DEFINITIONS
12 IMPORTS /* nothing */ ;
15 Matrix ::= SEQUENCE OF SEQUENCE OF INTEGER
41 invpimat Matrix ::= -- the adjugate of pimat
42 {{-467, -123, 79, 191},
44 { 326, 76, -52, -122},
47 matrixPair TwoMat ::= { left identity, right pimat }
50 -- object class definition
54 &ArgumentType OPTIONAL,
56 &Errors ERROR OPTIONAL,
57 &Linked OPERATION OPTIONAL,
58 &resultReturned BOOLEAN DEFAULT TRUE,
59 &operationCode PrintableString UNIQUE
64 &ParameterType OPTIONAL,
65 &errorCode INTEGER UNIQUE
72 -- object assignment, default syntax
75 invertMatrix OPERATION ::=
79 &Errors {determinantIsZero},
80 &operationCode "invert"
83 determinantIsZero ERROR ::=
88 addMatrices OPERATION ::=
92 &Errors {sizeMismatch},
96 subtractMatrices OPERATION ::=
100 &Errors {sizeMismatch},
101 &operationCode "subtract"
104 sizeMismatch ERROR ::=
112 MatrixOperations OPERATION ::=
117 -- | multiplyMatrices
123 op OPERATION.&operationCode ({MatrixOperations}),
124 arg OPERATION.&ArgumentType ({MatrixOperations} {@op}),
125 rez OPERATION.&ResultType ({MatrixOperations} {@op})
126 -- This is not how a real protocol would be put together
133 arg twoMat : { left zero, right pimat },
137 subtraction MatOp ::= {
139 arg twoMat : { left identity, right identity },
143 inversion MatOp ::= {
146 rez matrix : invpimat