|
ContactCenters V. 0.9.9. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectumontreal.iro.lecuyer.contactcenters.MatrixUtil
public class MatrixUtil
Contains utility methods to add rows or columns to matrices, and to construct a matrix by repeating a submatrix several times.
Method Summary | |
---|---|
static DoubleMatrix2D |
addSumColumn(DoubleMatrix2D m)
Equivalent to addSumColumn
(m, false). |
static DoubleMatrix2D |
addSumColumn(DoubleMatrix2D m,
boolean always)
This method, similar to addSumRow(DoubleMatrix2D,boolean) , adds
an extra column to the matrix m for the sum of each column. |
static DoubleMatrix2D |
addSumRow(DoubleMatrix2D m)
Equivalent to addSumRow
(m, false). |
static DoubleMatrix2D |
addSumRow(DoubleMatrix2D m,
boolean always)
Makes a copy of the matrix m with a new row containing the sum of each column. |
static DoubleMatrix2D |
getCost(DoubleMatrix2D m,
double[] cost)
Converts the matrix m into a matrix of costs using the cost vector cost. |
static DoubleMatrix2D |
repMat(DoubleMatrix2D m,
int numRows,
int numCols)
Constructs a matrix by copying m a certain number of times. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static DoubleMatrix2D getCost(DoubleMatrix2D m, double[] cost)
m
- the matrix of values.cost
- the cost vector.
IllegalArgumentException
- if the length of cost does not correspond to
m.rows() or m.rows() - 1.public static DoubleMatrix2D addSumRow(DoubleMatrix2D m)
addSumRow
(m, false).
m
- the matrix being processed.
public static DoubleMatrix2D addSumRow(DoubleMatrix2D m, boolean always)
m
- the matrix being processed.always
- if true, the row is added even if m has one row.
public static DoubleMatrix2D addSumColumn(DoubleMatrix2D m)
addSumColumn
(m, false).
m
- the matrix being processed.
public static DoubleMatrix2D addSumColumn(DoubleMatrix2D m, boolean always)
addSumRow(DoubleMatrix2D,boolean)
, adds
an extra column to the matrix m for the sum of each column.
m
- the matrix being processed.always
- determines if the column is always added.
public static DoubleMatrix2D repMat(DoubleMatrix2D m, int numRows, int numCols)
m
- the matrix to be tiled.numRows
- the number of rows containing copies of m.numCols
- the number of columns containing copies of m.
|
ContactCenters V. 0.9.9. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |