linalg4vec
http://www.openmath.org/cd/linalg4vec.ocd
2005-01-01
experimental
2004-11-22
2
1
A CD for the quick construction of some vectors.
November 2004: A.M. Cohen built this CD from a former experimental CD called
linalg7 (version 1, revision 0). The descriptions have been edited and the
example in the definition of the symbol sparse has been improved.
zero
application
This symbol represents a function with one argument, which should be a natural
number n.
When applied to n, it represents the zero vector of size n
(in the terminology of linalg3; dimension n in some terminology).
If M is an n*m matrix and V is a zero vector of length m then
V*M = V2 where V2 is a zero vector of length n
If M is an n*m matrix and V is a zero vector of length n then
M*V = V2 where V2 is a zero vector of length m
If V is a zero vector of length n and V2 is a vector of length n
then
V+V2 = V2+V = V2
If V is a zero vector of length n and i is in the integral interval
[1,n] then
V.i = 0
constant
This symbol represents a binary function whose first argument should be a
natural number. When applied to n and c, it represents
the constant (row) vector (so vector as defined in linalg2), so size (dimension) n all of whose components have the
value c.
If V is a constant vector of length n, with constant value c
and i is in the integral interval [1,n] then
V.i = c
sparse
application
The sparse symbol is a constructor for sparse vectors. It is (n+1)-ary,
where the first argument is the length (dimension) of the vector, and
every following argument specifies a possibly non-zero element in the
following way. The argument is a list which should have length two.
The first element in the list is the position (one based), whilst the second
element in the list is the value. Every other element of the vector is
implicitly zero.
This example shows a representation of the sparse vector
$$[0,0,0,0,1]$$
5
5 1