Skip to content

Commit

Permalink
modified: CeresHelper.js
Browse files Browse the repository at this point in the history
	modified:   dist/ceres.js
	modified:   docs/index.html
  • Loading branch information
Your Name committed Feb 2, 2024
1 parent ce99b2e commit c10b982
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
7 changes: 7 additions & 0 deletions CeresHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,13 @@ export class Ceres {
}

static create_evalutex_fn(fn_string, variables){

let count = (fn_string.match(/=/g) || []).length;
if (count == 1){
let fn_array = fn_string.split("=")
fn_string = fn_array[1]+"-("+fn_array[0]+")"
}

let fn = evaluatex(fn_string);
let fn1 = function(variables, fn, x){
let v = Object.keys(variables);
Expand Down
7 changes: 7 additions & 0 deletions dist/ceres.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -323,10 +323,11 @@ <h2>Code Generator</h2>
}

const {Ceres} = await import('https://cdn.jsdelivr.net/gh/Pterodactylus/Ceres.js@latest/dist/ceres.min.js');
//const {Ceres} = await import('../dist/ceres.js');
let solver = new Ceres()
let results = await solver.run(jsonSystem);
document.getElementById("generator_demo").value = results.report
console.log(results.x)
//console.log(results.x)
document.getElementById("res1").setValue(results.x[0].toFixed(10))
document.getElementById("res2").setValue(results.x[1].toFixed(10))
}
Expand Down

0 comments on commit c10b982

Please sign in to comment.