public class Complex3Vector extends ComplexVector
ARRAY_1D, vectorIm, vectorRe
CLASS_SPECIFIC, N, storageFormat
Constructor and Description |
---|
Complex3Vector()
Constructs an empty 3-vector.
|
Complex3Vector(Complex x,
Complex y,
Complex z)
Constructs a 3-vector.
|
Complex3Vector(double[] real,
double[] imag)
Constructs a 3-vector by wrapping two arrays.
|
Modifier and Type | Method and Description |
---|---|
Complex3Vector |
add(Complex3Vector v)
Returns the addition of this vector and another.
|
Complex3Vector |
add(Double3Vector v)
Returns the addition of this vector and another.
|
Complex3Vector |
add(Integer3Vector 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 3-vector.
|
double |
infNorm()
Returns the l
![]() |
ComplexVector |
mapComponents(ComplexMapping f)
Applies a function on all the vector components.
|
Complex3Vector |
multiply(Complex3Vector v)
Returns the vector product of this vector and another.
|
double |
norm()
Returns the l2-norm (magnitude).
|
DoubleVector |
real()
Returns the real part of this complex 3-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.
|
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.
|
Complex |
scalarProduct(Complex3Vector 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.
|
Complex3Vector |
subtract(Complex3Vector v)
Returns the subtraction of this vector by another.
|
Complex3Vector |
subtract(Double3Vector v)
Returns the subtraction of this vector by another.
|
Complex3Vector |
subtract(Integer3Vector v)
Returns the subtraction of this vector by another.
|
java.lang.String |
toString()
Returns a comma delimited string representing the value of this vector.
|
add, add, add, add, negate, normalize, scalarDivide, scalarMultiply, scalarProduct, scalarProduct, subtract, subtract, subtract, subtract
dimension, getInvalidComponentMsg
public Complex3Vector()
public Complex3Vector(double[] real, double[] imag)
real
- an array of real valuesimag
- an array of imaginary valuespublic boolean equals(java.lang.Object a)
equals
in class ComplexVector
a
- a complex 3-vectorpublic java.lang.String toString()
toString
in class ComplexVector
public int hashCode()
hashCode
in class ComplexVector
public DoubleVector real()
real
in class ComplexVector
public DoubleVector imag()
imag
in class ComplexVector
public Complex getComponent(int n)
getComponent
in class ComplexVector
n
- index of the vector componentVectorDimensionException
- If attempting to access an invalid component.public void setComponent(int n, Complex z)
setComponent
in class ComplexVector
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)
setComponent
in class ComplexVector
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.Member
norm
in class ComplexVector
public double infNorm()
infNorm
in class ComplexVector
public ComplexVector conjugate()
conjugate
in class ComplexVector
public Complex3Vector add(Complex3Vector v)
v
- a complex 3-vectorpublic Complex3Vector add(Double3Vector v)
v
- a double 3-vectorpublic Complex3Vector add(Integer3Vector v)
v
- an integer 3-vectorpublic Complex3Vector subtract(Complex3Vector v)
v
- a complex 3-vectorpublic Complex3Vector subtract(Double3Vector v)
v
- a double 3-vectorpublic Complex3Vector subtract(Integer3Vector v)
v
- an integer 3-vectorpublic ComplexVector scalarMultiply(Complex z)
scalarMultiply
in class ComplexVector
z
- a complex numberpublic ComplexVector scalarMultiply(double x)
scalarMultiply
in class ComplexVector
x
- a doublepublic ComplexVector scalarDivide(Complex z)
scalarDivide
in class ComplexVector
z
- a complex numberjava.lang.ArithmeticException
- If divide by zero.public ComplexVector scalarDivide(double x)
scalarDivide
in class ComplexVector
x
- a doublejava.lang.ArithmeticException
- If divide by zero.public Complex scalarProduct(Complex3Vector v)
v
- a complex 3-vectorpublic Complex3Vector multiply(Complex3Vector v)
v
- a complex 3-vectorpublic ComplexVector mapComponents(ComplexMapping f)
mapComponents
in class ComplexVector
f
- a user-defined function