47 Commits

Author SHA1 Message Date
Max Bruckner
bc2c29be8c Make _toString functions call the wrapper 2015-05-07 10:12:32 +02:00
jos
06b9664b87 Removed more instanceof checks 2015-05-05 15:21:57 +02:00
jos
7e3eda8603 Moved all data types and their construction functions into a folder of their own under ./lib/type 2015-05-05 13:51:24 +02:00
jos
e348cb70a2 Refactored Range and Index. Reorganized index.js 2015-04-30 20:36:45 +02:00
Max Bruckner
6235fd6ce1 Make toString a wrapper around _toString
This enables preparating the node tree in `toString` before generating
the actual string output with `_toString` methods
2015-04-30 00:12:54 +02:00
Max Bruckner
8282f424c2 Use the prototype for is<Node> instead of the constructor 2015-04-28 20:13:53 +02:00
Max Bruckner
1c76430dda Get rid of 'instanceof' for Nodes (except for constructors) 2015-04-28 10:09:19 +02:00
Max Bruckner
250707b668 Convert the isNode function into a boolean property. 2015-04-28 09:56:01 +02:00
Max Bruckner
390a0060b4 Add is<NameOfNode> property to enable type checking across constructors 2015-04-28 09:14:53 +02:00
jos
d3d3212633 Refactored all nodes into factory functions (see #342) 2015-04-26 21:25:31 +02:00
jos
6e96d5a808 Merge branch 'develop' into v2
Conflicts:
	HISTORY.md
	bower.json
	component.json
	dist/math.js
	dist/math.map
	dist/math.min.js
	lib/function/arithmetic/abs.js
	lib/function/probability/gamma.js
	lib/version.js
	package.json
2015-04-22 21:43:56 +02:00
Max Bruckner
753a0e7893 IndexNode.toTex: Bugfix: execute toTex on Range Arguments
Also changes the Layout of the LaTeX output of IndexNode.
2015-04-19 09:49:08 +02:00
jos
349e9845e8 Merge branch 'develop' into v2_merge
Conflicts:
	HISTORY.md
	bower.json
	component.json
	dist/math.js
	dist/math.map
	dist/math.min.js
	docs/reference/units.md
	lib/version.js
	package.json
	test/function/construction/chain.test.js
	test/function/matrix/det.test.js
	test/function/matrix/transpose.test.js
	test/function/utils/import.test.js
2015-04-13 21:42:43 +02:00
jos
3150e21c8e Fixed #313: parsed functions did not handle recursive calls correctly 2015-04-09 20:29:51 +02:00
jos
8a68bb56e4 Merged math.js v1.5 into v2. Format support of functions eye and diag still needs to be fixed 2015-03-31 22:07:47 +02:00
jos
5cab0641e9 Simplified the factory structure a little bit. Reworked reviver and BigNumber to factories 2015-03-26 21:03:55 +01:00
Max Bruckner
e04dfd26bc Rename customFuncions to callbacks 2015-03-17 18:30:26 +01:00
Max Bruckner
35ce7f7fb4 Make Node.toTex a wrapper like Node.compile
Node.prototype.toTex is now a wrapper that calls the node's _toTex
2015-03-13 21:23:14 +01:00
Max Bruckner
37c1363c2d Pass callbacks to toTex functions 2015-03-13 21:23:13 +01:00
jos
70a476c357 Replaced all require('decimal.js') with require('../type/BigNumber'), containing the toJSON and fromJSON methods for BigNumber 2015-02-18 20:41:27 +01:00
jos
309bf3938d Added proper error messages to Node.map 2014-11-15 13:32:02 +01:00
jos
9257ec3c33 Added unit tests for Node.map and Node.forEach 2014-11-15 13:16:32 +01:00
jos
5669ae1365 Some refactoring 2014-11-14 11:35:13 +01:00
jos
a1f60db0d1 Created Node.map, changed traverse to use Node.map 2014-11-14 11:25:48 +01:00
jos
95a49fe156 Node.transform first clones the node tree 2014-10-11 21:59:47 +02:00
jos
839e596772 Implemented transform and traverse 2014-10-11 18:03:41 +02:00
jos
5f08307391 Implemented a function replace for nodes of a parsed expression. 2014-10-11 15:33:23 +02:00
jos
52a922e937 Fixed #210: Disabled array notation for ranges in a matrix index the expression parser 2014-09-09 17:33:53 +02:00
jos
8200955d71 Removed unnecessary names of functions 2014-07-21 22:14:27 +02:00
jos
21b34cfa1a Implemented transforms, moved all one-based to zero-based logic for expressions to transforms. 2014-07-19 21:47:15 +02:00
jos
40986a1325 Using strict mode now in all files (added 'use strict'; on top of every file) 2014-07-18 23:19:14 +02:00
Niels Heisterkamp
b7fe0bfbf1 Added LaTeX conversion of expressions using toTex() on expression.
Also added some basic tests, which cover some use cases; but should be expanded.
2014-05-19 08:20:06 +02:00
jos
1189efd4d8 Added property type to all expression nodes in a node tree. 2014-04-24 20:26:51 +02:00
josdejong
ad554ef1f7 Updates and fixes to work with a different BigNumber instance per math.js instance 2014-04-05 22:42:03 +02:00
josdejong
d19e7ea570 Switched to module decimal.js for BigNumber support, instead of bignumber.js. 2014-04-04 21:08:33 +02:00
josdejong
b3ab923a69 Implemented conditional operator a ? b : c in expression parser 2014-04-01 20:49:55 +02:00
josdejong
b046c7ee98 Completed unit tests for all expression nodes 2014-03-01 15:55:20 +01:00
josdejong
42548e1cf0 More unit tests 2014-02-28 22:50:46 +01:00
josdejong
5d96ce4c16 Removed old code for expression evaluation 2014-01-07 21:07:43 +01:00
josdejong
00e55b917e Replaced eval with compile 2014-01-07 16:12:57 +01:00
josdejong
28205b04e2 IndexNode works now for getting a subset too 2014-01-06 22:29:25 +01:00
josdejong
9d1b9d6a81 Renamed parameters in IndexNode 2014-01-05 22:20:08 +01:00
josdejong
c2c8bb61cf Compilation of UpdateNode working again 2014-01-05 22:18:32 +01:00
josdejong
bc05d8b9e8 Changed matrix index notation of expression parser from round brackets to square brackets 2014-01-05 21:52:13 +01:00
josdejong
37e12b23d1 Fixed ConstantNode pointing to undefined math 2014-01-05 21:17:34 +01:00
josdejong
5f81246136 Implemented global definitions internally in expression compilation 2014-01-05 15:01:07 +01:00
josdejong
d7349296c0 Implemented IndexNode 2014-01-04 17:53:02 +01:00