Package sage :: Package linalg :: Module vector_space :: Class VectorSpace_generic
[show private | hide private]
[frames | no frames]

Type VectorSpace_generic

       Gens --+
              |
 object --+   |
          |   |
VectorSpace --+
              |
             VectorSpace_generic

Known Subclasses:
VectorSpace_ambient, VectorSpace_subspace

Method Summary
  __init__(self, base_field, degree, sparse)
Create the space of all vectors of given degree over base_field.
  __add__(self, other)
  __call__(self, entries, coerce_entries, copy, check_element)
  __cmp__(self, right)
  __contains__(self, x)
  __repr__(self)
  ambient_space(self)
  base_field(self)
  base_ring(self)
  basis(self)
  coordinates(self, v)
Write v in terms of the basis for self.
  degree(self)
  dimension(self)
  echelonized_basis(self)
  gen(self, n)
  is_ambient(self)
  is_dense(self)
  is_full(self)
  is_sparse(self)
  matrix(self)
  ngens(self)
  random(self, X, prob, coerce)
Returns a random element of self.
  random_element(self, X, prob, coerce)
Returns a random element of self.
  subspace(self, gens)
Create a subspace of self.
  subspace_with_basis(self, basis)
Create a subspace of self with given basis.
  vector(self, x, coerce_entries, copy, check_element)
  vector_space(self, degree)
  zero_vector(self)
    Inherited from VectorSpace
  __new__(cls, *args, **kwds)
(Static method)
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
x.__hash__() <==> hash(x)
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
x.__str__() <==> str(x)
    Inherited from Gens
  __getattr__(self, attrname)
  __getitem__(self, n)
  __getslice__(self, n, m)
  gens(self)
  list(self)

Instance Method Details

__init__(self, base_field, degree, sparse=False)
(Constructor)

Create the space of all vectors of given degree over base_field.
INPUT:
    base_field -- a field
    degree -- int >= 0, the degree of the vector space 
              (number of components of vectors).
    sparse -- whether or not matrices are given a sparse representation 
              (default to False)
Overrides:
sage.linalg.vector_space.VectorSpace.__init__

coordinates(self, v)

Write v in terms of the basis for self.

Returns a list c such that if B is the basis for self, then 
        sum c[i] B[i] = v
If v is not in self, raises an ArithmeticError exception.

random(self, X=[-2, -1, 1, 2], prob=1.0, coerce=True)

Returns a random element of self.

random_element(self, X=[-2, -1, 1, 2], prob=1.0, coerce=True)

Returns a random element of self.

subspace(self, gens)

Create a subspace of self.

INPUT:
    gens -- a list of vector in self
OUTPUT:
    VectorSpace -- the subspace spanned by the vectors in the list gens.
    The basis for the subspace is always put in reduced row echelon form.
EXAMPLES:
    >>> import sage.rings.rings as rings
    >>> V = VectorSpace(rings.RationalField(), 3)
    >>> B = V.basis()
    >>> W = V.subspace([B[0]+B[1], 2*B[1]-B[2]])
    >>> W
    Vector space of degree 3, dimension 2 over Rational Field
    Basis matrix:
    [   1    0  1/2]
    [   0    1 -1/2]

subspace_with_basis(self, basis)

Create a subspace of self with given basis.

INPUT:
    basis -- a list of linearly independent vectors

OUTPUT:
    VectorSpace_subspace_with_basis -- the subspace with given basis.
    The basis for the subspace is always put in reduced row echelon form.
EXAMPLES:
    >>> import sage.rings.rings as rings
    >>> V = VectorSpace(rings.RationalField(), 3)
    >>> B = V.basis()
    >>> W = V.subspace_with_basis([B[0]+B[1], 2*B[1]-B[2]])
    >>> W
    Vector space of degree 3, dimension 2 over Rational Field
    User basis matrix:
    [ 1  1  0]
    [ 0  2 -1]

Generated by Epydoc 2.1 on Mon Jun 20 15:43:20 2005 http://epydoc.sf.net