Package org.jscience.mathematics.vector
Class 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>
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final javolution.xml.XMLFormat<ComplexVector>
Holds the default XML representation. -
Method Summary
Modifier and TypeMethodDescriptioncopy()
Returns a copy of this vectorallocated
by the calling thread (possibly on the stack).get
(int i) Returns a single element from this vector.int
Returns the number of elements held by this vector.double
getImaginary
(int i) Returns the imaginary value of a complex number from this vector (fast).double
getReal
(int i) Returns the real value of a complex number from this vector (fast).Returns the difference between this vector and the one specified.norm()
Returns the Euclidian norm of this vector (square root of the dot product of this vector and itself).opposite()
Returns the negation of this vector.Returns the sum of this vector with the one specified.Returns the product of this vector with the specified coefficient.Returns the dot product of this vector with the one specified.static ComplexVector
Returns a new vector holding the elements from the specified collection.static ComplexVector
Returns a new vector holding the specified complex numbers.static ComplexVector
Returns aComplexVector
instance equivalent to the specified vector.
-
Field Details
-
XML
Holds the default XML representation. For example: [code]
-
-
Method Details
-
valueOf
Returns a new vector holding the specified complex numbers.- Parameters:
elements
- the complex numbers elements.- Returns:
- the vector having the specified complex numbers.
-
valueOf
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
Returns aComplexVector
instance equivalent to the specified vector.- Parameters:
that
- the vector to convert.- Returns:
that
or 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:
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:
IndexOutOfBoundsException
-(i < 0) || (i >= dimension())
-
norm
Returns the Euclidian norm of this vector (square root of the dot product of this vector and itself).- Specified by:
norm
in interfaceVectorSpaceNormed<Vector<Complex>,
Complex> - Returns:
sqrt(this · this)
.- See Also:
-
getDimension
public int getDimension()Description copied from class:Vector
Returns the number of elements held by this vector.- Specified by:
getDimension
in classVector<Complex>
- Returns:
- this vector dimension.
-
get
Description copied from class:Vector
Returns a single element from this vector. -
opposite
Description copied from class:Vector
Returns the negation of this vector. -
plus
Description copied from class:Vector
Returns the sum of this vector with the one specified. -
minus
Description copied from class:Vector
Returns the difference between this vector and the one specified. -
times
Description copied from class:Vector
Returns the product of this vector with the specified coefficient. -
times
Description copied from class:Vector
Returns the dot product of this vector with the one specified. -
copy
Description copied from class:Vector
Returns a copy of this vectorallocated
by the calling thread (possibly on the stack).
-