Class DoubleVector
- java.lang.Object
-
- com.singularsys.extensions.matrix.doublemat.DoubleVector
-
- All Implemented Interfaces:
VectorI,java.io.Serializable
public final class DoubleVector extends java.lang.Object implements VectorI, java.io.Serializable
A vector where the elements are doubles- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DoubleVector(double[] data)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleaneq(DoubleVector vec)booleanequals(java.lang.Object obj)Uses the Double.equals() rather than == for compatibility with hashcode.DimensionsgetDimensions()Gets the dimensions of the Vector or Matrixjava.lang.DoublegetEle(int i)Gets the i-th element of a vectorintgetNEles()Gets the number of elements of a vectorinthashCode()static DoubleVectornewInstance(double[] in)static DoubleVectornewInstance(java.lang.Double[] in)voidsetEle(int index, java.lang.Object val)Sets an element of a vector.double[]toArray()java.lang.Object[]toArray(java.lang.Object[] vec)java.lang.StringtoString()
-
-
-
Method Detail
-
newInstance
public static DoubleVector newInstance(java.lang.Double[] in)
-
newInstance
public static DoubleVector newInstance(double[] in)
-
getEle
public java.lang.Double getEle(int i)
Description copied from interface:VectorIGets the i-th element of a vector
-
setEle
public void setEle(int index, java.lang.Object val) throws EvaluationExceptionDescription copied from interface:VectorISets an element of a vector.- Specified by:
setElein interfaceVectorI- Throws:
EvaluationException
-
getNEles
public int getNEles()
Description copied from interface:VectorIGets the number of elements of a vector
-
getDimensions
public Dimensions 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
public boolean eq(DoubleVector vec)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
toArray
public java.lang.Object[] toArray(java.lang.Object[] vec) throws EvaluationException- Specified by:
toArrayin interfaceVectorI- Throws:
EvaluationException
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
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 ==.- Overrides:
equalsin classjava.lang.Object
-
-