mikera.vectorz
Interface IVector
-
- All Superinterfaces:
- java.lang.Cloneable, java.lang.Comparable<INDArray>, INDArray, java.io.Serializable
- All Known Subinterfaces:
- ISparseVector
- All Known Implementing Classes:
- AArrayVector, ABooleanVector, AComputedVector, ADenseArrayVector, AJoinedVector, AMatrixViewVector, APrimitiveVector, ArraySubVector, ASingleElementVector, ASizedVector, ASparseIndexedVector, ASparseVector, AStridedVector, AVector, AWrappedVector, AxisVector, BaseDerivedVector, BaseStridedVector, BitVector, BufferVector, GrowableIndexedVector, GrowableVector, ImmutableVector, IndexedArrayVector, IndexedSubVector, IndexVector, JoinedArrayVector, JoinedMultiVector, JoinedVector, MatrixBandView, MatrixColumnView, MatrixRowView, MatrixViewVector, RangeVector, RepeatedElementVector, SingleElementVector, SparseHashedVector, SparseImmutableVector, SparseIndexedVector, StridedMatrixViewVector, StridedVector, SubMatrixViewVector, TriangularIndexedVector, UnmodifiableVector, Vector, Vector0, Vector1, Vector2, Vector3, Vector4, WrappedScalarVector, WrappedSubVector, ZeroVector
public interface IVector extends INDArray
Basic interface for a Vector Implementations should normally extend AVector directly, which implements IVector plus a considerable amount of other important functionality.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description AVectoraddCopy(AVector a)Adds a vector element-wise to this vector, returning a new vector.AVectorclone()Returns a clone of the array data, as a new array which will be fully mutable and may be of a different class to the original.AVectordivideCopy(AVector a)Divides this vector element-wise by another vector, returning a new vector.booleanepsilonEquals(AVector v, double tolerance)doubleget(int i)Gets a specified element from a vector.booleanisSameShape(AVector a)Returns true if this vector is exactly the same shape as another vector.intlength()Returns the length of a vector, in terms of the number of elements.AVectormultiplyCopy(AVector a)Multiplies a vector element-wise with this vector, returning a new vector.doublenormalise()AVectornormaliseCopy()Normalises this vector to unit length, returning a new vector.AVectorrotateCopy(int shift)Rotates a vector by the specified number of elements, wrapping around element values.AVectorrotateView(int shift)Rotates a vector by the specified number of elements, wrapping around element values.voidset(int i, double value)Set a specified element in a vectorAVectorshiftCopy(int shift)Shifts a vector by the specified number of elements, filling with zeros.AVectorsqrtCopy()Computes the square root for each element in this vector, returning a new vector.AVectorsubCopy(AVector a)Subtracts a vector element-wise from this vector, returning a new vector.-
Methods inherited from interface mikera.arrayz.INDArray
abs, absCopy, absDiff, absDiffCopy, add, add, addApplyOp, addAt, addCopy, addCopy, addInnerProduct, addInnerProduct, addMultiple, addMultipleSparse, addOuterProduct, addOuterProductSparse, addPower, addPower, addSparse, addSparse, addToArray, applyOp, applyOp, applyOp, applyOp, applyOpCopy, asDoubleArray, asElementList, asVector, broadcast, broadcastCloneLike, broadcastCopyLike, broadcastLike, broadcastLike, broadcastLike, clamp, componentCount, copy, dense, denseClone, dimensionality, divide, divide, divideCopy, divideCopy, elementAbsPowSum, elementCount, elementIterator, elementMax, elementMaxAbs, elementMin, elementPowSum, elementProduct, elementsEqual, elementSquaredSum, elementSum, ensureMutable, epsilonEquals, epsilonEquals, equals, equalsArray, equalsArray, exactClone, exp, fill, get, get, get, get, get, get, get, get, getComponent, getComponents, getElement, getElements, getElements, getElements, getElements, getLongShape, getShape, getShape, getShapeClone, getSlices, getSlices, getSliceViews, getTranspose, getTransposeCopy, getTransposeView, hasUncountable, immutable, innerProduct, innerProduct, innerProduct, innerProduct, isBoolean, isDense, isElementConstrained, isFullyMutable, isMutable, isSameShape, isSparse, isView, isZero, join, join, log, multiply, multiply, multiplyCopy, multiplyCopy, mutable, negate, negateCopy, nonZeroCount, outerProduct, pow, reciprocal, reciprocalCopy, reduce, reduce, reduceSlices, reduceSlices, reorder, reorder, reshape, rotateView, scale, scaleAdd, scaleAdd, scaleCopy, set, set, set, set, set, set, setApplyOp, setElements, setElements, setElements, setInnerProduct, setMultiple, setMultiple, setSparse, setSparse, signum, signumCopy, slice, slice, sliceCount, sliceValue, sparse, sparseClone, sqrt, square, squareCopy, sub, sub, subArray, subCopy, toDoubleArray, toDoubleBuffer, toSliceArray, toVector, validate, withComponents
-
-
-
-
Method Detail
-
length
int length()
Returns the length of a vector, in terms of the number of elements. For Euclidean length, use magnitude() instead- Returns:
-
get
double get(int i)
Gets a specified element from a vector.
-
set
void set(int i, double value)Set a specified element in a vector
-
addCopy
AVector addCopy(AVector a)
Adds a vector element-wise to this vector, returning a new vector.- Parameters:
a-- Returns:
-
subCopy
AVector subCopy(AVector a)
Subtracts a vector element-wise from this vector, returning a new vector.- Parameters:
a-- Returns:
-
multiplyCopy
AVector multiplyCopy(AVector a)
Multiplies a vector element-wise with this vector, returning a new vector.- Parameters:
a-- Returns:
-
divideCopy
AVector divideCopy(AVector a)
Divides this vector element-wise by another vector, returning a new vector.- Parameters:
a-- Returns:
-
sqrtCopy
AVector sqrtCopy()
Computes the square root for each element in this vector, returning a new vector.- Parameters:
a-- Returns:
-
epsilonEquals
boolean epsilonEquals(AVector v, double tolerance)
-
normalise
double normalise()
-
normaliseCopy
AVector normaliseCopy()
Normalises this vector to unit length, returning a new vector.- Returns:
-
clone
AVector clone()
Description copied from interface:INDArrayReturns a clone of the array data, as a new array which will be fully mutable and may be of a different class to the original. Clone should attempt to return the most efficient possible array type. Clone should preserve sparsity property where possible, but this is not guaranteed.
-
isSameShape
boolean isSameShape(AVector a)
Returns true if this vector is exactly the same shape as another vector.- Parameters:
a-- Returns:
-
shiftCopy
AVector shiftCopy(int shift)
Shifts a vector by the specified number of elements, filling with zeros. Returns a new vector.- Parameters:
shift-- Returns:
-
rotateView
AVector rotateView(int shift)
Rotates a vector by the specified number of elements, wrapping around element values. Returns a view.- Parameters:
shift-- Returns:
-
rotateCopy
AVector rotateCopy(int shift)
Rotates a vector by the specified number of elements, wrapping around element values. Returns a new vector.- Parameters:
shift-- Returns:
-
-
DMelt 3.0 © DataMelt by jWork.ORG