linalg::basis
-- basis for a
vector spacelinalg::basis
(S)
returns a basis for the
vector space spanned by the vectors in the set or list
S.
linalg::basis(S)
S |
- | a set or list of n-dimensional vectors; a
vector is a n x 1 or 1 x n matrix of a domain of
category Cat::Matrix |
a set or a list of vectors, respectively.
linalg::intBasis
,
linalg::sumBasis
,
lllint
linalg::basis
(S)
removes those vectors in
S
that are linearly dependent on other vectors in
S
. The result is a basis for the vector space spanned by
the vectors in S
.S
should be a list of
vectors.S
must be defined over the same
component ring.S
must be a
field, i.e., it must be of category Cat::Field
.We define the domain of matrices over Q:
>> MatQ := Dom::Matrix(Dom::Rational):
and compute a basis for the vector space spanned by the vectors [3,-2], [1,0] and [5,-3]:
>> v1 := MatQ([3, -2]): v2 := MatQ([1, 0]): v3 := MatQ([5, -3]): linalg::basis([v1, v2, v3])
-- +- -+ +- -+ -- | | 3 | | 1 | | | | |, | | | | | -2 | | 0 | | -- +- -+ +- -+ --
If not a list but a set of vectors is given, then the
basis returned contains the same vectors. But the order of the vectors
in the set depends on the internal order (see sysorder
and DOM_SET
), i.e., the order of the
vectors appears to be random:
>> b := linalg::basis({v1, v2, v3}): op(b, 1)
+- -+ | 1 | | | | 0 | +- -+