|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.optimizationservices.oscommon.util.CommonUtil
public class CommonUtil
The CommonUtil
class contains methods for performing
common basic operations used by many classes in the
Optimization Services (OS) framework.
Constructor Summary | |
---|---|
CommonUtil()
Constructor. |
Method Summary | |
---|---|
static boolean |
checkOSRepository()
check the OSRepository from the information given in OSRepository.xml and print out relevant information. |
static java.util.GregorianCalendar |
createNativeDateTime(long timeMillis)
create the native dateTime from a the timeMillis, which is the millisecond since 1/1/1970. |
static boolean |
createOSRepository()
Create the OSRepository from the information given in OSRepository.xml. |
static java.lang.String |
getJobID(java.lang.String option)
|
static boolean |
isNegativeInfinity(java.lang.String numberString)
Check whether a number string is negative infinity or not, including the following (case insensitive): -infinity, -inf, |
static boolean |
isPostiveInfinity(java.lang.String numberString)
Check whether a number string is positive infinity or not, including the following (case insensitive): infinity, inf, |
static void |
main(java.lang.String[] argv)
main for test purposes. |
static boolean |
mpsToOSiL(java.lang.String mpsFileName,
java.lang.String osilFileName,
java.lang.String instanceName,
java.lang.String instanceSource,
java.lang.String instanceDescription)
Write the sparse coefficient matrix related elements in an OSiL xml file. |
static java.util.Vector<java.lang.String> |
stringToVector(java.lang.String string,
java.lang.String delimiters)
Converts a delimited string to a vector. |
static boolean[] |
vectorToBolArray(java.util.Vector v)
Converts a vector of boolean to a boolean array. |
static char[] |
vectorToChaArray(java.util.Vector v)
Converts a vector of characters to a character array. |
static double[] |
vectorToDblArray(java.util.Vector v)
Converts a vector of doubles to a double array. |
static int[] |
vectorToIntArray(java.util.Vector v)
Converts a vector of integers to an integer array. |
static java.lang.String[] |
vectorToStrArray(java.util.Vector v)
Converts a vector of strings to a string array. |
static java.lang.String |
vectorToString(java.util.Vector vector,
char delimiter)
Converts a vector to a string, delimited by a specified delimiter. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CommonUtil()
Method Detail |
---|
public static java.lang.String getJobID(java.lang.String option)
public static int[] vectorToIntArray(java.util.Vector v)
v
- The vector to be converted.
public static double[] vectorToDblArray(java.util.Vector v)
v
- the vector to be converted.
public static java.lang.String[] vectorToStrArray(java.util.Vector v)
v
- the vector to be converted.
public static boolean[] vectorToBolArray(java.util.Vector v)
v
- the vector to be converted.
public static char[] vectorToChaArray(java.util.Vector v)
v
- the vector to be converted.
public static java.util.Vector<java.lang.String> stringToVector(java.lang.String string, java.lang.String delimiters)
string
- holds the string to be converted to a vector.delimiter
- holds the delimiters of the string.
public static java.lang.String vectorToString(java.util.Vector vector, char delimiter)
vector
- holds the vector to be converted to a string.delimiter
- holds the delimiter character to put in the converted string.
public static boolean isPostiveInfinity(java.lang.String numberString)
numberString
- holds the number string to be checked.
public static boolean isNegativeInfinity(java.lang.String numberString)
numberString
- holds the number string to be checked.
public static boolean checkOSRepository()
public static boolean createOSRepository()
public static boolean mpsToOSiL(java.lang.String mpsFileName, java.lang.String osilFileName, java.lang.String instanceName, java.lang.String instanceSource, java.lang.String instanceDescription)
The coefMatrix (AMatrix) stores all the information in the A part of Ax ~ b, i.e. the linear part of all constraints
isColumnMajor
- holds the value of whether the coefMatrix (AMatrix) holding linear constraint data is stored
by column. If false, the matrix is stored by row.nonzeroValues
- holds the values of the vector element value in coefMatrix (AMatrix), which contains nonzero elements.nonzeroIndexes
- holds the values of the vector element rowIdx or colIdx in coefMatrix (AMatrix). If the matrix is
stored by column (row), rowIdx (colIdx) is the vector of row (column) indexes.startIndexes
- holds the values of the vector element start in coefMatrix (AMatrix), which points to the start of a
column (row) of nonzero elements in coefMatrix (AMatrix).mpsFileName
- holds the name of the file to be written to. The path is fixed at the xml folder of the impact project.name
- source
- description
-
public static java.util.GregorianCalendar createNativeDateTime(long timeMillis)
timeMillis
- holds the time represented in milliseconds since 1/1/1970.
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 |