Skip to content

foo123/SciLite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SciLite

A scientific computing environment in pure JavaScript

SciLite

v.0.9.7 (92 kB minified)

SciLite

SciLite Live

SciLite includes an optional interpreter that handles all of Octave/Matlab syntax except function definitions (see demo), however one can use the SciLite methods directly in JavaScript as well.

example

Octave syntax:

A = 4*ones(2, 2)+1;
B = [1 2;3 4];
A(:,[1 2]) = B(end:-1:1, 1);
C = [A; B]; % similar to C = vertcat(A, B)
D = C'; % conjugate transpose
E = D(:); % colon operator
F = A.*B; % dotmul operator
Ref = rref(A); % default output
[Ref, Pivots] = rref(A); % variable output

JavaScript syntax:

const {add, dotmul, mul, get, set} = SciLite._;
const fn = SciLite.fn;

// optionally for arbitrary precision support use Decimal.js
//SciLite._.decimal(Decimal);

let A = add(mul(4, fn.ones(2, 2)), 1);
let B = [[1, 2], [3, 4]];
set(A, ':', [1, 2], get(B, fn.colon(fn.rows(B),-1,1), 1));
let C = fn.vertcat(A, B);
let D = fn.ctranspose(C); // conjugate transpose
let E = fn.colon(D); // colon function
let F = dotmul(A, B);
let Ref = fn.rref(A); // default output
let [Ref, Pivots] = fn.rref.nargout(2)(A); // variable output

TODO

  • implement matrix functions sqrtm, expm, logm (IN PROGRESS)
  • implement generalized/polynomial eigen decomposition (TODO)
  • support symbolic computations (IN PROGRESS)
  • support GPU computations and mix of CPU/GPU computations (TODO)

see also:

  • Abacus Computer Algebra and Symbolic Computation System for Combinatorics and Algebraic Number Theory for JavaScript and Python
  • SciLite Scientific Computing Environment similar to Octave/Matlab in pure JavaScript
  • TensorView view array data as multidimensional tensors of various shapes efficiently
  • FILTER.js video and image processing and computer vision Library in pure JavaScript (browser and nodejs)
  • HAAR.js image feature detection based on Haar Cascades in JavaScript (Viola-Jones-Lienhart et al Algorithm)
  • HAARPHP image feature detection based on Haar Cascades in PHP (Viola-Jones-Lienhart et al Algorithm)
  • Fuzzion a library of fuzzy / approximate string metrics for PHP, JavaScript, Python
  • Matchy a library of string matching algorithms for PHP, JavaScript, Python
  • Regex Analyzer/Composer Regular Expression Analyzer and Composer for PHP, JavaScript, Python
  • Xpresion a simple and flexible eXpression parser engine (with custom functions and variables support), based on GrammarTemplate, for PHP, JavaScript, Python
  • GrammarTemplate grammar-based templating for PHP, JavaScript, Python
  • codemirror-grammar transform a formal grammar in JSON format into a syntax-highlight parser for CodeMirror editor
  • ace-grammar transform a formal grammar in JSON format into a syntax-highlight parser for ACE editor
  • prism-grammar transform a formal grammar in JSON format into a syntax-highlighter for Prism code highlighter
  • highlightjs-grammar transform a formal grammar in JSON format into a syntax-highlight mode for Highlight.js code highlighter
  • syntaxhighlighter-grammar transform a formal grammar in JSON format to a highlight brush for SyntaxHighlighter code highlighter
  • MOD3 3D Modifier Library in JavaScript
  • Geometrize Computational Geometry and Rendering Library for JavaScript
  • Plot.js simple and small library which can plot graphs of functions and various simple charts and can render to Canvas, SVG and plain HTML
  • CanvasLite an html canvas implementation in pure JavaScript
  • Rasterizer stroke and fill lines, rectangles, curves and paths, without canvas
  • Gradient create linear, radial, conic and elliptic gradients and image patterns without canvas
  • css-color simple class to parse and manipulate colors in various formats
  • PatternMatchingAlgorithms library of Pattern Matching Algorithms in JavaScript using Matchy
  • SortingAlgorithms library of Sorting Algorithms in JavaScript