chkwon / PATHSolver.jl

provides a Julia wrapper for the PATH Solver for solving mixed complementarity problems
http://pages.cs.wisc.edu/%7Eferris/path.html
MIT License
51 stars 15 forks source link

disable output completely #34

Closed aharoun closed 5 years ago

aharoun commented 5 years ago

I wonder if it is possible to kill the output completely when using solveLCP. Even with options(output=:no), it prints some results. I suspect printing options are embedded in the source library and one may not have access to it, still wanted to ask.

chkwon commented 5 years ago

Indeed they are from the source library.

You may try something like

rd, wr = redirect_stdout()
for i=1:10
    z, f = solveMCP(myfunc, lb, ub)
end
close(rd)
close(wr)

But I'm not sure how I can recover the original stdout.

aharoun commented 5 years ago

Thanks! Actually I tried something similar but couldn't succeed.

arnavs commented 5 years ago

I've been using Suppressor for this.

arg1, arg2, arg3, ... = @suppress solveLCP(args...)
chkwon commented 5 years ago

@arnavs This is cool! Thanks!