Package org.ujmp.core.io
Class ImportMatrixM
java.lang.Object
org.ujmp.core.io.ImportMatrixM
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Matrix
static Matrix
fromReader
(Reader reader, Object... parameters) static Matrix
fromStream
(InputStream stream, Object... parameters) static Matrix
fromString
(String string, Object... parameters) Creates a DefaultDenseStringMatrix2D from a given String.
-
Constructor Details
-
ImportMatrixM
public ImportMatrixM()
-
-
Method Details
-
fromString
Creates a DefaultDenseStringMatrix2D from a given String. The string contains the rows of the matrix separated by semicolons or new lines. The columns of the matrix are separated by spaces or commas. All types of brackets are ignored.Examples: "[1 2 3; 4 5 6]" or "(test1,test2);(test3,test4)"
- Parameters:
string
- the string to parse- Returns:
- a StringMatrix with the desired values
-
fromFile
- Throws:
IOException
-
fromStream
- Throws:
IOException
-
fromReader
- Throws:
IOException
-