mirror of
https://github.com/josdejong/mathjs.git
synced 2026-01-25 15:07:57 +00:00
Publish mathjs@6.2.4
This commit is contained in:
parent
122895823d
commit
4e1d1c98d3
10
download.md
10
download.md
@ -29,7 +29,7 @@ Math.js can be downloaded or linked from various content delivery networks:
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>unpkg</td>
|
||||
<td><a href="https://unpkg.com/mathjs@6.2.3/">https://unpkg.com/mathjs@6.2.3/</a></td>
|
||||
<td><a href="https://unpkg.com/mathjs@6.2.4/">https://unpkg.com/mathjs@6.2.4/</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>cdnjs</td>
|
||||
@ -47,8 +47,8 @@ Here some direct download links from [unpkg](https://unpkg.com):
|
||||
<table class="download">
|
||||
<tr>
|
||||
<td>
|
||||
<a href="https://unpkg.com/mathjs@6.2.3/dist/math.js">
|
||||
Development (version 6.2.3)
|
||||
<a href="https://unpkg.com/mathjs@6.2.4/dist/math.js">
|
||||
Development (version 6.2.4)
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
@ -57,8 +57,8 @@ Here some direct download links from [unpkg](https://unpkg.com):
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="https://unpkg.com/mathjs@6.2.3/dist/math.min.js">
|
||||
Production (version 6.2.3)
|
||||
<a href="https://unpkg.com/mathjs@6.2.4/dist/math.min.js">
|
||||
Production (version 6.2.4)
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
@ -24,7 +24,7 @@ File: [angle_configuration.html](angle_configuration.html) (click for a live dem
|
||||
}
|
||||
</style>
|
||||
|
||||
<script src="https://unpkg.com/mathjs@6.2.3/dist/math.min.js"></script>
|
||||
<script src="https://unpkg.com/mathjs@6.2.4/dist/math.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
@ -12,7 +12,7 @@ File: [basic_usage.html](basic_usage.html) (click for a live demo)
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>math.js | basic usage</title>
|
||||
<script src="https://unpkg.com/mathjs@6.2.3/dist/math.min.js"></script>
|
||||
<script src="https://unpkg.com/mathjs@6.2.4/dist/math.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
@ -13,7 +13,7 @@ File: [currency_conversion.html](currency_conversion.html) (click for a live dem
|
||||
<meta charset="utf-8">
|
||||
<title>math.js | currency conversion</title>
|
||||
|
||||
<script src="https://unpkg.com/mathjs@6.2.3/dist/math.min.js"></script>
|
||||
<script src="https://unpkg.com/mathjs@6.2.4/dist/math.min.js"></script>
|
||||
|
||||
<style>
|
||||
body,
|
||||
|
||||
@ -24,7 +24,7 @@ File: [custom_separators.html](custom_separators.html) (click for a live demo)
|
||||
}
|
||||
</style>
|
||||
|
||||
<script src="https://unpkg.com/mathjs@6.2.3/dist/math.min.js"></script>
|
||||
<script src="https://unpkg.com/mathjs@6.2.4/dist/math.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
@ -12,7 +12,7 @@ File: [plot.html](plot.html) (click for a live demo)
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>math.js | plot</title>
|
||||
<script src="https://unpkg.com/mathjs@6.2.3/dist/math.min.js"></script>
|
||||
<script src="https://unpkg.com/mathjs@6.2.4/dist/math.min.js"></script>
|
||||
|
||||
<script src="https://cdn.plot.ly/plotly-1.35.2.min.js"></script>
|
||||
|
||||
|
||||
@ -13,7 +13,7 @@ File: [pretty_printing_with_mathjax.html](pretty_printing_with_mathjax.html) (cl
|
||||
<meta charset="utf-8">
|
||||
<title>math.js | pretty printing with MathJax</title>
|
||||
|
||||
<script src="https://unpkg.com/mathjs@6.2.3/dist/math.min.js"></script>
|
||||
<script src="https://unpkg.com/mathjs@6.2.4/dist/math.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.3/MathJax.js?config=TeX-AMS-MML_HTMLorMML.js"></script>
|
||||
|
||||
<style>
|
||||
|
||||
@ -13,7 +13,7 @@ File: [printing_html.html](printing_html.html) (click for a live demo)
|
||||
<meta charset="utf-8">
|
||||
<title>math.js | printing HTML</title>
|
||||
|
||||
<script src="https://unpkg.com/mathjs@6.2.3/dist/math.min.js"></script>
|
||||
<script src="https://unpkg.com/mathjs@6.2.4/dist/math.min.js"></script>
|
||||
|
||||
<style>
|
||||
body {
|
||||
|
||||
@ -18,7 +18,7 @@ File: [requirejs_loading.html](requirejs_loading.html) (click for a live demo)
|
||||
|
||||
<script>
|
||||
// load math.js using require.js
|
||||
require(['https://unpkg.com/mathjs@6.2.3/dist/math.min.js'], function (math) {
|
||||
require(['https://unpkg.com/mathjs@6.2.4/dist/math.min.js'], function (math) {
|
||||
// evaluate some expression
|
||||
const result = math.evaluate('1.2 * (2 + 4.5)')
|
||||
document.write(result)
|
||||
|
||||
@ -13,7 +13,7 @@ File: [rocket_trajectory_optimization.html](rocket_trajectory_optimization.html)
|
||||
<meta charset="utf-8">
|
||||
<title>math.js | rocket trajectory optimization</title>
|
||||
|
||||
<script src="https://unpkg.com/mathjs@6.2.3/dist/math.min.js"></script>
|
||||
<script src="https://unpkg.com/mathjs@6.2.4/dist/math.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.5.0/Chart.min.js"></script>
|
||||
|
||||
<style>
|
||||
|
||||
@ -92,7 +92,7 @@ File: [webworkers.html](webworkers.html) (click for a live demo)
|
||||
File: [worker.js](worker.js) (click for a live demo)
|
||||
|
||||
```js
|
||||
importScripts('https://unpkg.com/mathjs@6.2.3/dist/math.min.js')
|
||||
importScripts('https://unpkg.com/mathjs@6.2.4/dist/math.min.js')
|
||||
|
||||
// create a parser
|
||||
const parser = self.math.parser()
|
||||
|
||||
@ -4,6 +4,14 @@ layout: default
|
||||
|
||||
<h1 id="history">History <a href="#history" title="Permalink">#</a></h1>
|
||||
|
||||
<h1 id="20191006-version-624">2019-10-06, version 6.2.4 <a href="#20191006-version-624" title="Permalink">#</a></h1>
|
||||
|
||||
- Fixed <a href="https://github.com/josdejong/mathjs/issues/1669">#1669</a>: function 'qr' threw an error if the pivot was zero,
|
||||
thanks <a href="https://github.com/kevinkelleher12">@kevinkelleher12</a> and <a href="https://github.com/harrysarson">@harrysarson</a>.
|
||||
- Resolves <a href="https://github.com/josdejong/mathjs/issues/942">#942</a>: remove misleading assert in 'qr'. Thanks <a href="https://github.com/harrysarson">@harrysarson</a>.
|
||||
- Work around a bug in complex.js where `sign(0)` returns complex NaN.
|
||||
Thanks <a href="https://github.com/harrysarson">@harrysarson</a>.
|
||||
|
||||
|
||||
<h1 id="20191006-version-623">2019-10-06, version 6.2.3 <a href="#20191006-version-623" title="Permalink">#</a></h1>
|
||||
|
||||
|
||||
@ -6,8 +6,8 @@
|
||||
* It features real and complex numbers, units, matrices, a large set of
|
||||
* mathematical functions, and a flexible expression parser.
|
||||
*
|
||||
* @version 6.2.3
|
||||
* @date 2019-10-06
|
||||
* @version 6.2.4
|
||||
* @date 2019-11-20
|
||||
*
|
||||
* @license
|
||||
* Copyright (C) 2013-2019 Jos de Jong <wjosdejong@gmail.com>
|
||||
@ -21337,12 +21337,13 @@ Object(factory["a" /* factory */])(nthRoot_name, ['typed'], function (_ref2) {
|
||||
|
||||
|
||||
var sign_name = 'sign';
|
||||
var sign_dependencies = ['typed', 'BigNumber', 'Fraction'];
|
||||
var sign_dependencies = ['typed', 'BigNumber', 'Fraction', 'complex'];
|
||||
var createSign =
|
||||
/* #__PURE__ */
|
||||
Object(factory["a" /* factory */])(sign_name, sign_dependencies, function (_ref) {
|
||||
var typed = _ref.typed,
|
||||
_BigNumber = _ref.BigNumber,
|
||||
complex = _ref.complex,
|
||||
_Fraction = _ref.Fraction;
|
||||
|
||||
/**
|
||||
@ -21378,7 +21379,7 @@ Object(factory["a" /* factory */])(sign_name, sign_dependencies, function (_ref)
|
||||
var sign = typed(sign_name, {
|
||||
number: signNumber,
|
||||
Complex: function Complex(x) {
|
||||
return x.sign();
|
||||
return x.im === 0 ? complex(signNumber(x.re)) : x.sign();
|
||||
},
|
||||
BigNumber: function BigNumber(x) {
|
||||
return new _BigNumber(x.cmp(0));
|
||||
@ -47598,9 +47599,11 @@ Object(factory["a" /* factory */])(lup_name, lup_dependencies, function (_ref) {
|
||||
}
|
||||
});
|
||||
// CONCATENATED MODULE: ./src/function/algebra/decomposition/qr.js
|
||||
function qr_extends() { qr_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return qr_extends.apply(this, arguments); }
|
||||
|
||||
|
||||
var qr_name = 'qr';
|
||||
var qr_dependencies = ['typed', 'matrix', 'zeros', 'identity', 'isZero', 'unequal', 'sign', 'sqrt', 'conj', 'unaryMinus', 'addScalar', 'divideScalar', 'multiplyScalar', 'subtract'];
|
||||
var qr_dependencies = ['typed', 'matrix', 'zeros', 'identity', 'isZero', 'equal', 'sign', 'sqrt', 'conj', 'unaryMinus', 'addScalar', 'divideScalar', 'multiplyScalar', 'subtract', 'complex'];
|
||||
var createQr =
|
||||
/* #__PURE__ */
|
||||
Object(factory["a" /* factory */])(qr_name, qr_dependencies, function (_ref) {
|
||||
@ -47609,7 +47612,7 @@ Object(factory["a" /* factory */])(qr_name, qr_dependencies, function (_ref) {
|
||||
zeros = _ref.zeros,
|
||||
identity = _ref.identity,
|
||||
isZero = _ref.isZero,
|
||||
unequal = _ref.unequal,
|
||||
equal = _ref.equal,
|
||||
sign = _ref.sign,
|
||||
sqrt = _ref.sqrt,
|
||||
conj = _ref.conj,
|
||||
@ -47617,7 +47620,8 @@ Object(factory["a" /* factory */])(qr_name, qr_dependencies, function (_ref) {
|
||||
addScalar = _ref.addScalar,
|
||||
divideScalar = _ref.divideScalar,
|
||||
multiplyScalar = _ref.multiplyScalar,
|
||||
subtract = _ref.subtract;
|
||||
subtract = _ref.subtract,
|
||||
complex = _ref.complex;
|
||||
|
||||
/**
|
||||
* Calculate the Matrix QR decomposition. Matrix `A` is decomposed in
|
||||
@ -47662,7 +47666,7 @@ Object(factory["a" /* factory */])(qr_name, qr_dependencies, function (_ref) {
|
||||
* @return {{Q: Array | Matrix, R: Array | Matrix}} Q: the orthogonal
|
||||
* matrix and R: the upper triangular matrix
|
||||
*/
|
||||
return typed(qr_name, {
|
||||
return qr_extends(typed(qr_name, {
|
||||
DenseMatrix: function DenseMatrix(m) {
|
||||
return _denseQR(m);
|
||||
},
|
||||
@ -47681,9 +47685,11 @@ Object(factory["a" /* factory */])(qr_name, qr_dependencies, function (_ref) {
|
||||
R: r.R.valueOf()
|
||||
};
|
||||
}
|
||||
}), {
|
||||
_denseQRimpl: _denseQRimpl
|
||||
});
|
||||
|
||||
function _denseQR(m) {
|
||||
function _denseQRimpl(m) {
|
||||
// rows & columns (m x n)
|
||||
var rows = m._size[0]; // m
|
||||
|
||||
@ -47722,7 +47728,7 @@ Object(factory["a" /* factory */])(qr_name, qr_dependencies, function (_ref) {
|
||||
*
|
||||
*/
|
||||
var pivot = Rdata[k][k];
|
||||
var sgn = unaryMinus(sign(pivot));
|
||||
var sgn = unaryMinus(equal(pivot, 0) ? 1 : sign(pivot));
|
||||
var conjSgn = conj(sgn);
|
||||
var alphaSquared = 0;
|
||||
|
||||
@ -47796,18 +47802,6 @@ Object(factory["a" /* factory */])(qr_name, qr_dependencies, function (_ref) {
|
||||
}
|
||||
}
|
||||
}
|
||||
} // coerse almost zero elements to zero
|
||||
// TODO I feel uneasy just zeroing these values
|
||||
|
||||
|
||||
for (i = 0; i < rows; ++i) {
|
||||
for (j = 0; j < i && j < cols; ++j) {
|
||||
if (unequal(0, divideScalar(Rdata[i][j], 1e5))) {
|
||||
throw new Error('math.qr(): unknown error - ' + 'R is not lower triangular (element (' + i + ', ' + j + ') = ' + Rdata[i][j] + ')');
|
||||
}
|
||||
|
||||
Rdata[i][j] = multiplyScalar(Rdata[i][j], 0);
|
||||
}
|
||||
} // return matrices
|
||||
|
||||
|
||||
@ -47820,6 +47814,24 @@ Object(factory["a" /* factory */])(qr_name, qr_dependencies, function (_ref) {
|
||||
};
|
||||
}
|
||||
|
||||
function _denseQR(m) {
|
||||
var ret = _denseQRimpl(m);
|
||||
|
||||
var Rdata = ret.R._data;
|
||||
|
||||
if (m._data.length > 0) {
|
||||
var zero = Rdata[0][0].type === 'Complex' ? complex(0) : 0;
|
||||
|
||||
for (var i = 0; i < Rdata.length; ++i) {
|
||||
for (var j = 0; j < i && j < (Rdata[0] || []).length; ++j) {
|
||||
Rdata[i][j] = zero;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
function _sparseQR(m) {
|
||||
throw new Error('qr not implemented for sparse matrices yet');
|
||||
}
|
||||
@ -59462,7 +59474,7 @@ Object(factory["a" /* factory */])(reviver_name, reviver_dependencies, function
|
||||
};
|
||||
});
|
||||
// CONCATENATED MODULE: ./src/version.js
|
||||
var version = '6.2.3'; // Note: This file is automatically generated when building math.js.
|
||||
var version = '6.2.4'; // Note: This file is automatically generated when building math.js.
|
||||
// Changes made in this file will be overwritten.
|
||||
// CONCATENATED MODULE: ./src/plain/number/constants.js
|
||||
var constants_pi = Math.PI;
|
||||
|
||||
21
js/lib/math.min.js
vendored
21
js/lib/math.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
6
package-lock.json
generated
6
package-lock.json
generated
@ -2317,9 +2317,9 @@
|
||||
}
|
||||
},
|
||||
"mathjs": {
|
||||
"version": "6.2.3",
|
||||
"resolved": "https://registry.npmjs.org/mathjs/-/mathjs-6.2.3.tgz",
|
||||
"integrity": "sha512-IEYTyz8tu7nslF4j2TtDs7C+9Emi2/iJTYXjc5WLoIKTJOLLtjp3Aglys0ZbV9KSiaJhpfGPLXm8Z5d7vEGN3w==",
|
||||
"version": "6.2.4",
|
||||
"resolved": "https://registry.npmjs.org/mathjs/-/mathjs-6.2.4.tgz",
|
||||
"integrity": "sha512-UAx0+mMNSm+FTbvD2Sx5gbR9hcehN4+js1BHJl2AByIZJ2T6CUBlnf4jKYgvkMPf2LAHobqXAVhoTfqoqy80pQ==",
|
||||
"requires": {
|
||||
"complex.js": "2.0.11",
|
||||
"decimal.js": "10.2.0",
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
"url": "https://github.com/josdejong/mathjs.git"
|
||||
},
|
||||
"dependencies": {
|
||||
"mathjs": "6.2.3"
|
||||
"mathjs": "6.2.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"fancy-log": "1.3.3",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user