Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Solving Sparse System of Linear Equations with Matrix
(version: 3)
Comparing performance of:
jStat vs Numeric JS (uses LUsolve under the hood) vs Numeric JS (LU Decomposed first) vs math.js vs math.js (LU Decomposed first)
Created:
9 years ago
by:
Registered User
Jump to the latest result
HTML Preparation code:
<!-- JStat --> <script src="https://cdn.jsdelivr.net/jstat/latest/jstat.min.js"></script> <!-- NumericJS --> <script src="https://cdn.rawgit.com/sloisel/numeric/master/src/numeric.js"></script> <!-- Math.js --> <script src="https://cdnjs.cloudflare.com/ajax/libs/mathjs/3.9.0/math.min.js"></script>
Script Preparation code:
var sparseA = [ [1,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,4,0,0,0,0,6,0,0,0,0,6,0,0,0,0,0,0,0], [0,1,0,2,0,0,0,0,0,0,0,0,0,6,0,6,0,0,0,0], [0,0,4,0,6,0,0,0,0,0,4,0,0,0,0,0,0,5,0,0], [0,0,0,2,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,6,0,23,4,0,0,0,0,0,0,6,0,0,0,0,0], [0,3,0,0,0,5,0,6,5,6,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,2,6,45,66,0,0,0,0,0,0,0,6,0,0,0], [0,0,0,0,0,0,0,9,0,12,6,0,0,0,0,0,0,0,6,0], [0,0,3,0,0,0,0,0,23,0,45,0,0,5,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,13,0,6,0,0,0,0,0,0,0,0], [3,0,0,0,3,0,56,0,0,0,5,0,5,0,0,0,0,6,0,0], [0,0,0,0,0,0,0,0,0,0,6,6,0,23,0,0,0,0,0,0], [0,3,0,0,0,0,0,0,0,0,0,0,8,6,67,0,0,0,0,0], [0,0,3,0,0,0,0,0,0,0,0,0,0,1,0,2,0,0,0,0], [0,0,0,0,0,0,0,5,0,0,0,4,0,0,5,0,43,6,0,0], [0,3,0,0,0,0,0,0,0,0,0,6,0,0,0,45,6,6,6,0], [0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,7,0], [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1] ], sparseB = [[0],[0],[4],[0],[10],[0],[5],[0],[0],[0],[-5],[6],[0],[-6],[0],[0],[0],[10],[20],[4]]; var Numeric_sparse_LUa = numeric.LU(sparseA), math_sparse_LUa = math.lup(sparseA);
Tests:
jStat
jStat.gauss_elimination(sparseA, sparseB);
Numeric JS (uses LUsolve under the hood)
numeric.solve(sparseA, sparseB);
Numeric JS (LU Decomposed first)
numeric.LUsolve(Numeric_sparse_LUa, sparseB);
math.js
math.lusolve(sparseA, sparseB);
math.js (LU Decomposed first)
math.lusolve(math_sparse_LUa, sparseB);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (5)
Previous results
Fork
Test case name
Result
jStat
Numeric JS (uses LUsolve under the hood)
Numeric JS (LU Decomposed first)
math.js
math.js (LU Decomposed first)
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Autogenerated LLM Summary
(model
llama3.2:3b
, generated one year ago):
Let's break down what's being tested in the provided benchmark. **Benchmark Overview** The benchmark is designed to measure the performance of four different libraries (jStat, NumericJS, math.js) for solving a linear system of equations using LU decomposition. **LU Decomposition** In linear algebra, an LU decomposition is a factorization method that decomposes a matrix into two matrices: a lower triangular matrix (L) and an upper triangular matrix (U). The product of L and U gives back the original matrix. This decomposition is useful for solving systems of linear equations efficiently. **The Test Cases** Each test case consists of: 1. A "Benchmark Definition" statement, which specifies the function call to be executed: * jStat.gauss_elimination(sparseA, sparseB) * numeric.solve(sparseA, sparseB) * numeric.LUsolve(Numeric_sparse_LUa, sparseB) * math.lusolve(sparseA, sparseB) 2. A "Test Name" that identifies the library being tested. 3. The test data: two sparse matrices `sparseA` and `sparseB`. **Library Overview** Here's a brief introduction to each library: 1. **jStat**: jStat is a JavaScript statistical library that provides various algorithms for statistical computations, including linear algebra operations like LU decomposition. 2. **NumericJS**: NumericJS is a JavaScript numerical library that provides an implementation of the LAPACK (Linear Algebra Package) standard, which includes LU decomposition and other linear algebra routines. 3. **math.js**: math.js is another JavaScript numerical library that provides implementations of various mathematical functions, including linear algebra operations like LU decomposition. **What's Being Tested** The benchmark measures the performance of each library by executing the specified function call with the same test data. The execution time is measured and reported for each test case. This allows users to compare the performance of each library for solving similar problems. In summary, this benchmark tests the performance of four JavaScript libraries (jStat, NumericJS, math.js) for solving linear systems of equations using LU decomposition.
Related benchmarks:
Object Indexed Properties (Read)
Solving System of Linear Equations with Matrix
for loop vs array find
map() vs for...loop using Moore's 3
Comments
Confirm delete:
Do you really want to delete benchmark?