mikera.vectorz.impl
Class BaseStridedVector
- java.lang.Object
-
- mikera.arrayz.impl.AbstractArray<java.lang.Double>
-
- mikera.vectorz.AVector
-
- mikera.vectorz.impl.ASizedVector
-
- mikera.vectorz.impl.AArrayVector
-
- mikera.vectorz.impl.AStridedVector
-
- mikera.vectorz.impl.BaseStridedVector
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<INDArray>, java.lang.Iterable<java.lang.Double>, IStridedArray, INDArray, IVector
- Direct Known Subclasses:
- StridedVector
public abstract class BaseStridedVector extends AStridedVector
Base class for strided vectors backed with a double array and fixed offset / stride Supports both mutable and immutable subclasses- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description doubledotProduct(AVector v)Returns the dot product of this vector with another vector The vectors must have the same length: if not the result is undefineddoubledotProduct(double[] ds, int off)Fast dot product with a double[] array.doubledotProduct(double[] ds, int doffset, int dstride)Fast dot product with a double[] array and a stride.doubleget(int i)Returns the double value at the specified position in a 1D vectorintgetArrayOffset()Gets the offset into the underlying double[] data array for the first element of this vectorintgetStride()Gets the stride of this strided vector.doubleunsafeGet(int i)Like get, but performs no bounds checking.-
Methods inherited from class mikera.vectorz.impl.AStridedVector
add, addAt, addMultipleToArray, addToArray, addToArray, applyOp, applyOpCopy, asDoubleArray, broadcast, broadcastLike, clone, copyTo, elementMax, elementMin, elementProduct, elementSquaredSum, elementSum, ensureMutable, equals, equalsArray, getArray, getElements, getElements, getStride, getStrides, hasUncountable, isPackedArray, isRangeZero, iterator, reduce, reduce, selectView, set, setElements, setElements, validate, visitNonZero
-
Methods inherited from class mikera.vectorz.impl.AArrayVector
maxAbsElement, slice
-
Methods inherited from class mikera.vectorz.impl.ASizedVector
checkIndex, checkLength, checkRange, elementCount, equalsArray, get, getShape, getShapeClone, isSameShape, length, sliceCount
-
Methods inherited from class mikera.vectorz.AVector
abs, absCopy, absDiff, absDiff, absDiff, absDiffCopy, add, add, add, add, add, add, add, add, addAt, addCopy, addCopy, addCopy, addInnerProduct, addInnerProduct, addInnerProduct, addInnerProduct, addMultiple, addMultiple, addMultiple, addMultiple, addMultiple, addMultiple, addMultiple, addMultiple, addMultipleCopy, addMultipleSparse, addMultipleSparse, addMultipleToArray, addPower, addPower, addProduct, addProduct, addProduct, addProductCopy, addProductCopy, addProductToArray, addProductToArray, addSparse, addSparse, addToArray, addWeighted, angle, applyOp, applyOp, applyOp, applyOp, asElementList, asVector, broadcastLike, broadcastLike, clamp, clampMax, clampMin, compareTo, compareTo, copy, copyTo, copyTo, copyTo, copyTo, crossProduct, crossProduct, dense, denseClone, dimensionality, distance, distanceL1, distanceLinf, distanceSquared, divide, divide, divide, divide, divideCopy, divideCopy, divideCopy, divideTo, dotProduct, dotProduct, elementAbsPowSum, elementIterator, elementMaxAbs, elementPowSum, elementsEqual, epsilonEquals, epsilonEquals, epsilonEquals, equals, equals, exactClone, fill, fillRange, get, get, get, get, get, getElement, getElements, getLongShape, getShape, getSlices, getTranspose, getTransposeCopy, getTransposeView, hashCode, immutable, innerProduct, innerProduct, innerProduct, innerProduct, innerProduct, innerProduct, interpolate, isElementConstrained, isFullyMutable, isMutable, isSameShape, isUnitLengthVector, isUnitLengthVector, isView, isZero, join, join, join, log, logistic, magnitude, magnitudeSquared, maxAbsElementIndex, maxElement, maxElementIndex, minElement, minElementIndex, multiply, multiply, multiply, multiply, multiply, multiplyCopy, multiplyCopy, multiplyCopy, multiplyTo, mutable, negate, negateCopy, nonSparseIndex, nonZeroCount, nonZeroIndices, nonZeroValues, normalise, normaliseCopy, normaliseMaxAbsElement, outerProduct, outerProduct, pow, projectToPlane, reciprocal, reciprocalCopy, reduceSlices, reduceSlices, reorder, reorder, reshape, rotateCopy, rotateView, rotateView, scale, scaleAdd, scaleAdd, scaleAdd, scaleAdd, scaleCopy, scaleToMagnitude, select, selectClone, set, set, set, set, set, set, set, set, set, set, setApplyOp, setApplyOp, setApplyOp, setElements, setInnerProduct, setInnerProduct, setInnerProduct, setMultiple, setMultiple, setMultiple, setMultiple, setSparse, setSparse, setSparse, shiftCopy, signum, slice, sliceValue, softmax, softmaxCopy, sparse, sparseClone, sqrtCopy, square, squareCopy, sub, sub, subArray, subAt, subCopy, subCopy, subMultiple, subVector, tanh, toDoubleArray, toDoubleBuffer, toList, toNormal, toSliceArray, toString, toStringFull, toVector, tryEfficientJoin, unsafeSet
-
Methods inherited from class mikera.arrayz.impl.AbstractArray
add, addApplyOp, addCopy, addInnerProduct, addInnerProduct, addOuterProduct, addOuterProductSparse, addSparse, broadcastCloneLike, broadcastCopyLike, componentCount, density, epsilonEquals, exp, get, get, getComponent, getComponents, getElements, getElements, getSlices, getSliceViews, isBoolean, isDense, isSparse, scale, set, set, signumCopy, sqrt, sub, sub, withComponents
-
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, asElementList, asVector, broadcastCloneLike, broadcastCopyLike, broadcastLike, broadcastLike, clamp, componentCount, copy, dense, denseClone, dimensionality, divide, divide, divideCopy, divideCopy, elementAbsPowSum, elementCount, elementIterator, elementMaxAbs, elementPowSum, elementsEqual, epsilonEquals, epsilonEquals, equals, equalsArray, exactClone, exp, fill, get, get, get, get, get, get, get, get, getComponent, getComponents, getElement, getElements, getElements, getElements, getLongShape, getShape, getShape, getShapeClone, getSlices, getSlices, getSliceViews, getTranspose, getTransposeCopy, getTransposeView, 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, reduceSlices, reduceSlices, reorder, reorder, reshape, rotateView, scale, scaleAdd, scaleAdd, scaleCopy, set, set, set, set, set, set, set, setApplyOp, 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, withComponents
-
-
-
-
Method Detail
-
getArrayOffset
public final int getArrayOffset()
Description copied from class:AStridedVectorGets the offset into the underlying double[] data array for the first element of this vector- Specified by:
getArrayOffsetin interfaceIStridedArray- Specified by:
getArrayOffsetin classAStridedVector- Returns:
-
getStride
public final int getStride()
Description copied from class:AStridedVectorGets the stride of this strided vector.- Specified by:
getStridein classAStridedVector- Returns:
-
get
public final double get(int i)
Description copied from interface:INDArrayReturns the double value at the specified position in a 1D vector
-
unsafeGet
public final double unsafeGet(int i)
Description copied from class:AVectorLike get, but performs no bounds checking. Results are undefined if the index is out of range
-
dotProduct
public double dotProduct(double[] ds, int off)Description copied from class:AVectorFast dot product with a double[] array. Performs no bounds checking. Likely to be faster than most other dot product operations- Overrides:
dotProductin classAStridedVector
-
dotProduct
public double dotProduct(double[] ds, int doffset, int dstride)Description copied from class:AVectorFast dot product with a double[] array and a stride. Performs no bounds checking. Likely to be faster than other dot product operations- Overrides:
dotProductin classAVector
-
dotProduct
public double dotProduct(AVector v)
Description copied from class:AVectorReturns the dot product of this vector with another vector The vectors must have the same length: if not the result is undefined- Overrides:
dotProductin classAStridedVector- Returns:
-
-
DMelt 3.0 © DataMelt by jWork.ORG