Skip to content

Commit

Permalink
v1.2.5: fix bug found by Michael J.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sébastien Loisel committed Dec 18, 2012
1 parent 8d378ac commit 3cf17f0
Show file tree
Hide file tree
Showing 10 changed files with 94 additions and 33 deletions.
1 change: 1 addition & 0 deletions benchmark.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!doctype html>
<html>
<head>
<link rel="SHORTCUT ICON" href="favicon.ico">
Expand Down
14 changes: 14 additions & 0 deletions documentation.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<!doctype html>
<html>
<head>
<link rel="SHORTCUT ICON" href="favicon.ico">
<link href='http://fonts.googleapis.com/css?family=Lato' rel='stylesheet' type='text/css'>
Expand Down Expand Up @@ -1252,6 +1254,18 @@ <h1>Linear programming</h1>
</pre>
-->

<!--
Bug found by Michael J.
<pre>
IN> numeric.solveLP([1,2,3], /* minimize [1,2,3]*x */
[[1, 0, 0], [0, 1, 0], [0, 0, 1],[-1,0,0],[0,-1,0],[0,0,-1]], /* matrix A of inequality constraint */
[1,1,1,0,0,0], /* RHS b of inequality constraint */
[[1,1,1]], /* matrix Aeq of equality constraint */
[3] /* vector beq of equality constraint */
);
OUT> { solution:NaN, message:"Infeasible", iterations:10 }
</pre>
-->

<h1>Solving ODEs</h1>

Expand Down
5 changes: 5 additions & 0 deletions index.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<html>
<head>
<meta name="google-site-verification" content="wRToy1IFW5JCMZF58VL7Y4Bo0-twB2EGpk1pmMrKsk8" />
<link rel="SHORTCUT ICON" href="favicon.ico">
<link href='http://fonts.googleapis.com/css?family=Lato' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="resources/style.css">
Expand All @@ -22,7 +23,11 @@
<li><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a> <small>(<?php the_time('F j, Y'); ?>)</small>
<?php endwhile;?>
</ul>
<a href="/wordpress/">More from the blog...</a>

<?php
if(file_exists('../wordpress/leaderboard.html')) require('../wordpress/leaderboard.html');
?>
<div style="float:right; text-align:center; margin-top:15px;">
<a href="workshop.php"><img src="resources/workshop.png" width=400><br>
Numeric Workshop</a>
Expand Down
22 changes: 22 additions & 0 deletions sitemap.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<urlset
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
<url>
<loc>http://www.numericjs.com/</loc>
</url>
<url>
<loc>http://www.numericjs.com/workshop.php</loc>
</url>
<url>
<loc>http://www.numericjs.com/benchmark.html</loc>
</url>
<url>
<loc>http://www.numericjs.com/documentation.html</loc>
</url>
<url>
<loc>http://www.numericjs.com/report.html</loc>
</url>
</urlset>
14 changes: 14 additions & 0 deletions src/documentation.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<!doctype html>
<html>
<head>
<link rel="SHORTCUT ICON" href="favicon.ico">
<link href='http://fonts.googleapis.com/css?family=Lato' rel='stylesheet' type='text/css'>
Expand Down Expand Up @@ -1252,6 +1254,18 @@ <h1>Linear programming</h1>
</pre>
-->

<!--
Bug found by Michael J.
<pre>
IN> numeric.solveLP([1,2,3], /* minimize [1,2,3]*x */
[[1, 0, 0], [0, 1, 0], [0, 0, 1],[-1,0,0],[0,-1,0],[0,0,-1]], /* matrix A of inequality constraint */
[1,1,1,0,0,0], /* RHS b of inequality constraint */
[[1,1,1]], /* matrix Aeq of equality constraint */
[3] /* vector beq of equality constraint */
);
OUT> { solution:NaN, message:"Infeasible", iterations:10 }
</pre>
-->

<h1>Solving ODEs</h1>

