Skip to content

Commit 3cf17f0

Browse files
author
Sébastien Loisel
committed
v1.2.5: fix bug found by Michael J.
1 parent 8d378ac commit 3cf17f0

10 files changed

+94
-33
lines changed

benchmark.html

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<!doctype html>
12
<html>
23
<head>
34
<link rel="SHORTCUT ICON" href="favicon.ico">

documentation.html

+14
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
<!doctype html>
2+
<html>
13
<head>
24
<link rel="SHORTCUT ICON" href="favicon.ico">
35
<link href='http://fonts.googleapis.com/css?family=Lato' rel='stylesheet' type='text/css'>
@@ -1252,6 +1254,18 @@ <h1>Linear programming</h1>
12521254
</pre>
12531255
-->
12541256

1257+
<!--
1258+
Bug found by Michael J.
1259+
<pre>
1260+
IN> numeric.solveLP([1,2,3], /* minimize [1,2,3]*x */
1261+
[[1, 0, 0], [0, 1, 0], [0, 0, 1],[-1,0,0],[0,-1,0],[0,0,-1]], /* matrix A of inequality constraint */
1262+
[1,1,1,0,0,0], /* RHS b of inequality constraint */
1263+
[[1,1,1]], /* matrix Aeq of equality constraint */
1264+
[3] /* vector beq of equality constraint */
1265+
);
1266+
OUT> { solution:NaN, message:"Infeasible", iterations:10 }
1267+
</pre>
1268+
-->
12551269

12561270
<h1>Solving ODEs</h1>
12571271

index.php

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<html>
22
<head>
3+
<meta name="google-site-verification" content="wRToy1IFW5JCMZF58VL7Y4Bo0-twB2EGpk1pmMrKsk8" />
34
<link rel="SHORTCUT ICON" href="favicon.ico">
45
<link href='http://fonts.googleapis.com/css?family=Lato' rel='stylesheet' type='text/css'>
56
<link rel="stylesheet" type="text/css" href="resources/style.css">
@@ -22,7 +23,11 @@
2223
<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>
2324
<?php endwhile;?>
2425
</ul>
26+
<a href="/wordpress/">More from the blog...</a>
2527

28+
<?php
29+
if(file_exists('../wordpress/leaderboard.html')) require('../wordpress/leaderboard.html');
30+
?>
2631
<div style="float:right; text-align:center; margin-top:15px;">
2732
<a href="workshop.php"><img src="resources/workshop.png" width=400><br>
2833
Numeric Workshop</a>

sitemap.xml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<urlset
3+
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
6+
http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
7+
<url>
8+
<loc>http://www.numericjs.com/</loc>
9+
</url>
10+
<url>
11+
<loc>http://www.numericjs.com/workshop.php</loc>
12+
</url>
13+
<url>
14+
<loc>http://www.numericjs.com/benchmark.html</loc>
15+
</url>
16+
<url>
17+
<loc>http://www.numericjs.com/documentation.html</loc>
18+
</url>
19+
<url>
20+
<loc>http://www.numericjs.com/report.html</loc>
21+
</url>
22+
</urlset>

src/documentation.html

+14
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
<!doctype html>
2+
<html>
13
<head>
24
<link rel="SHORTCUT ICON" href="favicon.ico">
35
<link href='http://fonts.googleapis.com/css?family=Lato' rel='stylesheet' type='text/css'>
@@ -1252,6 +1254,18 @@ <h1>Linear programming</h1>
12521254
</pre>
12531255
-->
12541256

1257+
<!--
1258+
Bug found by Michael J.
1259+
<pre>
1260+
IN> numeric.solveLP([1,2,3], /* minimize [1,2,3]*x */
1261+
[[1, 0, 0], [0, 1, 0], [0, 0, 1],[-1,0,0],[0,-1,0],[0,0,-1]], /* matrix A of inequality constraint */
1262+
[1,1,1,0,0,0], /* RHS b of inequality constraint */
1263+
[[1,1,1]], /* matrix Aeq of equality constraint */
1264+
[3] /* vector beq of equality constraint */
1265+
);
1266+
OUT> { solution:NaN, message:"Infeasible", iterations:10 }
1267+
</pre>
1268+
-->
12551269

12561270
<h1>Solving ODEs</h1>
12571271

src/numeric.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
var numeric = (typeof exports === "undefined")?(function numeric() {}):(exports);
44
if(typeof global !== "undefined") { global.numeric = numeric; }
55

