Class Basis
- java.lang.Object
-
- dev.nm.algebra.linear.matrix.doubles.matrixtype.sparse.SparseVector
-
- dev.nm.algebra.linear.vector.doubles.operation.Basis
-
- 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:
- Wikipedia: Basis (linear algebra)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class dev.nm.algebra.linear.matrix.doubles.matrixtype.sparse.SparseVector
SparseVector.Entry, SparseVector.Iterator
-
-
Constructor Summary
Constructors Constructor Description Basis(int dim, int i)
Construct a vector that corresponds to the i-th dimension in Rn.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static List<Vector>
getBasis(int dim)
Get the full set of the standard basis vectors.static List<Vector>
getBasis(int dim, int nCols)
Get a subset of the standard basis vectors.-
Methods inherited from class dev.nm.algebra.linear.matrix.doubles.matrixtype.sparse.SparseVector
add, add, add, angle, deepCopy, divide, equals, get, hashCode, innerProduct, innerProduct, iterator, leftMultiply, minus, minus, minus, multiply, multiply, nNonZeros, norm, norm, opposite, pow, scaled, scaled, set, size, toArray, toString, ZERO
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
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 dimensionnCols
- the number of basis vectors requested; it must be smaller thandim
- Returns:
- the basis vectors
- Throws:
IllegalArgumentException
- if there are more columns requested than the dimension
-
-