VectorCategory(R)
vector.spad line 35
[edit on github]
VectorCategory represents the type of vector like objects, i.e. finite sequences indexed by some finite segment of the integers. The operations available on vectors depend on the structure of the underlying components. Many operations from the component domain are defined for vectors componentwise. It can by assumed that extraction or updating components can be done in constant time.
- # : % -> NonNegativeInteger
- from Aggregate
- * : (%, R) -> % if R has SemiGroup
y * r
multiplies each component of the vector y
by the element r
.
- * : (R, %) -> % if R has SemiGroup
r * y
multiplies the element r
times each component of the vector y
.
- * : (Integer, %) -> % if R has AbelianGroup
n * y
multiplies each component of the vector y
by the integer n
.
- + : (%, %) -> % if R has AbelianSemiGroup
x + y
returns the component-wise sum of the vectors x
and y
. Error: if x
and y
are not of the same length.
- - : % -> % if R has AbelianGroup
-x
negates all components of the vector x
.
- - : (%, %) -> % if R has AbelianGroup
x - y
returns the component-wise difference of the vectors x
and y
. Error: if x
and y
are not of the same length.
- < : (%, %) -> Boolean if R has OrderedSet
- from PartialOrder
- <= : (%, %) -> Boolean if R has OrderedSet
- from PartialOrder
- = : (%, %) -> Boolean if R has BasicType
- from BasicType
- > : (%, %) -> Boolean if R has OrderedSet
- from PartialOrder
- >= : (%, %) -> Boolean if R has OrderedSet
- from PartialOrder
- any? : (Mapping(Boolean, R), %) -> Boolean
- from HomogeneousAggregate(R)
- coerce : % -> OutputForm if R has CoercibleTo(OutputForm)
- from CoercibleTo(OutputForm)
- concat : (%, %) -> %
- from LinearAggregate(R)
- concat : (%, R) -> %
- from LinearAggregate(R)
- concat : (R, %) -> %
- from LinearAggregate(R)
- concat : List(%) -> %
- from LinearAggregate(R)
- construct : List(R) -> %
- from Collection(R)
- convert : % -> InputForm if R has ConvertibleTo(InputForm)
- from ConvertibleTo(InputForm)
- copy : % -> %
- from Aggregate
- copyInto! : (%, %, Integer) -> %
- from LinearAggregate(R)
- count : (R, %) -> NonNegativeInteger if R has BasicType
- from HomogeneousAggregate(R)
- count : (Mapping(Boolean, R), %) -> NonNegativeInteger
- from HomogeneousAggregate(R)
- cross : (%, %) -> % if R has Ring
cross(u, v)
constructs the cross product of u
and v
. Error: if u
and v
are not of length 3.
- delete : (%, Integer) -> %
- from LinearAggregate(R)
- delete : (%, UniversalSegment(Integer)) -> %
- from LinearAggregate(R)
- dot : (%, %) -> R if R has AbelianMonoid and R has SemiRng
dot(x, y)
computes the inner product of the two vectors x
and y
. Error: if x
and y
are not of the same length.
- elt : (%, UniversalSegment(Integer)) -> %
- from Eltable(UniversalSegment(Integer), %)
- elt : (%, Integer) -> R
- from Eltable(Integer, R)
- elt : (%, Integer, R) -> R
- from EltableAggregate(Integer, R)
- empty : () -> %
- from Aggregate
- empty? : % -> Boolean
- from Aggregate
- entries : % -> List(R)
- from IndexedAggregate(Integer, R)
- entry? : (R, %) -> Boolean if R has BasicType
- from IndexedAggregate(Integer, R)
- eq? : (%, %) -> Boolean
- from Aggregate
- eval : (%, R, R) -> % if R has Evalable(R) and R has SetCategory
- from InnerEvalable(R, R)
- eval : (%, Equation(R)) -> % if R has Evalable(R) and R has SetCategory
- from Evalable(R)
- eval : (%, List(R), List(R)) -> % if R has Evalable(R) and R has SetCategory
- from InnerEvalable(R, R)
- eval : (%, List(Equation(R))) -> % if R has Evalable(R) and R has SetCategory
- from Evalable(R)
- every? : (Mapping(Boolean, R), %) -> Boolean
- from HomogeneousAggregate(R)
- fill! : (%, R) -> %
- from IndexedAggregate(Integer, R)
- find : (Mapping(Boolean, R), %) -> Union(R, "failed")
- from Collection(R)
- first : (%, NonNegativeInteger) -> %
- from LinearAggregate(R)
- first : % -> R
- from IndexedAggregate(Integer, R)
- hash : % -> SingleInteger if R has Hashable
- from Hashable
- hashUpdate! : (HashState, %) -> HashState if R has Hashable
- from Hashable
- index? : (Integer, %) -> Boolean
- from IndexedAggregate(Integer, R)
- indices : % -> List(Integer)
- from IndexedAggregate(Integer, R)
- insert : (%, %, Integer) -> %
- from LinearAggregate(R)
- insert : (R, %, Integer) -> %
- from LinearAggregate(R)
- latex : % -> String if R has SetCategory
- from SetCategory
- leftTrim : (%, R) -> % if R has BasicType
- from LinearAggregate(R)
- length : % -> R if R has RadicalCategory and R has Ring
length(v)
computes the sqrt(dot(v
, v
)), i.e. the euclidean length
- less? : (%, NonNegativeInteger) -> Boolean
- from Aggregate
- map : (Mapping(R, R), %) -> %
- from HomogeneousAggregate(R)
- map : (Mapping(R, R, R), %, %) -> %
- from LinearAggregate(R)
- map! : (Mapping(R, R), %) -> %
- from HomogeneousAggregate(R)
- max : (%, %) -> % if R has OrderedSet
- from OrderedSet
- max : % -> R if R has OrderedSet
- from HomogeneousAggregate(R)
- max : (Mapping(Boolean, R, R), %) -> R
- from HomogeneousAggregate(R)
- maxIndex : % -> Integer
- from IndexedAggregate(Integer, R)
- member? : (R, %) -> Boolean if R has BasicType
- from HomogeneousAggregate(R)
- members : % -> List(R)
- from HomogeneousAggregate(R)
- merge : (%, %) -> % if R has OrderedSet
- from LinearAggregate(R)
- merge : (Mapping(Boolean, R, R), %, %) -> %
- from LinearAggregate(R)
- min : (%, %) -> % if R has OrderedSet
- from OrderedSet
- min : % -> R if R has OrderedSet
- from HomogeneousAggregate(R)
- minIndex : % -> Integer
- from IndexedAggregate(Integer, R)
- more? : (%, NonNegativeInteger) -> Boolean
- from Aggregate
- new : (NonNegativeInteger, R) -> %
- from LinearAggregate(R)
- outerProduct : (%, %) -> Matrix(R) if R has Ring
outerProduct(u, v)
constructs the matrix whose (i
, j
)'
th element is u
(i
)*v
(j
).
- parts : % -> List(R)
- from HomogeneousAggregate(R)
- position : (R, %) -> Integer if R has BasicType
- from LinearAggregate(R)
- position : (R, %, Integer) -> Integer if R has BasicType
- from LinearAggregate(R)
- position : (Mapping(Boolean, R), %) -> Integer
- from LinearAggregate(R)
- qelt : (%, Integer) -> R
- from EltableAggregate(Integer, R)
- qsetelt! : (%, Integer, R) -> R
- from EltableAggregate(Integer, R)
- reduce : (Mapping(R, R, R), %) -> R
- from Collection(R)
- reduce : (Mapping(R, R, R), %, R) -> R
- from Collection(R)
- reduce : (Mapping(R, R, R), %, R, R) -> R if R has BasicType
- from Collection(R)
- remove : (R, %) -> % if R has BasicType
- from Collection(R)
- remove : (Mapping(Boolean, R), %) -> %
- from Collection(R)
- removeDuplicates : % -> % if R has BasicType
- from Collection(R)
- reverse : % -> %
- from LinearAggregate(R)
- reverse! : % -> %
- from LinearAggregate(R)
- rightTrim : (%, R) -> % if R has BasicType
- from LinearAggregate(R)
- sample : () -> %
- from Aggregate
- select : (Mapping(Boolean, R), %) -> %
- from Collection(R)
- setelt! : (%, Integer, R) -> R
- from EltableAggregate(Integer, R)
- setelt! : (%, UniversalSegment(Integer), R) -> R
- from LinearAggregate(R)
- size? : (%, NonNegativeInteger) -> Boolean
- from Aggregate
- smaller? : (%, %) -> Boolean if R has Comparable
- from Comparable
- sort : % -> % if R has OrderedSet
- from LinearAggregate(R)
- sort : (Mapping(Boolean, R, R), %) -> %
- from LinearAggregate(R)
- sort! : % -> % if R has OrderedSet
- from LinearAggregate(R)
- sort! : (Mapping(Boolean, R, R), %) -> %
- from LinearAggregate(R)
- sorted? : % -> Boolean if R has OrderedSet
- from LinearAggregate(R)
- sorted? : (Mapping(Boolean, R, R), %) -> Boolean
- from LinearAggregate(R)
- swap! : (%, Integer, Integer) -> Void
- from IndexedAggregate(Integer, R)
- trim : (%, R) -> % if R has BasicType
- from LinearAggregate(R)
- zero : NonNegativeInteger -> % if R has AbelianMonoid
zero(n)
creates a zero vector of length n
.
- zero? : % -> Boolean if R has AbelianMonoid
zero?(x)
returns true
if x
is a zero vector, false
otherwise.
- ~= : (%, %) -> Boolean if R has BasicType
- from BasicType
Comparable
ConvertibleTo(InputForm)
shallowlyMutable
Aggregate
BasicType
LinearAggregate(R)
HomogeneousAggregate(R)
OrderedSet
SetCategory
EltableAggregate(Integer, R)
InnerEvalable(R, R)
OneDimensionalArrayAggregate(R)
PartialOrder
CoercibleTo(OutputForm)
FiniteLinearAggregate(R)
IndexedAggregate(Integer, R)
Hashable
finiteAggregate
Eltable(UniversalSegment(Integer), %)
Evalable(R)
Collection(R)
Eltable(Integer, R)