Released v3.2.1

This commit is contained in:
jos 2016-04-26 20:24:51 +02:00
parent 9b1c2b56be
commit 6a02a8d2c9
23 changed files with 74 additions and 47 deletions

View File

@ -70,11 +70,11 @@ All nodes have the following methods:
- `filter(callback: function) : Node[]`
Filter nodes in an expression tree. The `callback` function is called as
`callback(node: Node, path: string, parent: Node) : boolean` for every node
in the tree, and must return a boolean. The function `filter` returns an
array with nodes for which the test returned true. Parameter `path` is a
string containing a relative JSON Path.
Recursively filter nodes in an expression tree. The `callback` function is
called as `callback(node: Node, path: string, parent: Node) : boolean` for
every node in the tree, and must return a boolean. The function `filter`
returns an array with nodes for which the test returned true.
Parameter `path` is a string containing a relative JSON Path.
Example:
@ -276,7 +276,7 @@ var node2 = new math.expression.node.ArrayNode([one, two, three]);
Construction:
```
new AssignmentNode(symbol: SymbolNode, value: Node)
new AssignmentNode(object: SymbolNode, value: Node)
new AssignmentNode(object: SymbolNode | AccessorNode, index: IndexNode, value: Node)
```
@ -292,9 +292,9 @@ Examples:
```js
var node1 = math.parse('a = 3');
var symbol = new math.expression.node.SymbolNode('a');
var object = new math.expression.node.SymbolNode('a');
var value = new math.expression.node.ConstantNode(3);
var node2 = new math.expression.node.AssignmentNode(symbol, value);
var node2 = new math.expression.node.AssignmentNode(object, value);
```

View File

@ -40,18 +40,18 @@ Math.js can be downloaded or linked from [cdnjs](http://cdnjs.com/):
<table class="download">
<tr>
<td>
<a href="http://cdnjs.cloudflare.com/ajax/libs/mathjs/3.2.0/math.js">
Development (version 3.2.0)
<a href="http://cdnjs.cloudflare.com/ajax/libs/mathjs/3.2.1/math.js">
Development (version 3.2.1)
</a>
</td>
<td>
<span id="development-size">1425 kB</span>, uncompressed with comments
<span id="development-size">1426 kB</span>, uncompressed with comments
</td>
</tr>
<tr>
<td>
<a href="http://cdnjs.cloudflare.com/ajax/libs/mathjs/3.2.0/math.min.js">
Production (version 3.2.0)
<a href="http://cdnjs.cloudflare.com/ajax/libs/mathjs/3.2.1/math.min.js">
Production (version 3.2.1)
</a>
</td>
<td>

View File

@ -14,7 +14,7 @@
}
</style>
<script src="http://cdnjs.cloudflare.com/ajax/libs/mathjs/3.2.0/math.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/mathjs/3.2.1/math.min.js"></script>
</head>
<body>

View File

@ -23,7 +23,7 @@ File: [angle_configuration.html](angle_configuration.html)
}
</style>
<script src="http://cdnjs.cloudflare.com/ajax/libs/mathjs/3.2.0/math.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/mathjs/3.2.1/math.min.js"></script>
</head>
<body>

View File

@ -2,7 +2,7 @@
<html>
<head>
<title>math.js | basic usage</title>
<script src="http://cdnjs.cloudflare.com/ajax/libs/mathjs/3.2.0/math.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/mathjs/3.2.1/math.min.js"></script>
</head>
<body>

View File

@ -11,7 +11,7 @@ File: [basic_usage.html](basic_usage.html)
<html>
<head>
<title>math.js | basic usage</title>
<script src="http://cdnjs.cloudflare.com/ajax/libs/mathjs/3.2.0/math.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/mathjs/3.2.1/math.min.js"></script>
</head>
<body>

View File

@ -14,7 +14,7 @@
}
</style>
<script src="http://cdnjs.cloudflare.com/ajax/libs/mathjs/3.2.0/math.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/mathjs/3.2.1/math.min.js"></script>
</head>
<body>

