Package math.matrix.expressParser
Class MatrixValueParser
java.lang.Object
math.matrix.expressParser.MatrixValueParser
Objects of this class extract a matrix from an input expression of the
format:
[num1,num2,...:num_i,num_i+1,....:num_j,num_j+1...: ] e.g [2,3,4:4,1,2:...]
The colons represent the end of one row of values and the beginning of
another.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
valid
private boolean valid -
values
-
scan
-
size
The size of the matrix
-
-
Constructor Details
-
MatrixValueParser
public MatrixValueParser() -
MatrixValueParser
- Parameters:
values
- A matrix value string e.g [2,4,5:3,9.939,45.2:1,4,2:]
-
-
Method Details
-
scanner
Scans a matrix value string into tokens, e.g [2,4,5:3,9.939,45.2:1,4,2] and produces an output containing the numbers and the colons in the ArrayList attribute scan. Method getMatrix then extracts the matrix from scan.- Throws:
MatrixFormatException
- if the format of the input does not conform to that of a matrix.
-
setValues
-
getValues
-
setValid
public void setValid(boolean valid) -
isValid
public boolean isValid() -
getSize
-
setScan
-
getScan
-
getMatrix
- Returns:
- a Matrix object from the scanned values.
- Throws:
NullPointerException
-
getPrecisionMatrix
- Returns:
- a PrecisionMatrix object from the scanned values.
- Throws:
NullPointerException
-