Package se.hb.jcp.bindings.opencv
Class DenseDoubleMatrix1D
- java.lang.Object
-
- cern.colt.PersistentObject
-
- cern.colt.matrix.impl.AbstractMatrix
-
- cern.colt.matrix.impl.AbstractMatrix1D
-
- cern.colt.matrix.DoubleMatrix1D
-
- se.hb.jcp.bindings.opencv.DenseDoubleMatrix1D
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable
public class DenseDoubleMatrix1D extends cern.colt.matrix.DoubleMatrix1DClass for dense 1-d matrices (aka vectors) holding double elements in the dense format used by OpenCV. See the documentation for OpenCV for more details.- Author:
- anders.gidenstam(at)hb.se
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DenseDoubleMatrix1D(double[] values)Constructs a matrix with a copy of the given values.DenseDoubleMatrix1D(int columns)Constructs a matrix with a given number of columns.DenseDoubleMatrix1D(int columns, int[] indices, double[] values)Constructs a matrix with a copy of the given values.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description cern.colt.matrix.DoubleMatrix1Dassign(cern.colt.matrix.DoubleMatrix1D other)Replaces all cell values of the receiver with the values of another matrix.doublegetQuick(int column)Returns the matrix cell value at coordinate column.cern.colt.matrix.DoubleMatrix1Dlike(int size)Construct and returns a new empty matrix of the same dynamic type as the receiver, having the specified size.cern.colt.matrix.DoubleMatrix2Dlike2D(int rows, int columns)Construct and returns a new 2-d matrix of the corresponding dynamic type, entirelly independent of the receiver.voidsetQuick(int index, double value)Sets the matrix cell at coordinate index to the specified value.protected cern.colt.matrix.DoubleMatrix1DviewSelectionLike(int[] offsets)Construct and returns a new selection view.-
Methods inherited from class cern.colt.matrix.DoubleMatrix1D
aggregate, aggregate, assign, assign, assign, assign, assign, cardinality, cardinality, copy, equals, equals, get, getContent, getNonZeros, getNonZeros, haveSharedCells, haveSharedCellsRaw, like, set, swap, toArray, toArray, toString, view, viewFlip, viewPart, viewSelection, viewSelection, viewSorted, viewStrides, zDotProduct, zDotProduct, zDotProduct, zDotProduct, zSum
-
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
-
DenseDoubleMatrix1D
public DenseDoubleMatrix1D(double[] values)
Constructs a matrix with a copy of the given values. The values are copied. So subsequent changes in values are not reflected in the matrix, and vice-versa.- Parameters:
values- the values to be filled into the new matrix.
-
DenseDoubleMatrix1D
public DenseDoubleMatrix1D(int columns, int[] indices, double[] values)Constructs a matrix with a copy of the given values. The values are copied. So subsequent changes in values are not reflected in the matrix, and vice-versa. All other entries are initially 0.- Parameters:
columns- the number of columns the matrix shall have.indices- the indices to be filled in the new matrix.values- the values to be filled into the new matrix.
-
DenseDoubleMatrix1D
public DenseDoubleMatrix1D(int columns)
Constructs a matrix with a given number of columns. All entries are initially 0.- Parameters:
columns- the number of columns the matrix shall have.- Throws:
java.lang.IllegalArgumentException- if columns<0 || columns > Integer.MAX_VALUE.
-
-
Method Detail
-
assign
public cern.colt.matrix.DoubleMatrix1D assign(cern.colt.matrix.DoubleMatrix1D other)
Replaces all cell values of the receiver with the values of another matrix. Both matrices must have the same size. If both matrices share the same cells (as is the case if they are views derived from the same matrix) and intersect in an ambiguous way, then replaces as if using an intermediate auxiliary deep copy of other.- Overrides:
assignin classcern.colt.matrix.DoubleMatrix1D- Parameters:
other- the source matrix to copy from (may be identical to the receiver).- Returns:
- this (for convenience only).
- Throws:
java.lang.IllegalArgumentException- if size() != other.size().
-
like
public cern.colt.matrix.DoubleMatrix1D like(int size)
Construct and returns a new empty matrix of the same dynamic type as the receiver, having the specified size. For example, if the receiver is an instance of type DenseDoubleMatrix1D the new matrix must also be of type DenseDoubleMatrix1D, if the receiver is an instance of type SparseDoubleMatrix1D the new matrix must also be of type SparseDoubleMatrix1D, etc. In general, the new matrix should have internal parametrization as similar as possible.- Specified by:
likein classcern.colt.matrix.DoubleMatrix1D- Parameters:
size- the number of cell the matrix shall have.- Returns:
- a new empty matrix of the same dynamic type.
-
like2D
public cern.colt.matrix.DoubleMatrix2D like2D(int rows, int columns)Construct and returns a new 2-d matrix of the corresponding dynamic type, entirelly independent of the receiver. For example, if the receiver is an instance of type DenseDoubleMatrix1D the new matrix must be of type DenseDoubleMatrix2D, if the receiver is an instance of type SparseDoubleMatrix1D the new matrix must be of type SparseDoubleMatrix2D, etc.- Specified by:
like2Din classcern.colt.matrix.DoubleMatrix1D- Parameters:
rows- the number of rows the matrix shall have.columns- the number of columns the matrix shall have.- Returns:
- a new matrix of the corresponding dynamic type.
-
getQuick
public double getQuick(int column)
Returns the matrix cell value at coordinate column.Provided with invalid parameters this method may return invalid objects without throwing any exception. You should only use this method when you are absolutely sure that the coordinate is within bounds. Precondition (unchecked): 0 <= column < size().
- Specified by:
getQuickin classcern.colt.matrix.DoubleMatrix1D- Parameters:
column- the index of the column-coordinate.- Returns:
- the value at the specified coordinate.
-
setQuick
public void setQuick(int index, double value)Sets the matrix cell at coordinate index to the specified value.Provided with invalid parameters this method may access illegal indexes wi thout throwing any exception. You should only use this method when you are absolutely sure that the coordinate is within bounds. Precondition (unchecked): index<0 || index>=size().
- Specified by:
setQuickin classcern.colt.matrix.DoubleMatrix1D- Parameters:
index- the index of the cell.value- the value to be filled into the specified cell.
-
viewSelectionLike
protected cern.colt.matrix.DoubleMatrix1D viewSelectionLike(int[] offsets)
Construct and returns a new selection view.- Specified by:
viewSelectionLikein classcern.colt.matrix.DoubleMatrix1D- Parameters:
offsets- the offsets of the visible elements.- Returns:
- a new view.
-
-