View File

@ -23,7 +23,7 @@ File: [custom_separators.html](custom_separators.html)
}
</style>
<script src="http://cdnjs.cloudflare.com/ajax/libs/mathjs/3.2.0/math.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/mathjs/3.2.1/math.min.js"></script>
</head>
<body>

View File

@ -7,7 +7,7 @@
<script src="//cdnjs.cloudflare.com/ajax/libs/es5-shim/2.2.0/es5-shim.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/es5-shim/2.2.0/es5-sham.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/mathjs/3.2.0/math.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/mathjs/3.2.1/math.min.js"></script>
</head>
<body>

View File

@ -16,7 +16,7 @@ File: [old_browsers.html](old_browsers.html)
<script src="//cdnjs.cloudflare.com/ajax/libs/es5-shim/2.2.0/es5-shim.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/es5-shim/2.2.0/es5-sham.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/mathjs/3.2.0/math.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/mathjs/3.2.1/math.min.js"></script>
</head>
<body>

View File

@ -2,7 +2,7 @@
<html>
<head>
<title>math.js | plot</title>
<script src="http://cdnjs.cloudflare.com/ajax/libs/mathjs/3.2.0/math.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/mathjs/3.2.1/math.min.js"></script>
<!-- load http://maurizzzio.github.io/function-plot/ -->
<script src="http://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js"></script>

View File

@ -11,7 +11,7 @@ File: [plot.html](plot.html)
<html>
<head>
<title>math.js | plot</title>
<script src="http://cdnjs.cloudflare.com/ajax/libs/mathjs/3.2.0/math.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/mathjs/3.2.1/math.min.js"></script>
<!-- load http://maurizzzio.github.io/function-plot/ -->
<script src="http://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js"></script>

View File

@ -3,7 +3,7 @@
<head>
<title>math.js | pretty printing with MathJax</title>
<script src="http://cdnjs.cloudflare.com/ajax/libs/mathjs/3.2.0/math.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/mathjs/3.2.1/math.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/mathjax/2.3/MathJax.js?config=TeX-AMS-MML_HTMLorMML.js"></script>
<style>

View File

@ -12,7 +12,7 @@ File: [pretty_printing_with_mathjax.html](pretty_printing_with_mathjax.html)
<head>
<title>math.js | pretty printing with MathJax</title>
<script src="http://cdnjs.cloudflare.com/ajax/libs/mathjs/3.2.0/math.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/mathjs/3.2.1/math.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/mathjax/2.3/MathJax.js?config=TeX-AMS-MML_HTMLorMML.js"></script>
<style>

View File

