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
public class RCDoubleMatrix1D extends cern.colt.matrix.DoubleMatrix1D
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:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description RCDoubleMatrix1D(double[] values)
RCDoubleMatrix1D(int length)
RCDoubleMatrix1D(cern.colt.list.IntArrayList indexes, cern.colt.list.DoubleArrayList values)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description cern.colt.matrix.DoubleMatrix1D
assign(double[] v)
cern.colt.matrix.DoubleMatrix1D
assign(cern.colt.function.DoubleFunction function)
WARNING this only assigns to the non-empty values, for performance reasons.double
get(int index)
double
getQuick(int index)
cern.colt.matrix.DoubleMatrix1D
like(int s)
cern.colt.matrix.DoubleMatrix2D
like2D(int rows, int columns)
void
setQuick(int column, double value)
String
toString()
protected cern.colt.matrix.DoubleMatrix1D
viewSelectionLike(int[] offsets)
double
zDotProduct(cern.colt.matrix.DoubleMatrix1D y)
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
-
-
-
-
Constructor Detail
-
RCDoubleMatrix1D
public RCDoubleMatrix1D(double[] values)
- Parameters:
values
-
-
RCDoubleMatrix1D
public RCDoubleMatrix1D(int length)
- Parameters:
length
-
-
RCDoubleMatrix1D
public RCDoubleMatrix1D(cern.colt.list.IntArrayList indexes, cern.colt.list.DoubleArrayList values)
- 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 Detail
-
assign
public cern.colt.matrix.DoubleMatrix1D assign(double[] v)
- Overrides:
assign
in classcern.colt.matrix.DoubleMatrix1D
-
assign
public cern.colt.matrix.DoubleMatrix1D assign(cern.colt.function.DoubleFunction function)
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 classcern.colt.matrix.DoubleMatrix1D
- See Also:
DoubleMatrix1D.assign(cern.colt.function.DoubleFunction)
-
get
public double get(int index)
- Overrides:
get
in classcern.colt.matrix.DoubleMatrix1D
-
getQuick
public double getQuick(int index)
- Specified by:
getQuick
in classcern.colt.matrix.DoubleMatrix1D
-
like
public cern.colt.matrix.DoubleMatrix1D like(int s)
- Specified by:
like
in classcern.colt.matrix.DoubleMatrix1D
-
like2D
public cern.colt.matrix.DoubleMatrix2D like2D(int rows, int columns)
- Specified by:
like2D
in classcern.colt.matrix.DoubleMatrix1D
-
setQuick
public void setQuick(int column, double value)
- Specified by:
setQuick
in classcern.colt.matrix.DoubleMatrix1D
-
toString
public String toString()
- Overrides:
toString
in classcern.colt.matrix.DoubleMatrix1D
-
zDotProduct
public double zDotProduct(cern.colt.matrix.DoubleMatrix1D y)
- Overrides:
zDotProduct
in classcern.colt.matrix.DoubleMatrix1D
-
zSum
public double zSum()
- Overrides:
zSum
in classcern.colt.matrix.DoubleMatrix1D
-
viewSelectionLike
protected cern.colt.matrix.DoubleMatrix1D viewSelectionLike(int[] offsets)
- Specified by:
viewSelectionLike
in classcern.colt.matrix.DoubleMatrix1D
-
-