DIRECTORY Rope USING [ROPE], Basics, IO USING [STREAM], AlgebraClasses; Matrices: CEDAR DEFINITIONS ~ BEGIN OPEN AC: AlgebraClasses; Matrix: TYPE = AC.Object; MatrixData: TYPE = RowSeq; RowSeq: TYPE = REF RowSeqRec; RowSeqRec: TYPE = RECORD[SEQUENCE rowsPlusOne: [1..1000] OF Row]; Row: TYPE = REF RowRec; RowRec: TYPE = RECORD[SEQUENCE columnsPlusOne: [1..1000] OF AC.Object]; matrixRingClass: AC.StructureClass; -- Class record for all matrix rings, i.e. matrices over a ring which is not a field. matrixAlgebraClass: AC.StructureClass; -- Class record for matrix algebras which are not division algebras MatrixStructureData: TYPE = REF MatrixStructureDataRec; MatrixStructureDataRec: TYPE = RECORD [ elementStructure: AC.Structure, size: NAT ]; MatrixOps: TYPE = REF MatrixOpsRec; -- prop key is $MatrixRing. MatrixOpsRec: TYPE = RECORD [ diagonalMatrix: AC.UnaryImbedOp, transpose: AC.UnaryOp, determinant: AC.StructuredToGroundOp _ NIL ]; MakeMatrixStructure: PROC [elementStructure: AC.Structure, size: NAT] RETURNS [matrixStructure: AC.Structure]; IsMatrixRing: PROC [structure: AC.Structure] RETURNS [BOOL]; DiagonalMatrix: PROC [structure: AC.Structure] RETURNS [AC.UnaryImbedOp]; Transpose: PROC [structure: AC.Structure] RETURNS [AC.UnaryOp]; Determinant: PROC [structure: AC.Structure] RETURNS [AC.StructuredToGroundOp]; DiagMatrix: AC.UnaryImbedOp; Read: AC.ReadOp; FromRope: AC.FromRopeOp; ToRope: AC.ToRopeOp; Write: AC.WriteOp; Add: AC.BinaryOp; Negate: AC.UnaryOp; Subtract: AC.BinaryOp; Multiply: AC.BinaryOp; Invert: AC.UnaryOp; Divide: AC.BinaryOp; ScalarMultiply: AC.BinaryOp; Equal: AC.EqualityOp; Transp: AC.UnaryOp; Det: AC.StructuredToGroundOp; END. τMatrices.mesa Last Edited by: Arnon, March 5, 1986 10:49:31 am PST Square matrices over a ring (yielding a ring) or a field (yielding an algebra). Matrix Representation Classes for Matrix Rings and Matrix Algebras Instance Data for Matrix Rings and Matrix Algebras Operations unique to Matrix Structures Matrix Ring and Matrix Algebra Constructors A particular matrix structure is defined by its elementStructure and its size. elementStructure can be a ring, field, algebra, or divisionAlgebra. Extract Matrix Operations from Class Property Lists Extract the transpose op from a $MatrixRing. Extract the determinant op from a $MatrixRing. Matrix Constructors Conversion and IO Arithmetic firstArg is scalar, secondArg is matrix Matrix Operations Κ¦˜Jšœ ™ J™4J˜šΟk ˜ Jšœœœ˜J˜Jšœœœ˜Jšœ˜—J˜JšœO™OJ˜head2šœ œ ˜J˜—Jšœœœœ˜!headšΟn™Jšœœœ˜J˜Jšœ œ ˜J˜Jšœœœ ˜Jš œ œœœœ˜AJ˜Jšœœœ˜Jš œœœœœœ ˜G—šœ,™,IcodešœœΟcU˜zM˜MšœœŸC˜k—šœ2™2Mšœœœ˜7šœœœ˜'Mšœœ ˜Mšœ˜ M˜——šœ&™&Mšœ œœŸ˜?šœœœ˜Mšœœ˜ Mšœ œ ˜Mšœ œ˜*M˜——šœ+™+š žœœœœœœ ˜nJšœ’™’——šœ3™3š ž œœ œ œœ˜