DIRECTORY Rope, IO, AlgebraClasses; Vectors: CEDAR DEFINITIONS ~ BEGIN OPEN Rope, AC: AlgebraClasses; Vector: TYPE = AC.Object; VectorData: TYPE = REF VectorDataRec; VectorDataRec: TYPE = RECORD [ SEQUENCE dimensionPlus1:[1..65534] OF AC.Object ]; VectorStructureData: TYPE = REF VectorStructureDataRec; VectorStructureDataRec: TYPE = RECORD [ row: BOOL _ TRUE, coordinateStructure: AC.Object, dimension: NAT ]; MakeVectorStructure: AC.VectorStructureConstructor; PrintName: AC.ToRopeOp; ShortPrintName: AC.ToRopeOp; CoordinateStructure: AC.UnaryOp; Dimension: AC.StructureRankOp; IsVectorStructure: AC.UnaryPredicate; Characteristic: AC.StructureRankOp; Recast: AC.BinaryOp; CanRecast: AC.BinaryPredicate; ToExpr: AC.ToExprOp; LegalFirstChar: AC.LegalFirstCharOp; Read: AC.ReadOp; FromRope: AC.FromRopeOp; ToRope: AC.ToRopeOp; Write: AC.WriteOp; ImbedScalar: AC.UnaryImbedOp; MakeVector: AC.ListImbedOp; Coordinate: AC.BinaryOp; Zero: AC.NullaryOp; One: AC.NullaryOp; Add: AC.BinaryOp; Negate: AC.UnaryOp; Subtract: AC.BinaryOp; ScalarMultiply: AC.BinaryOp; ComponentWiseMultiply: AC.BinaryOp; ComponentWisePower: AC.BinaryOp; ComponentWiseInvert: AC.UnaryOp; ComponentWiseDivide: AC.BinaryOp; Equal: AC.BinaryPredicate; MapUnaryElementOp: AC.BinaryMixedOp; MapBinaryElementOp: AC.TernaryMixedOp; END. 4Vectors.mesa Last Edited by: Arnon, May 3, 1986 3:53:47 pm PDT External direct product constructor on some baseStructure. baseStructure is arbitrary; whatever operations are available in it are available in the product structure as component-wise operations. Elements of the baseStructure are "scalars". If baseStructure is a ring or field, the vector structure is a finite-dimensional vector space over a field, or finite-dimensional module over a ring. Vector Representation An empty vector is represented with non-NIL data field consisting of a VectorDataRec of length 0. Instance Data for Vector Structures Vector Structure Ops Characteristic of coordinateStructure Conversion and IO Constructors The scalar a becomes the vector Attempts to recast supplied elements into coordinateStructure. If data = NIL then returns an empty vector. Selection firstArg is a Vector, secondArg is an Ints.Int specifying position to select. Returns NIL if can't do. Arithmetic firstArg is scalar, secondArg is matrix Comparison Other Operations firstArg is a Vector, secondArg is a unary Method (e.g. UnaryOp, UnaryPredicate) on its coordinateStructure, result is Vector of results of applications of the unary operation to the elements of firstArg. firstArg and secondArg are Vectors over the same coordinateStructure, and of the same length. thirdArg is a binary Method (e.g. BinaryOp, BinaryPredicate) on coordinateStructure. The result is a Vector of the results of the application of the binary operation to corresponding pairs of elements of firstArg and secondArg. ΚΗ˜Jšœ ™ J™1J˜J˜Jšœ:™:J™Jšœ·™·J™Jšœ–™–J™J™šΟk ˜ Icodešœ˜Kšœ˜Kšœ˜—Ihead2šΟnœœ ˜Jšœœœœ˜'headšž™Jšœœœ˜J˜Jšœ œœ˜%J˜šœœœ˜Jšœœœ˜/Jšœ˜—J˜Jšœa™a—šœ#™#Kšœœœ˜7šœœœ˜'Jšœœœ˜Kšœœ˜Kšœ ˜K˜——šœ™šžœœ˜3K˜—šž œœ ˜K˜—šžœœ ˜K˜—šžœœ ˜ K˜—šž œœ˜J˜—šžœœ˜%J˜—šžœœ˜#Jšœ%™%——šœ™šžœœ ˜J˜—šž œœ˜J˜—šžœœ ˜J˜—šžœœ˜$J˜—šžœœ˜J˜—šžœœ ˜J˜—šžœœ ˜J˜—Jšžœ ˜—šœ ™ šž œœ˜J™,J˜—šž œœ ˜Jšœ>™>Jšœ+™+——šž ™ šž œœ ˜Kšœg™g——šœ ™ šžœœ ˜J˜—šžœœ ˜J˜—šžœœ ˜J˜—šžœœ ˜J˜—šžœœ ˜J˜—šžœœ ˜J™(J™—šžœœ ˜#J˜—šžœœ ˜ J˜—šžœœ ˜ J˜—Jšžœœ ˜!—šž ™ Jšžœœ˜—šž™šžœœ˜$Kšœ8žœžœ}™ΜK™—šžœœ˜&Kšœ€žœžœ¨™Α——J˜Jšœ˜—…—61