Minor patch to the Matlab interface

This commit is contained in:
Marcel Kronfeld
2008-12-10 10:27:54 +00:00
parent 302ca1e02b
commit 2cb9db4a9d
2 changed files with 10 additions and 4 deletions

View File

@@ -140,12 +140,15 @@ public class MatlabProblem extends AbstractOptimizationProblem implements Interf
*/
public void setDebugOut(boolean swtch, String fname) {
TRACE=swtch;
// System.err.println("setDebugOut: " + swtch +" " + fname);
if (!swtch && (dos != null)) {
dos.close();
dos = null;
} else if ((dos == null) && swtch) {
} else if (swtch && (dos == null)) {
try {
dos = new PrintStream(new FileOutputStream(fname==null ? defTestOut : fname));
if (fname==null || (fname.length()==0)) fname = defTestOut;
// System.err.println("Opening "+fname);
dos = new PrintStream(new FileOutputStream(fname));
} catch (FileNotFoundException e) {
e.printStackTrace();
}