Skip to content

Commit 8d378ac

Browse files
author
Sébastien Loisel
committed
New workshop, small "strict mode" fixes, small linear programming improvement
1 parent d031439 commit 8d378ac

9 files changed

+283
-257
lines changed

benchmark.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@
152152
var i,j,foo;
153153
ks = sz.toString();
154154
if(rep>0 && c0[lib][rep-1] < 10) { c0[lib][rep] = c0[lib][rep-1]; }
155-
else { foo = benchmarks[b][lib+2]; c0[lib][rep] = foo(sz); }
155+
else { foo = benchmarks[b][lib+2]; if(k===0) foo(sz); c0[lib][rep] = foo(sz); }
156156
rep++;
157157
if(rep === 1) { rep = 0; lib++; }
158158
if(lib+2 === benchmarks[b].length) {

documentation.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -1209,7 +1209,7 @@ <h1>Linear programming</h1>
12091209
We also handle infeasible problems:
12101210
<pre>
12111211
IN> numeric.solveLP([1,1],[[1,0],[0,1],[-1,-1]],[-1,-1,-1])
1212-
OUT> { solution: NaN, message: "Infeasible", iterations: 6 }
1212+
OUT> { solution: NaN, message: "Infeasible", iterations: 5 }
12131213
</pre>
12141214

12151215
Unbounded problems:
@@ -1226,7 +1226,7 @@ <h1>Linear programming</h1>
12261226
[[1,1,1]], /* matrix Aeq of equality constraint */
12271227
[3] /* vector beq of equality constraint */
12281228
);
1229-
OUT> { solution: [3,4.167e-19,1.086e-18], message:"", iterations:11 }
1229+
OUT> { solution:[3,1.685e-16,4.559e-19], message:"", iterations:12 }
12301230
</pre>
12311231

12321232
<!--

index.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
The <a href="http://www.numericjs.com/">Numeric Javascript</a> library allows you to perform
1616
sophisticated numerical computations in pure javascript in the browser and elsewhere.<br><br>
1717

18-
<b>From the <a href="/wordpress/">blog</a>...
18+
<b>From the <a href="/wordpress/">blog</a>...</b>
1919
<ul style="margin-top:0;">
2020
<?php query_posts('showposts=3'); ?>
2121
<?php while (have_posts()) : the_post(); ?>

resources/style.css

-116
Original file line numberDiff line numberDiff line change
@@ -114,89 +114,6 @@ background-color:#f0f0ff;
114114
text-decoration:underline;
115115
}
116116

117-
118-
div.notsaved {
119-
font-weight:bold;
120-
text-align:center;
121-
color: #ff0000;
122-
}
123-
124-
div.col1 {
125-
float: left;
126-
}
127-
div.button {
128-
display:table-cell;
129-
font-size: 12px;
130-
width: 15px;
131-
font-weight: bold;
132-
vertical-align: top;
133-
-webkit-user-select: none;
134-
-khtml-user-select: none;
135-
-moz-user-select: none;
136-
-o-user-select: none;
137-
user-select: none;
138-
}
139-
div.button2 {
140-
display:table-cell;
141-
width: 15px;
142-
font-size: 10px;
143-
font-weight: bold;
144-
vertical-align: bottom;
145-
-webkit-user-select: none;
146-
-khtml-user-select: none;
147-
-moz-user-select: none;
148-
-o-user-select: none;
149-
user-select: none;
150-
}
151-
div.interactions { width:100%; clear:both; display:table; }
152-
div.spacer { width:5px; }
153-
div.inner { width:100%; display:table-row; }
154-
div.input {
155-
display:table-cell;
156-
width:100%;
157-
}
158-
div.output {
159-
display:table-cell;
160-
font-family: monospace;
161-
font-size: 14px;
162-
color: #000000;
163-
vertical-align: top;
164-
white-space: pre-wrap;
165-
padding-bottom:5px;
166-
line-height: 100%;
167-
}
168-
div.caret {
169-
display:table-cell;
170-
padding-top: 8px;
171-
width: 30px;
172-
font-family: sans-serif;
173-
color: #0000ff;
174-
vertical-align:top;
175-
text-align: right;
176-
font-size: 8px;
177-
-webkit-user-select: none;
178-
-khtml-user-select: none;
179-
-moz-user-select: none;
180-
-o-user-select: none;
181-
user-select: none;
182-
}
183-
div.out {
184-
display:table-cell;
185-
width: 30px;
186-
padding-top: 4px;
187-
padding-bottom: 4px;
188-
font-family: sans-serif;
189-
color: #000000;
190-
vertical-align:top;
191-
text-align: right;
192-
font-size: 8px;
193-
-webkit-user-select: none;
194-
-khtml-user-select: none;
195-
-moz-user-select: none;
196-
-o-user-select: none;
197-
user-select: none;
198-
}
199-
200117
div.plot {
201118
font-family: sans-serif;
202119
font-size: 14px;
@@ -206,39 +123,6 @@ div.plot {
206123
line-height: 100%;
207124
}
208125

209-
textarea.input {
210-
resize:none;
211-
overflow:hidden;
212-
font-family:monospace;
213-
font-size:14px;
214-
margin-top:0px;
215-
margin-left:1px;
216-
margin-bottom:1px;
217-
padding:1px;
218-
border:2px solid #0000ff;
219-
background-color: #d0d0ff;
220-
width: 100%;
221-
box-sizing: border-box;
222-
-webkit-box-sizing:border-box;
223-
-moz-box-sizing: border-box;
224-
-ms-box-sizing: border-box;
225-
}
226-
textarea.runned {
227-
resize:none;
228-
overflow:hidden;
229-
font-family:monospace;
230-
font-size:14px;
231-
margin-top:0px;
232-
margin-left:1px;
233-
margin-bottom:1px;
234-
padding:1px;
235-
border:2px solid #0000ff;
236-
width: 100%;
237-
box-sizing: border-box;
238-
-webkit-box-sizing:border-box;
239-
-moz-box-sizing: border-box;
240-
-ms-box-sizing: border-box;
241-
}
242126
a.button:link { text-decoration: none; color: #0000ff; }
243127
a.button:visited { text-decoration: none; color: #0000ff; }
244128
a.button:active { text-decoration: none; color: #0000ff; }

src/documentation.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -1209,7 +1209,7 @@ <h1>Linear programming</h1>
12091209
We also handle infeasible problems:
12101210
<pre>
12111211
IN> numeric.solveLP([1,1],[[1,0],[0,1],[-1,-1]],[-1,-1,-1])
1212-
OUT> { solution: NaN, message: "Infeasible", iterations: 6 }
1212+
OUT> { solution: NaN, message: "Infeasible", iterations: 5 }
12131213
</pre>
12141214

12151215
Unbounded problems:
@@ -1226,7 +1226,7 @@ <h1>Linear programming</h1>
12261226
[[1,1,1]], /* matrix Aeq of equality constraint */
12271227
[3] /* vector beq of equality constraint */
12281228
);
1229-
OUT> { solution: [3,4.167e-19,1.086e-18], message:"", iterations:11 }
1229+
OUT> { solution:[3,1.685e-16,4.559e-19], message:"", iterations:12 }
12301230
</pre>
12311231

12321232
<!--

0 commit comments

Comments
 (0)