Package org.ujmp.core.util
Class Octave
- java.lang.Object
-
- org.ujmp.core.util.Octave
-
public class Octave extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private java.io.BufferedReader
error
private java.io.BufferedReader
input
static int
MAXPOLLS
private static Octave
octave
private java.lang.Process
octaveProcess
private java.io.BufferedWriter
output
private static java.lang.String
pathToOctave
static int
POLLINTERVAL
private boolean
running
static java.lang.String[]
SEARCH
-
Constructor Summary
Constructors Modifier Constructor Description private
Octave(java.lang.String pathToOctave)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
bar(Matrix matrix, java.lang.String... format)
void
bar(Matrix x, Matrix y, java.lang.String... format)
void
contour(Matrix z, Matrix n, Matrix x, Matrix y, java.lang.String... format)
java.lang.String
execute(java.lang.String command)
private static java.lang.String
findOctave()
double
getDouble(java.lang.String label)
float
getFloat(java.lang.String label)
private java.lang.String
getFromOctave()
static Octave
getInstance()
static Octave
getInstance(java.lang.String pathToOctave)
int
getInt(java.lang.String label)
long
getLong(java.lang.String label)
Matrix
getMatrix(java.lang.String label)
void
hist(Matrix matrix, java.lang.String... format)
void
hist(Matrix x, Matrix y, java.lang.String... format)
static boolean
isAvailable()
void
loglog(Matrix matrix, java.lang.String... format)
void
loglog(Matrix x, Matrix y, java.lang.String... format)
void
mesh(Matrix x, Matrix y, Matrix z, java.lang.String... format)
void
plot(Matrix matrix, java.lang.String... format)
void
plot(Matrix x, Matrix y, java.lang.String... format)
void
polar(Matrix theta, Matrix rho, java.lang.String... format)
void
semilogx(Matrix matrix, java.lang.String... format)
void
semilogx(Matrix x, Matrix y, java.lang.String... format)
void
semilogy(Matrix matrix, java.lang.String... format)
void
semilogy(Matrix x, Matrix y, java.lang.String... format)
private void
sendToOctave(java.lang.String command)
void
setDouble(java.lang.String label, double value)
void
setFloat(java.lang.String label, float value)
void
setInt(java.lang.String label, int value)
void
setLong(java.lang.String label, long value)
void
setMatrix(java.lang.String label, Matrix matrix)
void
shutdown()
void
stairs(Matrix matrix, java.lang.String... format)
void
stairs(Matrix x, Matrix y, java.lang.String... format)
static java.lang.String
toString(java.lang.String[] strings)
-
-
-
Field Detail
-
SEARCH
public static java.lang.String[] SEARCH
-
POLLINTERVAL
public static final int POLLINTERVAL
- See Also:
- Constant Field Values
-
MAXPOLLS
public static final int MAXPOLLS
- See Also:
- Constant Field Values
-
input
private java.io.BufferedReader input
-
output
private java.io.BufferedWriter output
-
error
private java.io.BufferedReader error
-
octaveProcess
private java.lang.Process octaveProcess
-
running
private boolean running
-
octave
private static Octave octave
-
pathToOctave
private static java.lang.String pathToOctave
-
-
Method Detail
-
getInstance
public static Octave getInstance() throws java.lang.Exception
- Throws:
java.lang.Exception
-
getInstance
public static Octave getInstance(java.lang.String pathToOctave) throws java.lang.Exception
- Throws:
java.lang.Exception
-
getFromOctave
private java.lang.String getFromOctave() throws java.lang.Exception
- Throws:
java.lang.Exception
-
execute
public java.lang.String execute(java.lang.String command) throws java.lang.Exception
- Throws:
java.lang.Exception
-
shutdown
public void shutdown() throws java.lang.Exception
- Throws:
java.lang.Exception
-
sendToOctave
private void sendToOctave(java.lang.String command) throws java.lang.Exception
- Throws:
java.lang.Exception
-
setMatrix
public void setMatrix(java.lang.String label, Matrix matrix) throws java.lang.Exception
- Throws:
java.lang.Exception
-
findOctave
private static java.lang.String findOctave()
-
getMatrix
public Matrix getMatrix(java.lang.String label) throws java.lang.Exception
- Throws:
java.lang.Exception
-
isAvailable
public static boolean isAvailable()
-
plot
public void plot(Matrix matrix, java.lang.String... format) throws java.lang.Exception
- Throws:
java.lang.Exception
-
loglog
public void loglog(Matrix matrix, java.lang.String... format) throws java.lang.Exception
- Throws:
java.lang.Exception
-
semilogx
public void semilogx(Matrix matrix, java.lang.String... format) throws java.lang.Exception
- Throws:
java.lang.Exception
-
semilogy
public void semilogy(Matrix matrix, java.lang.String... format) throws java.lang.Exception
- Throws:
java.lang.Exception
-
bar
public void bar(Matrix matrix, java.lang.String... format) throws java.lang.Exception
- Throws:
java.lang.Exception
-
stairs
public void stairs(Matrix matrix, java.lang.String... format) throws java.lang.Exception
- Throws:
java.lang.Exception
-
hist
public void hist(Matrix matrix, java.lang.String... format) throws java.lang.Exception
- Throws:
java.lang.Exception
-
plot
public void plot(Matrix x, Matrix y, java.lang.String... format) throws java.lang.Exception
- Throws:
java.lang.Exception
-
loglog
public void loglog(Matrix x, Matrix y, java.lang.String... format) throws java.lang.Exception
- Throws:
java.lang.Exception
-
semilogx
public void semilogx(Matrix x, Matrix y, java.lang.String... format) throws java.lang.Exception
- Throws:
java.lang.Exception
-
semilogy
public void semilogy(Matrix x, Matrix y, java.lang.String... format) throws java.lang.Exception
- Throws:
java.lang.Exception
-
bar
public void bar(Matrix x, Matrix y, java.lang.String... format) throws java.lang.Exception
- Throws:
java.lang.Exception
-
stairs
public void stairs(Matrix x, Matrix y, java.lang.String... format) throws java.lang.Exception
- Throws:
java.lang.Exception
-
hist
public void hist(Matrix x, Matrix y, java.lang.String... format) throws java.lang.Exception
- Throws:
java.lang.Exception
-
polar
public void polar(Matrix theta, Matrix rho, java.lang.String... format) throws java.lang.Exception
- Throws:
java.lang.Exception
-
contour
public void contour(Matrix z, Matrix n, Matrix x, Matrix y, java.lang.String... format) throws java.lang.Exception
- Throws:
java.lang.Exception
-
mesh
public void mesh(Matrix x, Matrix y, Matrix z, java.lang.String... format) throws java.lang.Exception
- Throws:
java.lang.Exception
-
toString
public static java.lang.String toString(java.lang.String[] strings)
-
getDouble
public double getDouble(java.lang.String label) throws java.lang.Exception
- Throws:
java.lang.Exception
-
getLong
public long getLong(java.lang.String label) throws java.lang.Exception
- Throws:
java.lang.Exception
-
getInt
public int getInt(java.lang.String label) throws java.lang.Exception
- Throws:
java.lang.Exception
-
getFloat
public float getFloat(java.lang.String label) throws java.lang.Exception
- Throws:
java.lang.Exception
-
setDouble
public void setDouble(java.lang.String label, double value) throws java.lang.Exception
- Throws:
java.lang.Exception
-
setFloat
public void setFloat(java.lang.String label, float value) throws java.lang.Exception
- Throws:
java.lang.Exception
-
setInt
public void setInt(java.lang.String label, int value) throws java.lang.Exception
- Throws:
java.lang.Exception
-
setLong
public void setLong(java.lang.String label, long value) throws java.lang.Exception
- Throws:
java.lang.Exception
-
-