|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jscience.mathematics.algebraic.AbstractHypermatrix
org.jscience.mathematics.algebraic.AbstractMatrix
org.jscience.mathematics.algebraic.AbstractVector
org.jscience.mathematics.algebraic.matrices.AbstractComplexVector
org.jscience.mathematics.algebraic.matrices.ComplexSparseVector
public class ComplexSparseVector
The ComplexSparseVector class encapsulates sparse vectors. Uses Morse-coding.
| Constructor Summary | |
|---|---|
ComplexSparseVector(AbstractComplexVector vec)
Constructs a vector by copying a vector. |
|
ComplexSparseVector(Complex[] array)
Constructs a vector from an array. |
|
ComplexSparseVector(int dim)
Constructs an empty vector. |
|
| Method Summary | |
|---|---|
AbelianGroup.Member |
add(AbelianGroup.Member v)
Returns the addition of this vector and another. |
AbstractComplexVector |
add(AbstractComplexVector v)
Returns the addition of this vector and another. |
ComplexSparseVector |
add(ComplexSparseVector v)
Returns the addition of this vector and another. |
ComplexVector |
add(ComplexVector v)
DOCUMENT ME! |
java.lang.Object |
clone()
Clone vector into a new vector. |
AbstractComplexVector |
conjugate()
DOCUMENT ME! |
boolean |
equals(java.lang.Object obj,
double tol)
Compares two vectors for equality. |
Complex |
getPrimitiveElement(int n)
Returns a component of this vector. |
AbstractDoubleVector |
imag()
DOCUMENT ME! |
double |
infNorm()
Returns the l -norm. |
AbstractComplexVector |
mapElements(ComplexMapping f)
Applies a function on all the vector components. |
AbelianGroup.Member |
negate()
Returns the negative of this vector. |
double |
norm()
Returns the l2-norm (magnitude). |
void |
normalize()
Makes the norm of this vector equal to 1. |
AbstractDoubleVector |
real()
DOCUMENT ME! |
AbstractComplexVector |
scalarDivide(Complex x)
Returns the division of this vector by a scalar. |
AbstractComplexVector |
scalarDivide(double x)
DOCUMENT ME! |
VectorSpace.Member |
scalarDivide(Field.Member x)
Returns the division of this vector by a scalar. |
AbstractComplexVector |
scalarMultiply(Complex x)
Returns the multiplication of this vector by a scalar. |
AbstractComplexVector |
scalarMultiply(double x)
DOCUMENT ME! |
Module.Member |
scalarMultiply(Ring.Member x)
Returns the multiplication of this vector by a scalar. |
Complex |
scalarProduct(AbstractComplexVector v)
Returns the scalar product of this vector and another. |
Complex |
scalarProduct(ComplexSparseVector v)
Returns the scalar product of this vector and another. |
Complex |
scalarProduct(ComplexVector v)
DOCUMENT ME! |
Complex |
scalarProduct(HilbertSpace.Member v)
DOCUMENT ME! |
void |
setAllElements(Complex r)
Sets the value of all elements of the vector. |
void |
setElement(int n,
Complex x)
Sets the value of a component of this vector. |
void |
setElement(int n,
double x,
double y)
DOCUMENT ME! |
AbelianGroup.Member |
subtract(AbelianGroup.Member v)
Returns the subtraction of this vector by another. |
AbstractComplexVector |
subtract(AbstractComplexVector v)
Returns the subtraction of this vector by another. |
ComplexSparseVector |
subtract(ComplexSparseVector v)
Returns the subtraction of this vector by another. |
ComplexVector |
subtract(ComplexVector v)
DOCUMENT ME! |
ComplexSparseMatrix |
tensorProduct(ComplexSparseVector v)
Returns the tensor product of this vector and another. |
Complex[] |
toPrimitiveArray()
Projects the vector to an array. |
| Methods inherited from class org.jscience.mathematics.algebraic.matrices.AbstractComplexVector |
|---|
abs, equals, getColumn, getElement, getImagElement, getRealElement, getRow, getSubVector, hashCode, mass, multiply, read, reverse, setColumn, setRow, setSubVector, tensorProduct, toMatrix, toString, transpose |
| Methods inherited from class org.jscience.mathematics.algebraic.AbstractVector |
|---|
getDimension, getElement, getInvalidElementMsg, toArray, toArray |
| Methods inherited from class org.jscience.mathematics.algebraic.AbstractMatrix |
|---|
getElement, getInvalidElementMsg, numColumns, numRows, print, print, print, print, toArray |
| Methods inherited from class org.jscience.mathematics.algebraic.AbstractHypermatrix |
|---|
getDimensions, numDimensions, numElements, numElements, toArray |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.jscience.mathematics.algebraic.Matrix |
|---|
numColumns, numRows, toArray |
| Methods inherited from interface org.jscience.mathematics.algebraic.Hypermatrix |
|---|
getDimensions, getElement, numDimensions, numElements, numElements, toArray |
| Constructor Detail |
|---|
public ComplexSparseVector(int dim)
dim - the dimension of the vector.public ComplexSparseVector(Complex[] array)
array - DOCUMENT ME!public ComplexSparseVector(AbstractComplexVector vec)
vec - an assigned value| Method Detail |
|---|
public AbstractDoubleVector real()
real in class AbstractComplexVectorpublic AbstractDoubleVector imag()
imag in class AbstractComplexVector
public boolean equals(java.lang.Object obj,
double tol)
equals in class AbstractComplexVectorobj - a complex sparse vectortol - DOCUMENT ME!
public Complex getPrimitiveElement(int n)
getPrimitiveElement in class AbstractComplexVectorn - index of the vector component
IllegalDimensionException - If attempting to access an invalid
component.
public void setElement(int n,
Complex x)
setElement in class AbstractComplexVectorn - index of the vector componentx - a number
IllegalDimensionException - If attempting to access an invalid
component.
public void setElement(int n,
double x,
double y)
setElement in class AbstractComplexVectorn - DOCUMENT ME!x - DOCUMENT ME!y - DOCUMENT ME!public void setAllElements(Complex r)
setAllElements in class AbstractComplexVectorr - a ring elementpublic double norm()
norm in interface BanachSpace.Membernorm in class AbstractComplexVectorjava.lang.ArithmeticException - DOCUMENT ME!public void normalize()
normalize in class AbstractComplexVectorpublic double infNorm()
-norm.
infNorm in class AbstractComplexVectorjava.lang.ArithmeticException - DOCUMENT ME!public AbstractComplexVector conjugate()
conjugate in class AbstractComplexVectorpublic AbelianGroup.Member negate()
negate in interface AbelianGroup.Memberpublic AbelianGroup.Member add(AbelianGroup.Member v)
add in interface AbelianGroup.Memberv - DOCUMENT ME!
java.lang.IllegalArgumentException - DOCUMENT ME!public AbstractComplexVector add(AbstractComplexVector v)
add in class AbstractComplexVectorv - a complex vector
IllegalDimensionException - If the vectors are different sizes.public ComplexVector add(ComplexVector v)
v - DOCUMENT ME!
IllegalDimensionException - DOCUMENT ME!public ComplexSparseVector add(ComplexSparseVector v)
v - a complex sparse vector
IllegalDimensionException - If the vectors are different sizes.public AbelianGroup.Member subtract(AbelianGroup.Member v)
subtract in interface AbelianGroup.Memberv - DOCUMENT ME!
java.lang.IllegalArgumentException - DOCUMENT ME!public AbstractComplexVector subtract(AbstractComplexVector v)
subtract in class AbstractComplexVectorv - a complex vector
IllegalDimensionException - If the vectors are different sizes.public ComplexVector subtract(ComplexVector v)
v - DOCUMENT ME!
IllegalDimensionException - DOCUMENT ME!public ComplexSparseVector subtract(ComplexSparseVector v)
v - a complex sparse vector
IllegalDimensionException - If the vectors are different sizes.public Module.Member scalarMultiply(Ring.Member x)
scalarMultiply in interface Module.Memberx - DOCUMENT ME!
java.lang.IllegalArgumentException - DOCUMENT ME!public AbstractComplexVector scalarMultiply(Complex x)
scalarMultiply in class AbstractComplexVectorx - a complex
public AbstractComplexVector scalarMultiply(double x)
scalarMultiply in class AbstractComplexVectorx - DOCUMENT ME!
public VectorSpace.Member scalarDivide(Field.Member x)
scalarDivide in interface VectorSpace.Memberx - DOCUMENT ME!
java.lang.IllegalArgumentException - DOCUMENT ME!public AbstractComplexVector scalarDivide(Complex x)
scalarDivide in class AbstractComplexVectorx - a complex
public AbstractComplexVector scalarDivide(double x)
scalarDivide in class AbstractComplexVectorx - DOCUMENT ME!
public Complex scalarProduct(HilbertSpace.Member v)
scalarProduct in interface HilbertSpace.Memberv - DOCUMENT ME!
java.lang.IllegalArgumentException - DOCUMENT ME!public Complex scalarProduct(AbstractComplexVector v)
scalarProduct in class AbstractComplexVectorv - a complex vector
IllegalDimensionException - If the vectors are different sizes.public Complex scalarProduct(ComplexVector v)
v - DOCUMENT ME!
IllegalDimensionException - DOCUMENT ME!public Complex scalarProduct(ComplexSparseVector v)
v - a complex sparse vector
IllegalDimensionException - If the vectors are different sizes.public ComplexSparseMatrix tensorProduct(ComplexSparseVector v)
v - DOCUMENT ME!
public AbstractComplexVector mapElements(ComplexMapping f)
mapElements in class AbstractComplexVectorf - a user-defined function
public Complex[] toPrimitiveArray()
toPrimitiveArray in class AbstractComplexVectorpublic java.lang.Object clone()
clone in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||