-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9fa152f
commit 0885d00
Showing
3 changed files
with
111 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,11 +18,12 @@ <h1>lp-model</h1> | |
convenient syntax, used together with the <code>highs-js</code> and <code>glpk.js</code> solvers using | ||
WebAssembly. | ||
</p> | ||
<pre id="output"></pre> | ||
<pre id="output" style="font-size: 0.85rem;"></pre> | ||
<p>If you see an ILP written in the CPLEX LP format, and both the HiGHS solution and the GLPK solution, it worked! <a href="https://github.com/DominikPeters/lp-model/blob/master/index.html">HTML source code</a></p> | ||
</main> | ||
<!-- <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/lp-model.min.js"></script> --> | ||
<script src="https://cdn.jsdelivr.net/npm/highs/build/highs.js"></script> | ||
<script src="https://unpkg.com/javascript-lp-solver/prod/solver.js"></script> | ||
<script type="module"> | ||
import { Model } from "https://cdn.jsdelivr.net/npm/[email protected]/dist/lp-model.es.min.js"; | ||
import GLPK from "https://cdn.jsdelivr.net/npm/glpk.js"; | ||
|
@@ -49,6 +50,10 @@ <h1>lp-model</h1> | |
const glpk = await GLPK(); | ||
await m.solve(glpk); | ||
pre.textContent += `\n\nGLPK solution:\n x = ${x.value}\n y = ${y.value}`; | ||
|
||
const jsLPSolver = window.solver; | ||
await m.solve(jsLPSolver); | ||
pre.textContent += `\n\njsLPSolver solution:\n x = ${x.value}\n y = ${y.value}`; | ||
} | ||
|
||
window.main = main; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters