π More than cross-platform Octave process wrapper π¬
If you encounter 'OctaveScriptError' it most likely means that your script is wrong due to some syntax error. Please, debug the generated script in Octave before creating issue in this repository. I can only assist you with problems related to this library but I can't provide Octave related support.
Octave (matlab) has excellent library of ready to use components and lets us write simpler code for solving complex mathematical problems. This library is an attempt to bridge Octave and .NET worlds in a user-friendly and cross-platform manner while keeping single code-base and clean interface.
PM> Install-Package Octave.NET
- Install latest octave
- Add bin folder to system PATH variable or specify path to octave-cli binary in your code
- Check the 'examples' folder
This library spawns octave processes and controls them via standard streams (stdin, stdout and stderr). To keep optimal performance every time OctaveContext is disposed underlying octave-cli process is returned to the object pool, so we don't waste time on spawning new worker processes.
I don't know, it varies between operating systems. Use your favourite search engine to find out.
In single-threaded scenario, there will be only one worker process spawned. In multithreaded scenario, library will try to supply demand for OctaveContext's by spawning more processes until the limit is reached - by default the number of logical processors in your machine. If the limit is reached and all workers are in use, calling thread will be locked until some worker is freed. You may be interested in OctaveContext.OctaveSettings.MaximumConcurrency
global setting.
Nope! After few seconds of inactivity (no attempts to execute octave commands) internal pool will start to slowly release its resources.
All processes were probably disposed and you experience "cold start". If you don't mind few more MBs that are not released until your application is closed, you can use global configuration and set OctaveContext.OctaveSettings.PreventColdStarts = true;
Just remember to do this before first OctaveContext is created!
OctaveContext is called octave context because... well, it represent single octave context at the given point of time. Even though processes are reused, it is not guaranteed that you will get the same process. Your safest bet is to do all the work in single using(var octave = new OctaveContext()) {...}
block. Contexts (e.g. octave variables) will not be cleared. If you require that, just executeclear
command.
If your script does not work when you run it manually in octave, it won't work there. Make sure that all packages that you need are installed and loaded.
There is an 2D plot example for that. "Async" octave operations are not supported, every operation should be locking and synchronous.