public class ComplexVector extends MathVector implements HilbertSpace.Member
| Modifier and Type | Field and Description |
|---|---|
protected static int |
ARRAY_1D
Storage format identifier.
|
protected double[] |
vectorIm
Arrays containing the components of the vector.
|
protected double[] |
vectorRe
Arrays containing the components of the vector.
|
CLASS_SPECIFIC, N, storageFormat| Modifier | Constructor and Description |
|---|---|
|
ComplexVector(Complex[] array)
Constructs a vector from an array.
|
|
ComplexVector(double[] real,
double[] imag)
Constructs a vector by wrapping two arrays.
|
|
ComplexVector(int dim)
Constructs an empty vector.
|
protected |
ComplexVector(int dim,
int storeID) |
| Modifier and Type | Method and Description |
|---|---|
AbelianGroup.Member |
add(AbelianGroup.Member v)
Returns the addition of this vector and another.
|
ComplexVector |
add(ComplexVector v)
Returns the addition of this vector and another.
|
ComplexVector |
add(DoubleVector v)
Returns the addition of this vector and another.
|
ComplexVector |
add(IntegerVector v)
Returns the addition of this vector and another.
|
ComplexVector |
conjugate()
Returns the complex conjugate of this vector.
|
boolean |
equals(java.lang.Object a)
Compares two complex vectors for equality.
|
Complex |
getComponent(int n)
Returns a component of this vector.
|
int |
hashCode()
Returns a hashcode for this vector.
|
DoubleVector |
imag()
Returns the imaginary part of this complex vector.
|
double |
infNorm()
Returns the l
-norm. |
ComplexVector |
mapComponents(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.
|
DoubleVector |
real()
Returns the real part of this complex vector.
|
ComplexVector |
scalarDivide(Complex z)
Returns the division of this vector by a scalar.
|
ComplexVector |
scalarDivide(double x)
Returns the division of this vector by a scalar.
|
VectorSpace.Member |
scalarDivide(Field.Member x)
Returns the division of this vector by a scalar.
|
ComplexVector |
scalarMultiply(Complex z)
Returns the multiplication of this vector by a scalar.
|
ComplexVector |
scalarMultiply(double x)
Returns the multiplication of this vector by a scalar.
|
Module.Member |
scalarMultiply(Ring.Member x)
Returns the multiplication of this vector by a scalar.
|
Complex |
scalarProduct(ComplexVector v)
Returns the scalar product of this vector and another.
|
Complex |
scalarProduct(HilbertSpace.Member v)
Returns the scalar product of this vector and another.
|
void |
setComponent(int n,
Complex z)
Sets the value of a component of this vector.
|
void |
setComponent(int n,
double x,
double y)
Sets the value of a component of this vector.
|
AbelianGroup.Member |
subtract(AbelianGroup.Member v)
Returns the subtraction of this vector by another.
|
ComplexVector |
subtract(ComplexVector v)
Returns the subtraction of this vector by another.
|
ComplexVector |
subtract(DoubleVector v)
Returns the subtraction of this vector by another.
|
ComplexVector |
subtract(IntegerVector v)
Returns the subtraction of this vector by another.
|
java.lang.String |
toString()
Returns a comma delimited string representing the value of this vector.
|
dimension, getInvalidComponentMsgprotected static final int ARRAY_1D
protected double[] vectorRe
protected double[] vectorIm
protected ComplexVector(int dim,
int storeID)
public ComplexVector(int dim)
dim - the dimension of the vector.public ComplexVector(double[] real,
double[] imag)
real - an array of real valuesimag - an array of imaginary valuespublic ComplexVector(Complex[] array)
array - an assigned valuepublic boolean equals(java.lang.Object a)
equals in class java.lang.Objecta - a complex vectorpublic java.lang.String toString()
toString in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic DoubleVector real()
public DoubleVector imag()
public Complex getComponent(int n)
n - index of the vector componentVectorDimensionException - If attempting to access an invalid component.public void setComponent(int n,
Complex z)
n - index of the vector componentz - a complex numberVectorDimensionException - If attempting to access an invalid component.public void setComponent(int n,
double x,
double y)
n - index of the vector componentx - the real part of a complex numbery - the imaginary part of a complex numberVectorDimensionException - If attempting to access an invalid component.public double norm()
norm in interface BanachSpace.Membernorm in class MathVectorpublic void normalize()
public double infNorm()
-norm.public AbelianGroup.Member negate()
negate in interface AbelianGroup.Memberpublic ComplexVector conjugate()
public AbelianGroup.Member add(AbelianGroup.Member v)
add in interface AbelianGroup.Memberv - a group memberpublic ComplexVector add(ComplexVector v)
v - a complex vectorVectorDimensionException - If the vectors are different sizes.public ComplexVector add(DoubleVector v)
v - a double vectorVectorDimensionException - If the vectors are different sizes.public ComplexVector add(IntegerVector v)
v - an integer vectorVectorDimensionException - If the vectors are different sizes.public AbelianGroup.Member subtract(AbelianGroup.Member v)
subtract in interface AbelianGroup.Memberv - a group memberpublic ComplexVector subtract(ComplexVector v)
v - a complex vectorVectorDimensionException - If the vectors are different sizes.public ComplexVector subtract(DoubleVector v)
v - a double vectorVectorDimensionException - If the vectors are different sizes.public ComplexVector subtract(IntegerVector v)
v - an integer vectorVectorDimensionException - If the vectors are different sizes.public Module.Member scalarMultiply(Ring.Member x)
scalarMultiply in interface Module.Memberx - a ring memberpublic ComplexVector scalarMultiply(Complex z)
z - a complex numberpublic ComplexVector scalarMultiply(double x)
x - a doublepublic VectorSpace.Member scalarDivide(Field.Member x)
scalarDivide in interface VectorSpace.Memberx - a field memberpublic ComplexVector scalarDivide(Complex z)
z - a complex numberjava.lang.ArithmeticException - If divide by zero.public ComplexVector scalarDivide(double x)
x - a doublejava.lang.ArithmeticException - If divide by zero.public Complex scalarProduct(HilbertSpace.Member v)
scalarProduct in interface HilbertSpace.Memberv - a Hilbert space vectorpublic Complex scalarProduct(ComplexVector v)
v - a complex vectorVectorDimensionException - If the vectors are different sizes.public ComplexVector mapComponents(ComplexMapping f)
f - a user-defined function