mikera.vectorz.impl
Class MatrixViewVector
- java.lang.Object
-
- mikera.arrayz.impl.AbstractArray<java.lang.Double>
-
- mikera.vectorz.AVector
-
- mikera.vectorz.impl.ASizedVector
-
- mikera.vectorz.impl.AMatrixViewVector
-
- mikera.vectorz.impl.MatrixViewVector
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<INDArray>, java.lang.Iterable<java.lang.Double>, INDArray, IVector
public class MatrixViewVector extends AMatrixViewVector
Specialised class for viewing a matrix as a flattened vector- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description MatrixViewVector(AMatrix a)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidabs()Replaces all elements of this array with their absolute values, according to Math.abs(double)voidaddToArray(double[] data, int offset)Adds this vector to a double[] array, starting at the specified offset.voidapplyOp(Op op)Applies a unary operator to all elements of the array (in-place)java.util.List<java.lang.Double>asElementList()Returns a Listcontaining all elements of this array voidclamp(double min, double max)Clamps all values in the vector to a given rangedoubledotProduct(double[] data, int offset)Fast dot product with a double[] array.doubleelementSquaredSum()Returns the sum of squared elements in this array.doubleelementSum()Returns the sum of all elements in a vectorbooleanequalsArray(double[] data, int offset)Returns true if this vector exactly matches the elements in double[] array, starting from the specified offsetAVectorexactClone()Returns an exact clone of this vector, i.e.voidexp()Computes the function e^x (in-place) for all array elementsvoidfill(double value)Fills the entire vector with a given valuedoubleget(int i)Returns the double value at the specified position in a 1D vectorvoidgetElements(double[] data, int offset)Copies all elements of this array a double array at the specified offsetbooleanisFullyMutable()Returns true if this vector is fully mutable, i.e.booleanisMutable()Returns true if this vector is mutable.booleanisSparse()Returns true if the array is in a sparse formatbooleanisView()Returns true if this vector is of a view type that references other vectors / data.booleanisZero()Returns true if this vector is a zero vector (all components zero)voidlog()Computes the natural logarithm (in-place) for all array elementsvoidnegate()Negates all emlements of this vector in place.voidpow(double exponent)Raises all elements of the array to a specified power in placevoidset(int i, double value)Sets a value at a given position in a mutable 1D arrayvoidsignum()Calculates the signum of all elements of this mutable array Sets each component of the array to its sign value (-1, 0 or 1)voidsqrt()Computes the square root of all elements in the arrayvoidsquare()Squares all elements of the array in placeAVectorsubVector(int start, int length)Obtains a sub-vector view that refers to this vector.doubleunsafeGet(int i)Like get, but performs no bounds checking.voidunsafeSet(int i, double value)Like set, but performs no bounds checking.-
Methods inherited from class mikera.vectorz.impl.AMatrixViewVector
addAt, dotProduct, equals, slice
-
Methods inherited from class mikera.vectorz.impl.ASizedVector
checkIndex, checkLength, checkRange, elementCount, equalsArray, get, getShape, getShapeClone, isSameShape, length, sliceCount, visitNonZero
-
Methods inherited from class mikera.vectorz.AVector
absCopy, absDiff, absDiff, absDiff, absDiffCopy, add, 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, addMultipleToArray, addPower, addPower, addProduct, addProduct, addProduct, addProductCopy, addProductCopy, addProductToArray, addProductToArray, addSparse, addSparse, addToArray, addToArray, addWeighted, angle, applyOp, applyOp, applyOp, applyOp, applyOpCopy, asDoubleArray, asVector, broadcast, broadcastLike, broadcastLike, broadcastLike, clampMax, clampMin, clone, compareTo, compareTo, copy, copyTo, copyTo, copyTo, copyTo, copyTo, crossProduct, crossProduct, dense, denseClone, dimensionality, distance, distanceL1, distanceLinf, distanceSquared, divide, divide, divide, divide, divideCopy, divideCopy, divideCopy, divideTo, dotProduct, dotProduct, dotProduct, elementAbsPowSum, elementIterator, elementMax, elementMaxAbs, elementMin, elementPowSum, elementProduct, elementsEqual, epsilonEquals, epsilonEquals, epsilonEquals, equals, equals, fillRange, get, get, get, get, get, getElement, getElements, getElements, getLongShape, getShape, getSlices, getTranspose, getTransposeCopy, getTransposeView, hashCode, hasUncountable, immutable, innerProduct, innerProduct, innerProduct, innerProduct, innerProduct, innerProduct, interpolate, isElementConstrained, isRangeZero, isSameShape, isUnitLengthVector, isUnitLengthVector, iterator, join, join, join, logistic, magnitude, magnitudeSquared, maxAbsElement, maxAbsElementIndex, maxElement, maxElementIndex, minElement, minElementIndex, multiply, multiply, multiply, multiply, multiply, multiplyCopy, multiplyCopy, multiplyCopy, multiplyTo, mutable, negateCopy, nonSparseIndex, nonZeroCount, nonZeroIndices, nonZeroValues, normalise, normaliseCopy, normaliseMaxAbsElement, outerProduct, outerProduct, projectToPlane, reciprocal, reciprocalCopy, reduce, reduce, reduceSlices, reduceSlices, reorder, reorder, reshape, rotateCopy, rotateView, rotateView, scale, scaleAdd, scaleAdd, scaleAdd, scaleAdd, scaleCopy, scaleToMagnitude, select, selectClone, selectView, set, set, set, set, set, set, set, set, set, set, setApplyOp, setApplyOp, setApplyOp, setElements, setElements, setElements, setInnerProduct, setInnerProduct, setInnerProduct, setMultiple, setMultiple, setMultiple, setMultiple, setSparse, setSparse, setSparse, shiftCopy, slice, sliceValue, softmax, softmaxCopy, sparse, sparseClone, sqrtCopy, squareCopy, sub, sub, subArray, subAt, subCopy, subCopy, subMultiple, tanh, toDoubleArray, toDoubleBuffer, toList, toNormal, toSliceArray, toString, toStringFull, toVector, tryEfficientJoin, validate
-
Methods inherited from class mikera.arrayz.impl.AbstractArray
add, addApplyOp, addCopy, addInnerProduct, addInnerProduct, addOuterProduct, addOuterProductSparse, addSparse, broadcastCloneLike, broadcastCopyLike, componentCount, density, ensureMutable, epsilonEquals, get, get, getComponent, getComponents, getElements, getElements, getSlices, getSliceViews, isBoolean, isDense, scale, set, set, signumCopy, sub, sub, withComponents
-
Methods inherited from interface mikera.arrayz.INDArray
addApplyOp, addInnerProduct, addOuterProduct, addOuterProductSparse, addSparse, broadcastCloneLike, broadcastCopyLike, componentCount, ensureMutable, epsilonEquals, get, get, getComponent, getComponents, getElements, getElements, getSlices, getSliceViews, isBoolean, isDense, scale, set, set, signumCopy, sub, withComponents
-
-
-
-
Constructor Detail
-
MatrixViewVector
public MatrixViewVector(AMatrix a)
-
-
Method Detail
-
get
public double get(int i)
Description copied from interface:INDArrayReturns the double value at the specified position in a 1D vector
-
set
public void set(int i, double value)Description copied from interface:INDArraySets a value at a given position in a mutable 1D array
-
unsafeGet
public 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- Overrides:
unsafeGetin classAMatrixViewVector
-
unsafeSet
public void unsafeSet(int i, double value)Description copied from class:AVectorLike set, but performs no bounds checking. Results are undefined if the index is out of range- Overrides:
unsafeSetin classAMatrixViewVector
-
exactClone
public AVector exactClone()
Description copied from class:AVectorReturns an exact clone of this vector, i.e. of the same type- Specified by:
exactClonein interfaceINDArray- Specified by:
exactClonein classAVector- Returns:
- A clone of the original array
-
isFullyMutable
public boolean isFullyMutable()
Description copied from class:AVectorReturns true if this vector is fully mutable, i.e. can contain any unconstrained double values- Specified by:
isFullyMutablein interfaceINDArray- Overrides:
isFullyMutablein classAVector
-
isMutable
public boolean isMutable()
Description copied from class:AVectorReturns true if this vector is mutable.
-
isView
public boolean isView()
Description copied from class:AVectorReturns true if this vector is of a view type that references other vectors / data.
-
fill
public void fill(double value)
Description copied from class:AVectorFills the entire vector with a given value
-
isSparse
public boolean isSparse()
Description copied from interface:INDArrayReturns true if the array is in a sparse format- Specified by:
isSparsein interfaceINDArray- Overrides:
isSparsein classAbstractArray<java.lang.Double>
-
isZero
public boolean isZero()
Description copied from class:AVectorReturns true if this vector is a zero vector (all components zero)
-
getElements
public void getElements(double[] data, int offset)Description copied from interface:INDArrayCopies all elements of this array a double array at the specified offset- Specified by:
getElementsin interfaceINDArray- Overrides:
getElementsin classAMatrixViewVector
-
asElementList
public java.util.List<java.lang.Double> asElementList()
Description copied from interface:INDArrayReturns a Listcontaining all elements of this array - Specified by:
asElementListin interfaceINDArray- Overrides:
asElementListin classAVector
-
addToArray
public void addToArray(double[] data, int offset)Description copied from class:AVectorAdds this vector to a double[] array, starting at the specified offset.- Specified by:
addToArrayin interfaceINDArray- Overrides:
addToArrayin classAVector
-
clamp
public void clamp(double min, double max)Description copied from class:AVectorClamps all values in the vector to a given range
-
equalsArray
public boolean equalsArray(double[] data, int offset)Description copied from class:AVectorReturns true if this vector exactly matches the elements in double[] array, starting from the specified offset- Specified by:
equalsArrayin interfaceINDArray- Overrides:
equalsArrayin classASizedVector- Parameters:
data- Array of double element values to check for equalityoffset- Offset into the data array- Returns:
-
elementSum
public double elementSum()
Description copied from class:AVectorReturns the sum of all elements in a vector- Specified by:
elementSumin interfaceINDArray- Overrides:
elementSumin classAVector
-
elementSquaredSum
public double elementSquaredSum()
Description copied from interface:INDArrayReturns the sum of squared elements in this array.- Specified by:
elementSquaredSumin interfaceINDArray- Overrides:
elementSquaredSumin classAVector
-
applyOp
public void applyOp(Op op)
Description copied from interface:INDArrayApplies a unary operator to all elements of the array (in-place)
-
abs
public void abs()
Description copied from interface:INDArrayReplaces all elements of this array with their absolute values, according to Math.abs(double)
-
signum
public void signum()
Description copied from interface:INDArrayCalculates the signum of all elements of this mutable array Sets each component of the array to its sign value (-1, 0 or 1)
-
negate
public void negate()
Description copied from class:AVectorNegates all emlements of this vector in place.
-
exp
public void exp()
Description copied from interface:INDArrayComputes the function e^x (in-place) for all array elements- Specified by:
expin interfaceINDArray- Overrides:
expin classAbstractArray<java.lang.Double>
-
log
public void log()
Description copied from interface:INDArrayComputes the natural logarithm (in-place) for all array elements
-
square
public void square()
Description copied from interface:INDArraySquares all elements of the array in place
-
sqrt
public void sqrt()
Description copied from interface:INDArrayComputes the square root of all elements in the array- Specified by:
sqrtin interfaceINDArray- Overrides:
sqrtin classAbstractArray<java.lang.Double>
-
pow
public void pow(double exponent)
Description copied from interface:INDArrayRaises all elements of the array to a specified power in place
-
subVector
public AVector subVector(int start, int length)
Description copied from class:AVectorObtains a sub-vector view that refers to this vector. Changes to the sub-vector will be reflected in this vector
-
dotProduct
public double dotProduct(double[] data, int offset)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- Specified by:
dotProductin classAVector
-
-
DMelt 3.0 © DataMelt by jWork.ORG