Giter Site home page Giter Site logo

octave.net's Introduction

Octave.NET Build Status NuGet

Octave.NET

๐Ÿ“ˆ More than cross-platform Octave process wrapper ๐Ÿ”ฌ

Motivation

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.

Installation

PM> Install-Package Octave.NET

Usage

  • Install latest octave
  • Add bin folder to system PATH variable or specify path to octave-cli binary in your code
  • Check the 'examples' folder

Confirmed compatibility

OS Octave Status
Windows 10 4.4.0 โœ”๏ธ
Ubuntu 16.04 LTS 4.2.2 โœ”๏ธ

How It's Made?

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 precious time on spawning new worker processes.

FAQ

Is there anything I should know before using it?

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 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.

What about applications that rarely use octave, are my resources wasted on idle processes?

Nope! After few seconds of inactivity (no attempts to execute octave commands) internal pool will start to slowly release its resources.

Sounds good but I'm running [insert some difficult analysis method here] on every HTTP request and they may happen every second or every hour. Cold starts are killing me. What can I do?

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!

I set some variables in octave but later when I tried to access them they were undefined!

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 will not be cleared. If you require that, simply send clear command.

XYZ function does not work in octave - I get undefined!

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.

I try to display plot but nothing appears.

There is an 2D plot example for that. "Async" octave operations are not supported, every operation should be locking and synchronous.

octave.net's People

Contributors

triforcely avatar cptwesley avatar

Stargazers

SJ Hong avatar Byun Sang June avatar

Watchers

Byun Sang June avatar Gromit Park avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.