6-
numeric.version = "1.2.4";
6+
numeric.version = "1.2.5";
77

88
// 1. Utility functions
99
numeric.bench = function bench (f,interval) {
@@ -3062,6 +3062,7 @@ numeric.__solveLP = function __solveLP(c,A,b,tol,maxit,x,flag) {
30623062
var p = Array(m), A0 = Array(n),e=numeric.rep([n],1), H;
30633063
var solve = numeric.solve, z = sub(b,dot(A,x)),count;
30643064
var dotcc = dot(c,c);
3065+
var g;
30653066
for(count=i0;count<maxit;++count) {
30663067
var i,j,d;
30673068
for(i=n-1;i!==-1;--i) A0[i] = div(A[i],z[i]);
@@ -3136,6 +3137,7 @@ numeric.solveLP = function solveLP(c,A,b,Aeq,beq,tol,maxit) {
31363137
var c4 = sub(c2,dot(c1,dot(B.I,Aeq2)));
31373138
var S = numeric._solveLP(c4,A4,b4,tol,maxit);
31383139
var x2 = S.solution;
3140+
if(x2!==x2) return S;
31393141
var x1 = dot(B.I,sub(beq,dot(Aeq2,x2)));
31403142
var x = Array(c.length);
31413143
for(i=P.length-1;i!==-1;--i) x[P[i]] = x1[i];

tools/deploy/mactests.txt

+28-26
Original file line numberDiff line numberDiff line change
@@ -197,19 +197,20 @@ Using Chrome
197197
185 PASS: numeric.solveLP([1,1],[[1,0],[0,1]],[0,0]).message; ==> "Unbounded"
198198
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}
199199
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"
200-
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:""}
201-
189 PASS: sol.at([0.3,0.7]) ==> [1.35,2.014]
202-
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]]
203-
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]]
204-
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:""}
205-
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:""}
206-
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:""}
207-
195 PASS: numeric.imageURL(numeric.rep([3],[[1,2],[3,4]])); ==> "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAIAAAD91JpzAAAAH0lEQVQIHQAIAPf/AAEBAQICAgABBwD4/wMDAwQEBAAAogAfhs2H3QAAAABJRU5ErkJggg=="
208-
196 PASS: numeric.gradient(function(x) { return Math.exp(Math.sin(x[0])*(x[1]+2)); },[1,2]); ==> [62.59,24.37]
209-
197 PASS: numeric.seedrandom.seedrandom(3); numeric.seedrandom.random() ==> 0.7569
210-
198 PASS: numeric.seedrandom.random() ==> 0.6139
211-
199 PASS: numeric.seedrandom.seedrandom(3); numeric.seedrandom.random() ==> 0.7569
212-
Chrome testing complete. PASS: 200 FAIL: 0 Total: 200
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}
201+
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:""}
202+
190 PASS: sol.at([0.3,0.7]) ==> [1.35,2.014]
203+
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]]
204+
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]]
205+
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:""}
206+
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:""}
207+
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:""}
208+
196 PASS: numeric.imageURL(numeric.rep([3],[[1,2],[3,4]])); ==> "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAIAAAD91JpzAAAAH0lEQVQIHQAIAPf/AAEBAQICAgABBwD4/wMDAwQEBAAAogAfhs2H3QAAAABJRU5ErkJggg=="
209+
197 PASS: numeric.gradient(function(x) { return Math.exp(Math.sin(x[0])*(x[1]+2)); },[1,2]); ==> [62.59,24.37]
210+
198 PASS: numeric.seedrandom.seedrandom(3); numeric.seedrandom.random() ==> 0.7569
211+
199 PASS: numeric.seedrandom.random() ==> 0.6139
212+
200 PASS: numeric.seedrandom.seedrandom(3); numeric.seedrandom.random() ==> 0.7569
213+
Chrome testing complete. PASS: 201 FAIL: 0 Total: 201
213214
Fetching http://numericjs.com/staging/documentation.html
214215
In-browser unit tests.
215216
Using Firefox
@@ -401,16 +402,17 @@ Using Firefox
401402
185 PASS: numeric.solveLP([1,1],[[1,0],[0,1]],[0,0]).message; ==> "Unbounded"
402403
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}
403404
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"
404-
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:""}
405-
189 PASS: sol.at([0.3,0.7]) ==> [1.35,2.014]
406-
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]]
407-
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]]
408-
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:""}
409-
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:""}
410-
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:""}
411-
195 PASS: numeric.imageURL(numeric.rep([3],[[1,2],[3,4]])); ==> "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAIAAAD91JpzAAAAH0lEQVQIHQAIAPf/AAEBAQICAgABBwD4/wMDAwQEBAAAogAfhs2H3QAAAABJRU5ErkJggg=="
412-
196 PASS: numeric.gradient(function(x) { return Math.exp(Math.sin(x[0])*(x[1]+2)); },[1,2]); ==> [62.59,24.37]
413-
197 PASS: numeric.seedrandom.seedrandom(3); numeric.seedrandom.random() ==> 0.7569
414-
198 PASS: numeric.seedrandom.random() ==> 0.6139
415-
199 PASS: numeric.seedrandom.seedrandom(3); numeric.seedrandom.random() ==> 0.7569
416-
Firefox testing complete. PASS: 200 FAIL: 0 Total: 200
405+
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}
406+
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:""}
407+
190 PASS: sol.at([0.3,0.7]) ==> [1.35,2.014]
408+
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]]
409+
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]]
410+
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:""}
411+
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:""}
412+
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:""}
413+
196 PASS: numeric.imageURL(numeric.rep([3],[[1,2],[3,4]])); ==> "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAIAAAD91JpzAAAAH0lEQVQIHQAIAPf/AAEBAQICAgABBwD4/wMDAwQEBAAAogAfhs2H3QAAAABJRU5ErkJggg=="
414+
197 PASS: numeric.gradient(function(x) { return Math.exp(Math.sin(x[0])*(x[1]+2)); },[1,2]); ==> [62.59,24.37]
415+
198 PASS: numeric.seedrandom.seedrandom(3); numeric.seedrandom.random() ==> 0.7569
416+
199 PASS: numeric.seedrandom.random() ==> 0.6139
417+
200 PASS: numeric.seedrandom.seedrandom(3); numeric.seedrandom.random() ==> 0.7569
418+
Firefox testing complete. PASS: 201 FAIL: 0 Total: 201

