mikera.matrixx.impl
Class MatrixRowView
- java.lang.Object
-
- mikera.arrayz.impl.AbstractArray<java.lang.Double>
-
- mikera.vectorz.AVector
-
- mikera.vectorz.impl.ASizedVector
-
- mikera.vectorz.impl.AMatrixViewVector
-
- mikera.matrixx.impl.MatrixRowView
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<INDArray>, java.lang.Iterable<java.lang.Double>, INDArray, IVector
public final class MatrixRowView extends AMatrixViewVector
A class representing a wrapped view of a matrix row as a vector. Performance of this implementation is generally not as good as specialised implementations. Intended for use where no better implementations for getRowView(...) on a matrix exist.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description MatrixRowView(AMatrix aMatrix, int row)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidadd(AVector v)Adds another vector to this onevoidaddMultiple(AVector v, double factor)Adds a scaled multiple of another vector to this vectorvoidapplyOp(Op op)Applies a unary operator to all elements of the array (in-place)voidapplyOp(Op2 op, AVector v)Applies a binary operator to this vector and a second vectorvoidapplyOp(Op2 op, double v)Applies a binary operator to this array and a double value.AVectorclone()Clones the vector, creating a new mutable copy of all data.doubledotProduct(double[] data, int offset)Fast dot product with a double[] array.booleanequals(AVector v)Returns true if this array is exactly equal to a vector.MatrixRowViewexactClone()Returns an exact clone of this vector, i.e.voidfill(double v)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.voidmultiply(AVector v)Multiplies this vector by another vector, elementwise.voidmultiply(double factor)Multiplies the vector by a constant factorvoidset(AVector v)Sets the vector to equal the value of another vectorvoidset(int i, double value)Sets a value at a given position in a mutable 1D arrayvoidsub(AVector v)Subtracts a vector from this vectordoubleunsafeGet(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, slice
-
Methods inherited from class mikera.vectorz.impl.ASizedVector
checkIndex, checkLength, checkRange, elementCount, equalsArray, equalsArray, get, getShape, getShapeClone, isSameShape, length, sliceCount, visitNonZero
-
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, addMultipleCopy, addMultipleSparse, addMultipleSparse, addMultipleToArray, addMultipleToArray, addPower, addPower, addProduct, addProduct, addProduct, addProductCopy, addProductCopy, addProductToArray, addProductToArray, addSparse, addSparse, addToArray, addToArray, addToArray, addWeighted, angle, applyOp, applyOp, applyOpCopy, asDoubleArray, asElementList, asVector, broadcast, broadcastLike, broadcastLike, broadcastLike, clamp, clampMax, clampMin, 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, elementSquaredSum, elementSum, 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, isMutable, isRangeZero, isSameShape, isUnitLengthVector, isUnitLengthVector, isView, isZero, iterator, join, join, join, log, logistic, magnitude, magnitudeSquared, maxAbsElement, maxAbsElementIndex, maxElement, maxElementIndex, minElement, minElementIndex, multiply, multiply, multiply, multiplyCopy, multiplyCopy, multiplyCopy, multiplyTo, mutable, negate, negateCopy, nonSparseIndex, nonZeroCount, nonZeroIndices, nonZeroValues, normalise, normaliseCopy, normaliseMaxAbsElement, outerProduct, outerProduct, pow, 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, setApplyOp, setApplyOp, setApplyOp, setElements, setElements, setElements, setInnerProduct, setInnerProduct, setInnerProduct, setMultiple, setMultiple, setMultiple, setMultiple, setSparse, setSparse, setSparse, shiftCopy, signum, slice, sliceValue, softmax, softmaxCopy, sparse, sparseClone, sqrtCopy, square, squareCopy, sub, subArray, subAt, subCopy, subCopy, subMultiple, subVector, 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, 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
addApplyOp, addInnerProduct, addOuterProduct, addOuterProductSparse, addSparse, broadcastCloneLike, broadcastCopyLike, componentCount, ensureMutable, epsilonEquals, exp, get, get, getComponent, getComponents, getElements, getElements, getSlices, getSliceViews, isBoolean, isDense, isSparse, scale, set, set, signumCopy, sqrt, sub, withComponents
-
-
-
-
Constructor Detail
-
MatrixRowView
public MatrixRowView(AMatrix aMatrix, int row)
-
-
Method Detail
-
get
public double get(int i)
Description copied from interface:INDArrayReturns the double value at the specified position in a 1D vector
-
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
-
set
public void set(int i, double value)Description copied from interface:INDArraySets a value at a given position in a mutable 1D array
-
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
-
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
-
exactClone
public MatrixRowView 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
-
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
-
clone
public AVector clone()
Description copied from class:AVectorClones the vector, creating a new mutable copy of all data. The clone is: - not guaranteed to be of the same type. - guaranteed to be fully mutable - guaranteed not to contain a reference (i.e. is a full deep copy)
-
equals
public boolean equals(AVector v)
Description copied from class:AbstractArrayReturns true if this array is exactly equal to a vector.- Overrides:
equalsin classAMatrixViewVector- Returns:
-
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
-
applyOp
public void applyOp(Op op)
Description copied from interface:INDArrayApplies a unary operator to all elements of the array (in-place)
-
applyOp
public void applyOp(Op2 op, AVector v)
Description copied from class:AVectorApplies a binary operator to this vector and a second vector
-
applyOp
public void applyOp(Op2 op, double v)
Description copied from interface:INDArrayApplies a binary operator to this array and a double value. Works as if the double value was broadcast to the shape of this array.
-
multiply
public void multiply(double factor)
Description copied from class:AVectorMultiplies the vector by a constant factor
-
multiply
public void multiply(AVector v)
Description copied from class:AVectorMultiplies this vector by another vector, elementwise.
-
add
public void add(AVector v)
Description copied from class:AVectorAdds another vector to this one
-
addMultiple
public void addMultiple(AVector v, double factor)
Description copied from class:AVectorAdds a scaled multiple of another vector to this vector- Overrides:
addMultiplein classAVector
-
sub
public void sub(AVector v)
Description copied from class:AVectorSubtracts a vector from this vector
-
set
public void set(AVector v)
Description copied from class:AVectorSets the vector to equal the value of another vector
-
-
DMelt 3.0 © DataMelt by jWork.ORG