Class DoubleVector
java.lang.Object
com.singularsys.extensions.matrix.doublemat.DoubleVector
- All Implemented Interfaces:
VectorI,Serializable,Iterable<Object>
A vector where the elements are doubles
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleaneq(DoubleVector vec) booleanUses the Double.equals() rather than == for compatibility with hashcode.Gets the dimensions of the Vector or MatrixgetEle(int i) Gets the i-th element of a vectorintgetNEles()Gets the number of elements of a vectorinthashCode()static DoubleVectornewInstance(double[] in) static DoubleVectornewInstance(Double[] in) voidSets an element of a vector.double[]toArray()Object[]toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
data
public final double[] data -
nrows
public final int nrows
-
-
Constructor Details
-
DoubleVector
public DoubleVector(double[] data) - Parameters:
data-
-
-
Method Details
-
newInstance
-
newInstance
-
getEle
Description copied from interface:VectorIGets the i-th element of a vector- Specified by:
getElein interfaceVectorI- Parameters:
i- index (starts from 0)- Returns:
- the i-th element
- Throws:
EvaluationException
-
setEle
Description copied from interface:VectorISets an element of a vector.- Specified by:
setElein interfaceVectorI- Parameters:
index-val-- Throws:
EvaluationException
-
getNEles
public int getNEles()Description copied from interface:VectorIGets the number of elements of a vector -
getDimensions
Description copied from interface:VectorIGets the dimensions of the Vector or Matrix- Specified by:
getDimensionsin interfaceVectorI- Returns:
- the dimensions
-
toArray
public double[] toArray() -
eq
-
toString
-
toArray
- Specified by:
toArrayin interfaceVectorI- Throws:
EvaluationException
-
hashCode
public int hashCode() -
equals
Uses the Double.equals() rather than == for compatibility with hashcode. Hence, NaN equals NaN and -0.0 equals 0.0. Useeq(DoubleVector)for comparison using ==.
-