Package org.jscience.mathematics.vector
Class ComplexVector
- java.lang.Object
-
- org.jscience.mathematics.vector.Vector<Complex>
-
- org.jscience.mathematics.vector.ComplexVector
-
- All Implemented Interfaces:
javolution.lang.Immutable,javolution.lang.Realtime,javolution.lang.ValueType,GroupAdditive<Vector<Complex>>,Structure<Vector<Complex>>,VectorSpace<Vector<Complex>,Complex>,VectorSpaceNormed<Vector<Complex>,Complex>
public final class ComplexVector extends Vector<Complex> implements VectorSpaceNormed<Vector<Complex>,Complex>
- Version:
- 3.3, January 2, 2007
- Author:
- Jean-Marie Dautelle
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ComplexVectorcopy()Returns a copy of this vectorallocatedby the calling thread (possibly on the stack).Complexget(int i)Returns a single element from this vector.intgetDimension()Returns the number of elements held by this vector.doublegetImaginary(int i)Returns the imaginary value of a complex number from this vector (fast).doublegetReal(int i)Returns the real value of a complex number from this vector (fast).ComplexVectorminus(Vector<Complex> that)Returns the difference between this vector and the one specified.Complexnorm()Returns the Euclidian norm of this vector (square root of the dot product of this vector and itself).ComplexVectoropposite()Returns the negation of this vector.ComplexVectorplus(Vector<Complex> that)Returns the sum of this vector with the one specified.ComplexVectortimes(Complex k)Returns the product of this vector with the specified coefficient.Complextimes(Vector<Complex> that)Returns the dot product of this vector with the one specified.static ComplexVectorvalueOf(java.util.List<Complex> elements)Returns a new vector holding the elements from the specified collection.static ComplexVectorvalueOf(Complex... elements)Returns a new vector holding the specified complex numbers.static ComplexVectorvalueOf(Vector<Complex> that)Returns aComplexVectorinstance equivalent to the specified vector.
-
-
-
Method Detail
-
valueOf
public static ComplexVector valueOf(Complex... elements)
Returns a new vector holding the specified complex numbers.- Parameters:
elements- the complex numbers elements.- Returns:
- the vector having the specified complex numbers.
-
valueOf
public static ComplexVector valueOf(java.util.List<Complex> elements)
Returns a new vector holding the elements from the specified collection.- Parameters:
elements- the collection of floating-points numbers.- Returns:
- the vector having the specified elements.
-
valueOf
public static ComplexVector valueOf(Vector<Complex> that)
Returns aComplexVectorinstance equivalent to the specified vector.- Parameters:
that- the vector to convert.- Returns:
thator new equivalent ComplexVector.
-
getReal
public double getReal(int i)
Returns the real value of a complex number from this vector (fast).- Parameters:
i- the complex number index.- Returns:
- the real value of complex at
i. - Throws:
java.lang.IndexOutOfBoundsException-(i < 0) || (i >= dimension())
-
getImaginary
public double getImaginary(int i)
Returns the imaginary value of a complex number from this vector (fast).- Parameters:
i- the complex number index.- Returns:
- the real value of complex at
i. - Throws:
java.lang.IndexOutOfBoundsException-(i < 0) || (i >= dimension())
-
norm
public Complex norm()
Returns the Euclidian norm of this vector (square root of the dot product of this vector and itself).- Specified by:
normin interfaceVectorSpaceNormed<Vector<Complex>,Complex>- Returns:
sqrt(this · this).- See Also:
- Wikipedia: Vector Norm
-
getDimension
public int getDimension()
Description copied from class:VectorReturns the number of elements held by this vector.- Specified by:
getDimensionin classVector<Complex>- Returns:
- this vector dimension.
-
get
public Complex get(int i)
Description copied from class:VectorReturns a single element from this vector.
-
opposite
public ComplexVector opposite()
Description copied from class:VectorReturns the negation of this vector.
-
plus
public ComplexVector plus(Vector<Complex> that)
Description copied from class:VectorReturns the sum of this vector with the one specified.
-
minus
public ComplexVector minus(Vector<Complex> that)
Description copied from class:VectorReturns the difference between this vector and the one specified.
-
times
public ComplexVector times(Complex k)
Description copied from class:VectorReturns the product of this vector with the specified coefficient.
-
times
public Complex times(Vector<Complex> that)
Description copied from class:VectorReturns the dot product of this vector with the one specified.- Specified by:
timesin classVector<Complex>- Parameters:
that- the vector multiplier.- Returns:
this · that- See Also:
- Wikipedia: Dot Product
-
copy
public ComplexVector copy()
Description copied from class:VectorReturns a copy of this vectorallocatedby the calling thread (possibly on the stack).
-
-