tools/selenium_links.py

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ def test(links,driver):
1919
try:
2020
link = driver.find_element_by_id(x[0])
2121
link.click()
22+
time.sleep(3)
2223
foo = driver.page_source
2324
driver.back()
2425
assert(x[1] in foo)

tools/workshop.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<link href='http://fonts.googleapis.com/css?family=Lato' rel='stylesheet' type='text/css'>
1010
<link rel="stylesheet" type="text/css" href="resources/style.css">
1111
<title>Numeric Javascript: Workshop</title>
12-
<!--[if lte IE 9]>
12+
<!--[if lte IE 10]>
1313
<script language="javascript" type="text/javascript" src="tools/excanvas.min.js"></script>
1414
<![endif]-->
1515
<script src="tools/megalib.js"></script>

workshop.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ function con() {
3333
<link href='http://fonts.googleapis.com/css?family=Lato' rel='stylesheet' type='text/css'>
3434
<link rel="stylesheet" type="text/css" href="resources/style.css">
3535
<title>Numeric Javascript: Workshop</title>
36-
<!--[if lte IE 9]>
36+
<!--[if lte IE 10]>
3737
<script language="javascript" type="text/javascript" src="tools/excanvas.min.js"></script>
3838
<![endif]-->
3939
<script src="tools/megalib.js"></script>
@@ -474,7 +474,7 @@ function submit() {
474474
$foo = json_decode($restore,true) or die("json error");
475475
$incs = $foo['scripts'];
476476
if(is_null($incs)) {
477-
$incs = array(1 => 'lib/numeric-1.2.4.js');
477+
$incs = array(1 => 'lib/numeric-1.2.5.js');
478478
}
479479
echo <<<EOT
480480
workshop._restore = $restore;
@@ -484,13 +484,13 @@ function submit() {
484484
workshop._restore = ((typeof localStorage.savedata === "string")?
485485
(JSON.parse(localStorage.savedata)):
486486
{inputs: [], outputs: [],
487-
scripts: ["lib/numeric-1.2.4.js"] });
487+
scripts: ["lib/numeric-1.2.5.js"] });
488488
EOT;
489489
}
490490
?>
491491

492-
workshop.version = "1.2.4";
493-
workshop.updateVersion = "lib/numeric-1.2.4.js";
492+
workshop.version = "1.2.5";
493+
workshop.updateVersion = "lib/numeric-1.2.5.js";
494494
workshop.preload(workshop._restore);
495495
</script>
496496

0 commit comments

Comments
 (0)