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, zero
Fields 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.double
get
(int index) double
getQuick
(int index) like
(int s) like2D
(int rows, int columns) void
setQuick
(int column, double value) toString()
protected DoubleMatrix1D
viewSelectionLike
(int[] offsets) double
double
zSum()
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, zDotProduct
Methods inherited from class cern.colt.matrix.impl.AbstractMatrix1D
_offset, _rank, checkIndex, checkIndexes, checkRange, checkSize, checkSize, index, setUp, setUp, size, stride, toStringShort, vFlip, vPart, vStrides
Methods inherited from class cern.colt.matrix.impl.AbstractMatrix
ensureCapacity, isView, trimToSize
Methods 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:
assign
in 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:
assign
in classDoubleMatrix1D
- See Also:
-
get
public double get(int index) - Overrides:
get
in classDoubleMatrix1D
-
getQuick
public double getQuick(int index) - Specified by:
getQuick
in classDoubleMatrix1D
-
like
- Specified by:
like
in classDoubleMatrix1D
-
like2D
- Specified by:
like2D
in classDoubleMatrix1D
-
setQuick
public void setQuick(int column, double value) - Specified by:
setQuick
in classDoubleMatrix1D
-
toString
- Overrides:
toString
in classDoubleMatrix1D
-
zDotProduct
- Overrides:
zDotProduct
in classDoubleMatrix1D
-
zSum
public double zSum()- Overrides:
zSum
in classDoubleMatrix1D
-
viewSelectionLike
- Specified by:
viewSelectionLike
in classDoubleMatrix1D
-