All Implemented Interfaces:
SparseStructure, Vector, AbelianGroup<Vector>, BanachSpace<Vector,Real>, HilbertSpace<Vector,Real>, VectorSpace<Vector,Real>, DeepCopyable, Iterable<SparseVector.Entry>

public class Basis extends SparseVector
A basis is a set of linearly independent vectors spanning a vector space. Every element in this space can be uniquely represented by a linear combination of elements in the basis. This implementation is the standard basis of the Euclidean Rn space.
See Also:
  • Constructor Details

    • Basis

      public Basis(int dim, int i)
      Construct a vector that corresponds to the i-th dimension in Rn. That is (a 1 in the i-th entry), \[ \begin{bmatrix} 0\\ ...\\ 1\\ ...\\ 0 \end{bmatrix} \]
      Parameters:
      dim - the dimension
      i - the i-th dimension in Rn
  • Method Details

    • getBasis

      public static List<Vector> getBasis(int dim)
      Get the full set of the standard basis vectors.
      Parameters:
      dim - the dimension
      Returns:
      the basis vectors
    • getBasis

      public static List<Vector> getBasis(int dim, int nCols)
      Get a subset of the standard basis vectors.
      Parameters:
      dim - the dimension
      nCols - the number of basis vectors requested; it must be smaller than dim
      Returns:
      the basis vectors
      Throws:
      IllegalArgumentException - if there are more columns requested than the dimension