Expand Down
4 changes: 3 additions & 1 deletion src/numeric.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
var numeric = (typeof exports === "undefined")?(function numeric() {}):(exports);
if(typeof global !== "undefined") { global.numeric = numeric; }

numeric.version = "1.2.4";
numeric.version = "1.2.5";

// 1. Utility functions
numeric.bench = function bench (f,interval) {
Expand Down Expand Up @@ -3062,6 +3062,7 @@ numeric.__solveLP = function __solveLP(c,A,b,tol,maxit,x,flag) {
var p = Array(m), A0 = Array(n),e=numeric.rep([n],1), H;
var solve = numeric.solve, z = sub(b,dot(A,x)),count;
var dotcc = dot(c,c);
var g;
for(count=i0;count<maxit;++count) {
var i,j,d;
for(i=n-1;i!==-1;--i) A0[i] = div(A[i],z[i]);
Expand Down Expand Up @@ -3136,6 +3137,7 @@ numeric.solveLP = function solveLP(c,A,b,Aeq,beq,tol,maxit) {
var c4 = sub(c2,dot(c1,dot(B.I,Aeq2)));
var S = numeric._solveLP(c4,A4,b4,tol,maxit);
var x2 = S.solution;
if(x2!==x2) return S;
var x1 = dot(B.I,sub(beq,dot(Aeq2,x2)));
var x = Array(c.length);
for(i=P.length-1;i!==-1;--i) x[P[i]] = x1[i];
Expand Down
54 changes: 28 additions & 26 deletions tools/deploy/mactests.txt
Original file line number Diff line number Diff line change
Expand Up @@ -197,19 +197,20 @@ Using Chrome
185 PASS: numeric.solveLP([1,1],[[1,0],[0,1]],[0,0]).message; ==> "Unbounded"
186 PASS: numeric.solveLP([1,2,3], /* minimize [1,2,3]*x */ [[-1,0,0],[0,-1,0],[0,0,-1]], /* matrix A of inequality constraint */ [0,0,0], /* RHS b of inequality constraint */ [[1,1,1]], /* matrix Aeq of equality constraint */ [3] /* vector beq of equality constraint */ ); ==> {solution:[3,1.685e-16,4.559e-19],message:"",iterations:12}
187 PASS: n = 7; m = 3; for(k=0;k<10;++k) { A = numeric.random([n,n]); x = numeric.rep([m],1).concat(numeric.rep([n-m],0)); b = numeric.dot(A,x); J = numeric.diag(numeric.rep([n],-1)); B = numeric.blockMatrix([[A , J ], [numeric.neg(A) , J ], [numeric.rep([n,n],0), J ]]); c = b.concat(numeric.neg(b)).concat(numeric.rep([n],0)); d = numeric.rep([n],0).concat(numeric.rep([n],1)); y = numeric.solveLP(d,B,c).solution; y.length = n; foo = numeric.norm2(numeric.sub(x,y)); if(foo>1e-10) throw new Error("solveLP test fails: "+numeric.prettyPrint({A:A,x:x})); } "solveLP tests pass" ==> "solveLPtestspass"
188 PASS: sol = numeric.dopri(0,1,1,function(t,y) { return y; }) ==> {x:[0,0.1,0.1522,0.361,0.5792,0.7843,0.9813,1],y:[1,1.105,1.164,1.435,1.785,2.191,2.668,2.718],f:[1,1.105,1.164,1.435,1.785,2.191,2.668,2.718],ymid:[1.051,1.134,1.293,1.6,1.977,2.418,2.693],iterations:8,events:,message:""}
189 PASS: sol.at([0.3,0.7]) ==> [1.35,2.014]
190 PASS: sol = numeric.dopri(0,10,[3,0],function (x,y) { return [y[1],-y[0]]; }); sol.at([0,0.5*Math.PI,Math.PI,1.5*Math.PI,2*Math.PI]) ==> [[3,0],[-9.534e-8,-3],[-3,2.768e-7],[3.63e-7,3],[3,-3.065e-7]]
191 PASS: numeric.dopri(0,20,[2,0],function(t,y) { return [y[1], (1-y[0]*y[0])*y[1]-y[0]]; }).at([18,19,20]) ==> [[-1.208,0.9916],[0.4258,2.535],[2.008,-0.04251]]
192 PASS: sol = numeric.dopri(0,2,1,function (x,y) { return y; },1e-8,100,function (x,y) { return y-1.3; }); ==> {x:[0,0.0181,0.09051,0.1822,0.2624],y:[1,1.018,1.095,1.2,1.3],f:[1,1.018,1.095,1.2,1.3],ymid:[1.009,1.056,1.146,1.249],iterations:5,events:true,message:""}
193 PASS: sol = numeric.dopri(0,2,1, function(x,y) { return y; }, undefined,50, function(x,y) { return [y-1.5,Math.sin(y-1.5)]; }); ==> {x:[0,0.2,0.4055],y:[1,1.221,1.5],f:[1,1.221,1.5],ymid:[1.105,1.354],iterations:2,events:[true,true],message:""}
194 PASS: D = numeric.identity(8); d = numeric.rep([8],0); A = [[1, 1, -1, 0, 0, 0, 0, 0, 0, 0],[-1, 1, 0, 1, 0, 0, 0, 0, 0, 0],[1, 1, 0, 0, -1, 0, 0, 0, 0, 0],[-1, 1, 0, 0, 0, 1, 0, 0, 0, 0],[1, 1, 0, 0, 0, 0, -1, 0, 0, 0],[-1, 1, 0, 0, 0, 0, 0, 1, 0, 0],[1, 1, 0, 0, 0, 0, 0, 0, -1, 0],[-1, 1, 0, 0, 0, 0, 0, 0, 0, 1]]; b = [1, 1, -1, 0, -1, 0, -1, 0, -1, 0]; numeric.solveQP(D,d,A,b,undefined,2) ==> {solution:[0.25,0,0.25,0,0.25,0,0.25,0],value:[0.125],unconstrained_solution:[0,0,0,0,0,0,0,0],iterations:[3,0],iact:[1,2,0,0,0,0,0,0,0,0],message:""}
195 PASS: numeric.imageURL(numeric.rep([3],[[1,2],[3,4]])); ==> "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAIAAAD91JpzAAAAH0lEQVQIHQAIAPf/AAEBAQICAgABBwD4/wMDAwQEBAAAogAfhs2H3QAAAABJRU5ErkJggg=="
196 PASS: numeric.gradient(function(x) { return Math.exp(Math.sin(x[0])*(x[1]+2)); },[1,2]); ==> [62.59,24.37]
197 PASS: numeric.seedrandom.seedrandom(3); numeric.seedrandom.random() ==> 0.7569
198 PASS: numeric.seedrandom.random() ==> 0.6139
199 PASS: numeric.seedrandom.seedrandom(3); numeric.seedrandom.random() ==> 0.7569
Chrome testing complete. PASS: 200 FAIL: 0 Total: 200
188 PASS: numeric.solveLP([1,2,3], /* minimize [1,2,3]*x */ [[1, 0, 0], [0, 1, 0], [0, 0, 1],[-1,0,0],[0,-1,0],[0,0,-1]], /* matrix A of inequality constraint */ [1,1,1,0,0,0], /* RHS b of inequality constraint */ [[1,1,1]], /* matrix Aeq of equality constraint */ [3] /* vector beq of equality constraint */ ); ==> {solution:NaN,message:"Infeasible",iterations:10}
189 PASS: sol = numeric.dopri(0,1,1,function(t,y) { return y; }) ==> {x:[0,0.1,0.1522,0.361,0.5792,0.7843,0.9813,1],y:[1,1.105,1.164,1.435,1.785,2.191,2.668,2.718],f:[1,1.105,1.164,1.435,1.785,2.191,2.668,2.718],ymid:[1.051,1.134,1.293,1.6,1.977,2.418,2.693],iterations:8,events:,message:""}
190 PASS: sol.at([0.3,0.7]) ==> [1.35,2.014]
191 PASS: sol = numeric.dopri(0,10,[3,0],function (x,y) { return [y[1],-y[0]]; }); sol.at([0,0.5*Math.PI,Math.PI,1.5*Math.PI,2*Math.PI]) ==> [[3,0],[-9.534e-8,-3],[-3,2.768e-7],[3.63e-7,3],[3,-3.065e-7]]
192 PASS: numeric.dopri(0,20,[2,0],function(t,y) { return [y[1], (1-y[0]*y[0])*y[1]-y[0]]; }).at([18,19,20]) ==> [[-1.208,0.9916],[0.4258,2.535],[2.008,-0.04251]]
193 PASS: sol = numeric.dopri(0,2,1,function (x,y) { return y; },1e-8,100,function (x,y) { return y-1.3; }); ==> {x:[0,0.0181,0.09051,0.1822,0.2624],y:[1,1.018,1.095,1.2,1.3],f:[1,1.018,1.095,1.2,1.3],ymid:[1.009,1.056,1.146,1.249],iterations:5,events:true,message:""}
194 PASS: sol = numeric.dopri(0,2,1, function(x,y) { return y; }, undefined,50, function(x,y) { return [y-1.5,Math.sin(y-1.5)]; }); ==> {x:[0,0.2,0.4055],y:[1,1.221,1.5],f:[1,1.221,1.5],ymid:[1.105,1.354],iterations:2,events:[true,true],message:""}
195 PASS: D = numeric.identity(8); d = numeric.rep([8],0); A = [[1, 1, -1, 0, 0, 0, 0, 0, 0, 0],[-1, 1, 0, 1, 0, 0, 0, 0, 0, 0],[1, 1, 0, 0, -1, 0, 0, 0, 0, 0],[-1, 1, 0, 0, 0, 1, 0, 0, 0, 0],[1, 1, 0, 0, 0, 0, -1, 0, 0, 0],[-1, 1, 0, 0, 0, 0, 0, 1, 0, 0],[1, 1, 0, 0, 0, 0, 0, 0, -1, 0],[-1, 1, 0, 0, 0, 0, 0, 0, 0, 1]]; b = [1, 1, -1, 0, -1, 0, -1, 0, -1, 0]; numeric.solveQP(D,d,A,b,undefined,2) ==> {solution:[0.25,0,0.25,0,0.25,0,0.25,0],value:[0.125],unconstrained_solution:[0,0,0,0,0,0,0,0],iterations:[3,0],iact:[1,2,0,0,0,0,0,0,0,0],message:""}
196 PASS: numeric.imageURL(numeric.rep([3],[[1,2],[3,4]])); ==> "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAIAAAD91JpzAAAAH0lEQVQIHQAIAPf/AAEBAQICAgABBwD4/wMDAwQEBAAAogAfhs2H3QAAAABJRU5ErkJggg=="
197 PASS: numeric.gradient(function(x) { return Math.exp(Math.sin(x[0])*(x[1]+2)); },[1,2]); ==> [62.59,24.37]
198 PASS: numeric.seedrandom.seedrandom(3); numeric.seedrandom.random() ==> 0.7569
199 PASS: numeric.seedrandom.random() ==> 0.6139
200 PASS: numeric.seedrandom.seedrandom(3); numeric.seedrandom.random() ==> 0.7569
Chrome testing complete. PASS: 201 FAIL: 0 Total: 201
Fetching http://numericjs.com/staging/documentation.html
In-browser unit tests.
Using Firefox
Expand Down Expand Up @@ -401,16 +402,17 @@ Using Firefox
185 PASS: numeric.solveLP([1,1],[[1,0],[0,1]],[0,0]).message; ==> "Unbounded"
186 PASS: numeric.solveLP([1,2,3], /* minimize [1,2,3]*x */ [[-1,0,0],[0,-1,0],[0,0,-1]], /* matrix A of inequality constraint */ [0,0,0], /* RHS b of inequality constraint */ [[1,1,1]], /* matrix Aeq of equality constraint */ [3] /* vector beq of equality constraint */ ); ==> {solution:[3,1.685e-16,4.559e-19],message:"",iterations:12}
187 PASS: n = 7; m = 3; for(k=0;k<10;++k) { A = numeric.random([n,n]); x = numeric.rep([m],1).concat(numeric.rep([n-m],0)); b = numeric.dot(A,x); J = numeric.diag(numeric.rep([n],-1)); B = numeric.blockMatrix([[A , J ], [numeric.neg(A) , J ], [numeric.rep([n,n],0), J ]]); c = b.concat(numeric.neg(b)).concat(numeric.rep([n],0)); d = numeric.rep([n],0).concat(numeric.rep([n],1)); y = numeric.solveLP(d,B,c).solution; y.length = n; foo = numeric.norm2(numeric.sub(x,y)); if(foo>1e-10) throw new Error("solveLP test fails: "+numeric.prettyPrint({A:A,x:x})); } "solveLP tests pass" ==> "solveLPtestspass"
188 PASS: sol = numeric.dopri(0,1,1,function(t,y) { return y; }) ==> {x:[0,0.1,0.1522,0.361,0.5792,0.7843,0.9813,1],y:[1,1.105,1.164,1.435,1.785,2.191,2.668,2.718],f:[1,1.105,1.164,1.435,1.785,2.191,2.668,2.718],ymid:[1.051,1.134,1.293,1.6,1.977,2.418,2.693],iterations:8,events:,message:""}
189 PASS: sol.at([0.3,0.7]) ==> [1.35,2.014]
190 PASS: sol = numeric.dopri(0,10,[3,0],function (x,y) { return [y[1],-y[0]]; }); sol.at([0,0.5*Math.PI,Math.PI,1.5*Math.PI,2*Math.PI]) ==> [[3,0],[-9.534e-8,-3],[-3,2.768e-7],[3.63e-7,3],[3,-3.065e-7]]
191 PASS: numeric.dopri(0,20,[2,0],function(t,y) { return [y[1], (1-y[0]*y[0])*y[1]-y[0]]; }).at([18,19,20]) ==> [[-1.208,0.9916],[0.4258,2.535],[2.008,-0.04251]]
192 PASS: sol = numeric.dopri(0,2,1,function (x,y) { return y; },1e-8,100,function (x,y) { return y-1.3; }); ==> {x:[0,0.0181,0.09051,0.1822,0.2624],y:[1,1.018,1.095,1.2,1.3],f:[1,1.018,1.095,1.2,1.3],ymid:[1.009,1.056,1.146,1.249],iterations:5,events:true,message:""}
193 PASS: sol = numeric.dopri(0,2,1, function(x,y) { return y; }, undefined,50, function(x,y) { return [y-1.5,Math.sin(y-1.5)]; }); ==> {x:[0,0.2,0.4055],y:[1,1.221,1.5],f:[1,1.221,1.5],ymid:[1.105,1.354],iterations:2,events:[true,true],message:""}
194 PASS: D = numeric.identity(8); d = numeric.rep([8],0); A = [[1, 1, -1, 0, 0, 0, 0, 0, 0, 0],[-1, 1, 0, 1, 0, 0, 0, 0, 0, 0],[1, 1, 0, 0, -1, 0, 0, 0, 0, 0],[-1, 1, 0, 0, 0, 1, 0, 0, 0, 0],[1, 1, 0, 0, 0, 0, -1, 0, 0, 0],[-1, 1, 0, 0, 0, 0, 0, 1, 0, 0],[1, 1, 0, 0, 0, 0, 0, 0, -1, 0],[-1, 1, 0, 0, 0, 0, 0, 0, 0, 1]]; b = [1, 1, -1, 0, -1, 0, -1, 0, -1, 0]; numeric.solveQP(D,d,A,b,undefined,2) ==> {solution:[0.25,0,0.25,0,0.25,0,0.25,0],value:[0.125],unconstrained_solution:[0,0,0,0,0,0,0,0],iterations:[3,0],iact:[1,2,0,0,0,0,0,0,0,0],message:""}
195 PASS: numeric.imageURL(numeric.rep([3],[[1,2],[3,4]])); ==> "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAIAAAD91JpzAAAAH0lEQVQIHQAIAPf/AAEBAQICAgABBwD4/wMDAwQEBAAAogAfhs2H3QAAAABJRU5ErkJggg=="
196 PASS: numeric.gradient(function(x) { return Math.exp(Math.sin(x[0])*(x[1]+2)); },[1,2]); ==> [62.59,24.37]
197 PASS: numeric.seedrandom.seedrandom(3); numeric.seedrandom.random() ==> 0.7569
198 PASS: numeric.seedrandom.random() ==> 0.6139
199 PASS: numeric.seedrandom.seedrandom(3); numeric.seedrandom.random() ==> 0.7569
Firefox testing complete. PASS: 200 FAIL: 0 Total: 200
188 PASS: numeric.solveLP([1,2,3], /* minimize [1,2,3]*x */ [[1, 0, 0], [0, 1, 0], [0, 0, 1],[-1,0,0],[0,-1,0],[0,0,-1]], /* matrix A of inequality constraint */ [1,1,1,0,0,0], /* RHS b of inequality constraint */ [[1,1,1]], /* matrix Aeq of equality constraint */ [3] /* vector beq of equality constraint */ ); ==> {solution:NaN,message:"Infeasible",iterations:10}
189 PASS: sol = numeric.dopri(0,1,1,function(t,y) { return y; }) ==> {x:[0,0.1,0.1522,0.361,0.5792,0.7843,0.9813,1],y:[1,1.105,1.164,1.435,1.785,2.191,2.668,2.718],f:[1,1.105,1.164,1.435,1.785,2.191,2.668,2.718],ymid:[1.051,1.134,1.293,1.6,1.977,2.418,2.693],iterations:8,events:,message:""}
190 PASS: sol.at([0.3,0.7]) ==> [1.35,2.014]
191 PASS: sol = numeric.dopri(0,10,[3,0],function (x,y) { return [y[1],-y[0]]; }); sol.at([0,0.5*Math.PI,Math.PI,1.5*Math.PI,2*Math.PI]) ==> [[3,0],[-9.534e-8,-3],[-3,2.768e-7],[3.63e-7,3],[3,-3.065e-7]]
192 PASS: numeric.dopri(0,20,[2,0],function(t,y) { return [y[1], (1-y[0]*y[0])*y[1]-y[0]]; }).at([18,19,20]) ==> [[-1.208,0.9916],[0.4258,2.535],[2.008,-0.04251]]
193 PASS: sol = numeric.dopri(0,2,1,function (x,y) { return y; },1e-8,100,function (x,y) { return y-1.3; }); ==> {x:[0,0.0181,0.09051,0.1822,0.2624],y:[1,1.018,1.095,1.2,1.3],f:[1,1.018,1.095,1.2,1.3],ymid:[1.009,1.056,1.146,1.249],iterations:5,events:true,message:""}
194 PASS: sol = numeric.dopri(0,2,1, function(x,y) { return y; }, undefined,50, function(x,y) { return [y-1.5,Math.sin(y-1.5)]; }); ==> {x:[0,0.2,0.4055],y:[1,1.221,1.5],f:[1,1.221,1.5],ymid:[1.105,1.354],iterations:2,events:[true,true],message:""}
195 PASS: D = numeric.identity(8); d = numeric.rep([8],0); A = [[1, 1, -1, 0, 0, 0, 0, 0, 0, 0],[-1, 1, 0, 1, 0, 0, 0, 0, 0, 0],[1, 1, 0, 0, -1, 0, 0, 0, 0, 0],[-1, 1, 0, 0, 0, 1, 0, 0, 0, 0],[1, 1, 0, 0, 0, 0, -1, 0, 0, 0],[-1, 1, 0, 0, 0, 0, 0, 1, 0, 0],[1, 1, 0, 0, 0, 0, 0, 0, -1, 0],[-1, 1, 0, 0, 0, 0, 0, 0, 0, 1]]; b = [1, 1, -1, 0, -1, 0, -1, 0, -1, 0]; numeric.solveQP(D,d,A,b,undefined,2) ==> {solution:[0.25,0,0.25,0,0.25,0,0.25,0],value:[0.125],unconstrained_solution:[0,0,0,0,0,0,0,0],iterations:[3,0],iact:[1,2,0,0,0,0,0,0,0,0],message:""}
196 PASS: numeric.imageURL(numeric.rep([3],[[1,2],[3,4]])); ==> "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAIAAAD91JpzAAAAH0lEQVQIHQAIAPf/AAEBAQICAgABBwD4/wMDAwQEBAAAogAfhs2H3QAAAABJRU5ErkJggg=="
197 PASS: numeric.gradient(function(x) { return Math.exp(Math.sin(x[0])*(x[1]+2)); },[1,2]); ==> [62.59,24.37]
198 PASS: numeric.seedrandom.seedrandom(3); numeric.seedrandom.random() ==> 0.7569
199 PASS: numeric.seedrandom.random() ==> 0.6139
200 PASS: numeric.seedrandom.seedrandom(3); numeric.seedrandom.random() ==> 0.7569
Firefox testing complete. PASS: 201 FAIL: 0 Total: 201
1 change: 1 addition & 0 deletions tools/selenium_links.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def test(links,driver):
try:
link = driver.find_element_by_id(x[0])
link.click()
time.sleep(3)
foo = driver.page_source
driver.back()
assert(x[1] in foo)
Expand Down
2 changes: 1 addition & 1 deletion tools/workshop.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<link href='http://fonts.googleapis.com/css?family=Lato' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="resources/style.css">
<title>Numeric Javascript: Workshop</title>
<!--[if lte IE 9]>
<!--[if lte IE 10]>
<script language="javascript" type="text/javascript" src="tools/excanvas.min.js"></script>
<![endif]-->
<script src="tools/megalib.js"></script>
Expand Down
10 changes: 5 additions & 5 deletions workshop.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function con() {
<link href='http://fonts.googleapis.com/css?family=Lato' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="resources/style.css">
<title>Numeric Javascript: Workshop</title>
<!--[if lte IE 9]>
<!--[if lte IE 10]>
<script language="javascript" type="text/javascript" src="tools/excanvas.min.js"></script>
<![endif]-->
<script src="tools/megalib.js"></script>
Expand Down Expand Up @@ -474,7 +474,7 @@ function submit() {
$foo = json_decode($restore,true) or die("json error");
$incs = $foo['scripts'];
if(is_null($incs)) {
$incs = array(1 => 'lib/numeric-1.2.4.js');
$incs = array(1 => 'lib/numeric-1.2.5.js');
}
echo <<<EOT
workshop._restore = $restore;
Expand All @@ -484,13 +484,13 @@ function submit() {
workshop._restore = ((typeof localStorage.savedata === "string")?
(JSON.parse(localStorage.savedata)):
{inputs: [], outputs: [],
scripts: ["lib/numeric-1.2.4.js"] });
scripts: ["lib/numeric-1.2.5.js"] });
EOT;
}
?>

workshop.version = "1.2.4";
workshop.updateVersion = "lib/numeric-1.2.4.js";
workshop.version = "1.2.5";
workshop.updateVersion = "lib/numeric-1.2.5.js";
workshop.preload(workshop._restore);
</script>

Expand Down

0 comments on commit 3cf17f0

Please sign in to comment.