Class RCDoubleMatrix1D
java.lang.Object
cern.colt.PersistentObject
cern.colt.matrix.impl.AbstractMatrix
cern.colt.matrix.impl.AbstractMatrix1D
cern.colt.matrix.DoubleMatrix1D
ubic.basecode.dataStructure.matrix.RCDoubleMatrix1D
- All Implemented Interfaces:
Serializable,Cloneable
A row-compressed 1D matrix. The only deviation from the contract of DoubleMatrix1D is in apply(), which only operates
on the non-empty (0) elements. This implementation has a highly optimized dot product computer. If you need to
compute the dot product of a RCDoubleMatrix1D with another DoubleMatrix1D, call zDotProduct on this, not on the
other. This is because getQuick() and setQuick() are not very fast for this.
- Author:
- pavlidis
- See Also:
-
Field Summary
FieldsFields inherited from class cern.colt.matrix.impl.AbstractMatrix1D
size, stride, zeroFields inherited from class cern.colt.matrix.impl.AbstractMatrix
isNoView -
Constructor Summary
ConstructorsConstructorDescriptionRCDoubleMatrix1D(double[] values) RCDoubleMatrix1D(int length) RCDoubleMatrix1D(IntArrayList indexes, DoubleArrayList values) -
Method Summary
Modifier and TypeMethodDescriptionassign(double[] v) assign(DoubleFunction function) WARNING this only assigns to the non-empty values, for performance reasons.doubleget(int index) doublegetQuick(int index) like(int s) like2D(int rows, int columns) voidsetQuick(int column, double value) toString()protected DoubleMatrix1DviewSelectionLike(int[] offsets) doubledoublezSum()Methods inherited from class cern.colt.matrix.DoubleMatrix1D
aggregate, aggregate, assign, assign, assign, assign, cardinality, cardinality, copy, equals, equals, getContent, getNonZeros, getNonZeros, haveSharedCells, haveSharedCellsRaw, like, set, swap, toArray, toArray, view, viewFlip, viewPart, viewSelection, viewSelection, viewSorted, viewStrides, zDotProduct, zDotProduct, zDotProductMethods inherited from class cern.colt.matrix.impl.AbstractMatrix1D
_offset, _rank, checkIndex, checkIndexes, checkRange, checkSize, checkSize, index, setUp, setUp, size, stride, toStringShort, vFlip, vPart, vStridesMethods inherited from class cern.colt.matrix.impl.AbstractMatrix
ensureCapacity, isView, trimToSizeMethods inherited from class cern.colt.PersistentObject
clone
-
Field Details
-
indexes
-
values
-
-
Constructor Details
-
RCDoubleMatrix1D
public RCDoubleMatrix1D(double[] values) - Parameters:
values-
-
RCDoubleMatrix1D
public RCDoubleMatrix1D(int length) - Parameters:
length-
-
RCDoubleMatrix1D
- Parameters:
indexes- These MUST be in sorted order.values- These MuST be in the same order as the indexes, meaning that indexes[0] is the column for values[0].
-
-
Method Details
-
assign
- Overrides:
assignin classDoubleMatrix1D
-
assign
WARNING this only assigns to the non-empty values, for performance reasons. If you need to assign to any index, you have to use another way.- Overrides:
assignin classDoubleMatrix1D- See Also:
-
get
public double get(int index) - Overrides:
getin classDoubleMatrix1D
-
getQuick
public double getQuick(int index) - Specified by:
getQuickin classDoubleMatrix1D
-
like
- Specified by:
likein classDoubleMatrix1D
-
like2D
- Specified by:
like2Din classDoubleMatrix1D
-
setQuick
public void setQuick(int column, double value) - Specified by:
setQuickin classDoubleMatrix1D
-
toString
- Overrides:
toStringin classDoubleMatrix1D
-
zDotProduct
- Overrides:
zDotProductin classDoubleMatrix1D
-
zSum
public double zSum()- Overrides:
zSumin classDoubleMatrix1D
-
viewSelectionLike
- Specified by:
viewSelectionLikein classDoubleMatrix1D
-