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
FieldsModifier and TypeFieldDescriptionprotected static final javolution.xml.XMLFormat<ComplexVector>Holds the default XML representation. -
Method Summary
Modifier and TypeMethodDescriptioncopy()Returns a copy of this vectorallocatedby the calling thread (possibly on the stack).get(int i) Returns a single element from this vector.intReturns 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).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 ComplexVectorReturns a new vector holding the elements from the specified collection.static ComplexVectorReturns a new vector holding the specified complex numbers.static ComplexVectorReturns aComplexVectorinstance equivalent to the specified vector.
-
Field Details
-
XML
Holds the default XML representation. For example: [code] [/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 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:
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:
normin interfaceVectorSpaceNormed<Vector<Complex>,Complex> - Returns:
sqrt(this · this).- See Also:
-
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
Description copied from class:VectorReturns a single element from this vector. -
opposite
Description copied from class:VectorReturns the negation of this vector. -
plus
Description copied from class:VectorReturns the sum of this vector with the one specified. -
minus
Description copied from class:VectorReturns the difference between this vector and the one specified. -
times
Description copied from class:VectorReturns the product of this vector with the specified coefficient. -
times
Description copied from class:VectorReturns the dot product of this vector with the one specified. -
copy
Description copied from class:VectorReturns a copy of this vectorallocatedby the calling thread (possibly on the stack).
-