Skip to content

Commit 5d55b23

Browse files
author
Sébastien Loisel
committed
node support, performance tweaks
1 parent 3a5378a commit 5d55b23

File tree

6 files changed

+182
-167
lines changed

6 files changed

+182
-167
lines changed

documentation.html

+4-9
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,6 @@ <h1>Utility functions</h1>
153153
[2]
154154
> numeric.dim([[1,2,3],[4,5,6]])
155155
[2,3]
156-
> x = [[1,2,3],[4,5,6]]
157-
[[1,2,3],
158-
[4,5,6]]
159156
</pre>
160157

161158
You can perform a deep comparison of Arrays using <tt>numeric.same()</tt>:
@@ -317,7 +314,7 @@ <h1>Arithmetic operations</h1>
317314

318315
<h1>Linear algebra</h1>
319316

320-
Matrix products are implemented in the function the functions
317+
Matrix products are implemented in the functions
321318
<tt>numeric.dotVV()</tt>
322319
<tt>numeric.dotVM()</tt>
323320
<tt>numeric.dotMV()</tt>
@@ -415,12 +412,10 @@ <h1>Data manipulation</h1>
415412
[ 1, 2.3, 0.3],
416413
[ 4.000e6, -5.3e-8, 62800]]
417414
> numeric.toCSV([[1.23456789123,2],[3,4]])
418-
"1.235,2
419-
3,4
415+
"1.23456789123,2
416+
3,4
420417
"
421418
</pre>
422-
Note that <tt>numeric.toCSV()</tt> uses <tt>numeric.prettyPrint()</tt> to print numbers. To obtain more
423-
digits, set <tt>numeric.precision</tt> to the desired number of digits of accuracy.
424419

425420
You can also fetch a URL (a thin wrapper around XMLHttpRequest):
426421
<pre>
@@ -518,7 +513,7 @@ <h1>Eigenvalues</h1>
518513
y:}}
519514
> C = B.E.dot(numeric.T.diag(B.lambda)).dot(B.E.inv());
520515
{x:[[ 1, 2, 5 ],
521-
[ 3, 5,-1.943e-15],
516+
[ 3, 5,-3.109e-15],
522517
[ 7, -3, 5 ]],
523518
y:}
524519
> C.sub(A).norm2()<1e-13

myworker.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ _onmessage = function(event) {
4040
_foo = e.name+': '+e.message;
4141
if(typeof e.stack !== "undefined" && typeof e.stack.toString !== "undefined")
4242
{ _foo += "\n\n"+e.stack.toString(); }
43-
_foo = _foo.replace(/&/g,'&amp;').replace(/>/g,'&gt;').replace(/</g,'&lt;').replace(/"/g,'&quot;');
4443
}
44+
_foo = _foo.replace(/&/g,'&amp;').replace(/>/g,'&gt;').replace(/</g,'&lt;').replace(/"/g,'&quot;');
4545
_send(JSON.stringify({k:_x.k,n:_x.n,o:_foo}));
4646
}
4747
if(typeof _retarded === "undefined") { onmessage = _onmessage; }

src/documentation.html

+4-9
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,6 @@ <h1>Utility functions</h1>
153153
[2]
154154
> numeric.dim([[1,2,3],[4,5,6]])
155155
[2,3]
156-
> x = [[1,2,3],[4,5,6]]
157-
[[1,2,3],
158-
[4,5,6]]
159156
</pre>
160157

161158
You can perform a deep comparison of Arrays using <tt>numeric.same()</tt>:
@@ -317,7 +314,7 @@ <h1>Arithmetic operations</h1>
317314

318315
<h1>Linear algebra</h1>
319316

320-
Matrix products are implemented in the function the functions
317+
Matrix products are implemented in the functions
321318
<tt>numeric.dotVV()</tt>
322319
<tt>numeric.dotVM()</tt>
323320
<tt>numeric.dotMV()</tt>
@@ -415,12 +412,10 @@ <h1>Data manipulation</h1>
415412
[ 1, 2.3, 0.3],
416413
[ 4.000e6, -5.3e-8, 62800]]
417414
> numeric.toCSV([[1.23456789123,2],[3,4]])
418-
"1.235,2
419-
3,4
415+
"1.23456789123,2
416+
3,4
420417
"
421418
</pre>
422-
Note that <tt>numeric.toCSV()</tt> uses <tt>numeric.prettyPrint()</tt> to print numbers. To obtain more
423-
digits, set <tt>numeric.precision</tt> to the desired number of digits of accuracy.
424419

425420
You can also fetch a URL (a thin wrapper around XMLHttpRequest):
426421
<pre>
@@ -518,7 +513,7 @@ <h1>Eigenvalues</h1>
518513
y:}}
519514
> C = B.E.dot(numeric.T.diag(B.lambda)).dot(B.E.inv());
520515
{x:[[ 1, 2, 5 ],
521-
[ 3, 5,-1.943e-15],
516+
[ 3, 5,-3.109e-15],
522517
[ 7, -3, 5 ]],
523518
y:}
524519
> C.sub(A).norm2()<1e-13

0 commit comments

Comments
 (0)