|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.optimizationservices.oscommon.util.MathUtil
public class MathUtil
The MathUtil class contains methods for performing
mathematics related operations used by many classes in the
Optimization Services (OS) framework.
| Constructor Summary | |
|---|---|
MathUtil()
Constructor. |
|
| Method Summary | |
|---|---|
static SparseMatrix |
convertLinearConstraintCoefficientMatrixToTheOtherMajor(boolean isColumnMajor,
int[] start,
int[] index,
double[] value,
int dimension)
convert linear constraint coefficient matrix (row or column major) to the other major (column or row) |
static void |
main(java.lang.String[] argv)
main for test purposes. |
static double |
mod(double x,
double y)
Calculation of x mod y. |
static double |
round(double x,
int precision)
Round a double number to the precision specified. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MathUtil()
| Method Detail |
|---|
public static double round(double x,
int precision)
x - holds the number to be rounded.precision - holds the number of digit after (or before if negative) the decimal point.
public static double mod(double x,
double y)
x - holds the number before the mod operator.y - holds the number after the mod operator.
public static SparseMatrix convertLinearConstraintCoefficientMatrixToTheOtherMajor(boolean isColumnMajor,
int[] start,
int[] index,
double[] value,
int dimension)
isColumnMajor - holds whether the coefMatrix (AMatrix) holding linear program
data is stored by column. If false, the matrix is stored by row.start - holds an integer array of start elements in coefMatrix (AMatrix),
which points to the start of a column (row) of nonzero elements in coefMatrix (AMatrix).index - holds an integer array of rowIdx (or colIdx) elements in coefMatrix (AMatrix).
If the matrix is stored by column (row), rowIdx (colIdx) is the array of row (column) indices.value - holds a double array of value elements in coefMatrix (AMatrix),
which contains nonzero elements.dimension - holds the column count if the input matrix is row major (row count = start.length-1)
or the row number if the input matrix is column major (columnh count = start.length -1)
public static void main(java.lang.String[] argv)
argv - command line arguments.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||