mikera.arrayz.impl
Class BaseNDArray
- java.lang.Object
-
- mikera.arrayz.impl.AbstractArray<INDArray>
-
- mikera.arrayz.impl.BaseShapedArray
-
- mikera.arrayz.impl.BaseNDArray
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<INDArray>, java.lang.Iterable<INDArray>, IStridedArray, INDArray
- Direct Known Subclasses:
- ImmutableArray, NDArray
public abstract class BaseNDArray extends BaseShapedArray implements IStridedArray
Base class for NDArray implementations.- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description intdimensionality()Returns the dimensionality of the array (i.e.longelementCount()Returns the total number of elements in this array.doubleget()Returns the double value of a scalar arraydoubleget(int... indexes)Returns the double value at the specified index position in an arraydoubleget(int x)Returns the double value at the specified position in a 1D vectordoubleget(int x, int y)Returns the double value at the specified position in a 2D matrixintgetArrayOffset()Gets the data array offset for the first element of this strided arrayintgetIndex(int... indexes)long[]getLongShape()Returns the shape of the array as an array of longs.intgetShape(int dim)Returns the dimension size for a specific dimension in the array's shapeintgetStride(int dim)Gets the stide for a specific dimension in this strided array.int[]getStrides()Gets the strides for each dimension of this strided array.booleanisPackedArray()Checks if this array is fully packed in row major order.-
Methods inherited from class mikera.arrayz.impl.BaseShapedArray
getElement, getShape, getShapeClone, isZero, reduce, reduce, sliceCount
-
Methods inherited from class mikera.arrayz.impl.AbstractArray
abs, absCopy, absDiff, absDiffCopy, add, add, add, addApplyOp, addAt, addCopy, addCopy, addCopy, addInnerProduct, addInnerProduct, 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, clone, compareTo, componentCount, copy, dense, denseClone, density, divide, divide, divideCopy, divideCopy, elementAbsPowSum, elementIterator, elementMax, elementMaxAbs, elementMin, elementPowSum, elementProduct, elementsEqual, elementSquaredSum, elementSum, ensureMutable, epsilonEquals, epsilonEquals, equals, equals, equals, equalsArray, equalsArray, exp, fill, get, get, get, get, get, getComponent, getComponents, getElements, getElements, getElements, getElements, getSlices, getSlices, getSliceViews, getTranspose, getTransposeCopy, getTransposeView, hashCode, hasUncountable, immutable, innerProduct, innerProduct, innerProduct, innerProduct, isBoolean, isDense, isElementConstrained, isFullyMutable, isMutable, isSameShape, isSparse, iterator, 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, setApplyOp, setElements, setElements, setElements, setInnerProduct, setMultiple, setMultiple, setSparse, setSparse, signum, signumCopy, sliceValue, sparse, sparseClone, sqrt, square, squareCopy, sub, sub, sub, subArray, subCopy, toDoubleArray, toDoubleBuffer, toSliceArray, toString, toStringFull, toVector, validate, withComponents
-
Methods inherited from interface mikera.arrayz.impl.IStridedArray
getArray
-
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, clone, componentCount, copy, dense, denseClone, divide, divide, divideCopy, divideCopy, elementAbsPowSum, elementIterator, elementMax, elementMaxAbs, elementMin, elementPowSum, elementProduct, elementsEqual, elementSquaredSum, elementSum, ensureMutable, epsilonEquals, epsilonEquals, equals, equalsArray, equalsArray, exactClone, exp, fill, get, get, get, get, get, getComponent, getComponents, getElement, getElements, getElements, getElements, getElements, 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, 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
-
dimensionality
public int dimensionality()
Description copied from interface:INDArrayReturns the dimensionality of the array (i.e. the number of dimensions in the array shape) e.g. 0 for a scalar, 1 for a vector, 2 for a matrix etc.- Specified by:
dimensionalityin interfaceINDArray- Overrides:
dimensionalityin classBaseShapedArray
-
getStride
public final int getStride(int dim)
Description copied from interface:IStridedArrayGets the stide for a specific dimension in this strided array.- Specified by:
getStridein interfaceIStridedArray- Returns:
-
getShape
public final int getShape(int dim)
Description copied from interface:INDArrayReturns the dimension size for a specific dimension in the array's shape- Specified by:
getShapein interfaceINDArray- Overrides:
getShapein classBaseShapedArray
-
getLongShape
public long[] getLongShape()
Description copied from interface:INDArrayReturns the shape of the array as an array of longs.- Specified by:
getLongShapein interfaceINDArray- Overrides:
getLongShapein classAbstractArray<INDArray>
-
getIndex
public int getIndex(int... indexes)
-
get
public double get(int... indexes)
Description copied from interface:INDArrayReturns the double value at the specified index position in an array
-
get
public double get()
Description copied from interface:INDArrayReturns the double value of a scalar array- Specified by:
getin interfaceINDArray- Specified by:
getin classAbstractArray<INDArray>
-
get
public double get(int x)
Description copied from interface:INDArrayReturns the double value at the specified position in a 1D vector- Specified by:
getin interfaceINDArray- Specified by:
getin classAbstractArray<INDArray>
-
get
public double get(int x, int y)Description copied from interface:INDArrayReturns the double value at the specified position in a 2D matrix- Specified by:
getin interfaceINDArray- Specified by:
getin classAbstractArray<INDArray>
-
isPackedArray
public boolean isPackedArray()
Description copied from interface:IStridedArrayChecks if this array is fully packed in row major order.- Specified by:
isPackedArrayin interfaceIStridedArray- Returns:
-
elementCount
public long elementCount()
Description copied from interface:INDArrayReturns the total number of elements in this array. Equivalent to the product of all dimension sizes.- Specified by:
elementCountin interfaceINDArray- Overrides:
elementCountin classBaseShapedArray
-
getArrayOffset
public int getArrayOffset()
Description copied from interface:IStridedArrayGets the data array offset for the first element of this strided array- Specified by:
getArrayOffsetin interfaceIStridedArray- Returns:
-
getStrides
public int[] getStrides()
Description copied from interface:IStridedArrayGets the strides for each dimension of this strided array. The returned array should not be modified- Specified by:
getStridesin interfaceIStridedArray- Returns:
-
-
DMelt 3.0 © DataMelt by jWork.ORG