@ -8,7 +8,7 @@
<script>
// load math.js using require.js
require(['http://cdnjs.cloudflare.com/ajax/libs/mathjs/3.2.0/math.min.js'], function (math) {
require(['http://cdnjs.cloudflare.com/ajax/libs/mathjs/3.2.1/math.min.js'], function (math) {
// evaluate some expression
var result = math.eval('1.2 * (2 + 4.5)');
document.write(result);

View File

@ -17,7 +17,7 @@ File: [requirejs_loading.html](requirejs_loading.html)
<script>
// load math.js using require.js
require(['http://cdnjs.cloudflare.com/ajax/libs/mathjs/3.2.0/math.min.js'], function (math) {
require(['http://cdnjs.cloudflare.com/ajax/libs/mathjs/3.2.1/math.min.js'], function (math) {
// evaluate some expression
var result = math.eval('1.2 * (2 + 4.5)');
document.write(result);

View File

@ -91,7 +91,7 @@ File: [webworkers.html](webworkers.html)
File: [worker.js](worker.js)
```js
importScripts('http://cdnjs.cloudflare.com/ajax/libs/mathjs/3.2.0/math.min.js');
importScripts('http://cdnjs.cloudflare.com/ajax/libs/mathjs/3.2.1/math.min.js');
// create a parser
var parser = math.parser();

View File

@ -1,4 +1,4 @@
importScripts('http://cdnjs.cloudflare.com/ajax/libs/mathjs/3.2.0/math.min.js');
importScripts('http://cdnjs.cloudflare.com/ajax/libs/mathjs/3.2.1/math.min.js');
// create a parser
var parser = math.parser();

View File

@ -5,6 +5,12 @@ layout: default
<h1 id="history">History <a href="#history" title="Permalink">#</a></h1>
<h2 id="20160426-version-321">2016-04-26, version 3.2.1 <a href="#20160426-version-321" title="Permalink">#</a></h2>
- Fixed #651: unable to perform calculations on "Unit-less" units.
- Fixed matrix.subset mutating the replacement matrix when unsqueezing it.
<h2 id="20160416-version-320">2016-04-16, version 3.2.0 <a href="#20160416-version-320" title="Permalink">#</a></h2>
- Implemented #644: method `Parser.getAll()` to retrieve all defined variables.

View File

@ -6,8 +6,8 @@
* It features real and complex numbers, units, matrices, a large set of
* mathematical functions, and a flexible expression parser.
*
* @version 3.2.0
* @date 2016-04-16
* @version 3.2.1
* @date 2016-04-26
*
* @license
* Copyright (C) 2013-2016 Jos de Jong <wjosdejong@gmail.com>
@ -12071,10 +12071,13 @@ return /******/ (function(modules) { // webpackBootstrap
/**
* Unsqueeze a multi dimensional array: add dimensions when missing
*
* Paramter `size` will be mutated to match the new, unqueezed matrix size.
*
* @param {Array} array
* @param {number} dims Desired number of dimensions of the array
* @param {number} [outer] Number of outer dimensions to be added
* @param {Array} [size] Current size of array
* @param {Array} [size] Current size of array.
* @returns {Array} returns the array itself
* @private
*/
@ -12852,7 +12855,7 @@ return /******/ (function(modules) { // webpackBootstrap
* @returns {number[]} size
*/
DenseMatrix.prototype.size = function() {
return this._size;
return this._size.slice(0); // return a clone of _size
};
/**
@ -18764,7 +18767,8 @@ return /******/ (function(modules) { // webpackBootstrap
// Trigger simplification of the unit list at some future time
res.isUnitListSimplified = false;
return res;
return getNumericIfUnitless(res);
};
/**
@ -18800,7 +18804,8 @@ return /******/ (function(modules) { // webpackBootstrap
// Trigger simplification of the unit list at some future time
res.isUnitListSimplified = false;
return res;
return getNumericIfUnitless(res);
};
/**
@ -18836,9 +18841,25 @@ return /******/ (function(modules) { // webpackBootstrap
// Trigger lazy evaluation of the unit list
res.isUnitListSimplified = false;
return res;
return getNumericIfUnitless(res);
};
/**
* Return the numeric value of this unit if it is dimensionless, has a value, and config.predictable == false; or the original unit otherwise
* @param {Unit} unit
* @returns {number | Fraction | BigNumber | Unit} The numeric value of the unit if conditions are met, or the original unit otherwise
*/
var getNumericIfUnitless = function(unit) {
if(unit.equalBase(BASE_UNITS.NONE) && unit.value !== null && !config.predictable) {
return unit.value;
}
else {
return unit;
}
}
/**
* Calculate the absolute value of a unit
* @memberof Unit
@ -23771,7 +23792,7 @@ return /******/ (function(modules) { // webpackBootstrap
/* 94 */
/***/ function(module, exports) {
module.exports = '3.2.0';
module.exports = '3.2.1';
// Note: This file is automatically generated when building math.js.
// Changes made in this file will be overwritten.

File diff suppressed because one or more lines are too long

16
js/lib/math.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -6,7 +6,7 @@
"url": "https://github.com/josdejong/mathjs.git"
},
"dependencies": {
"mathjs": "3.2.0"
"mathjs": "3.2.1"
},
"devDependencies": {
"glob": "^4.3.5",