Skip to content

Commit

Permalink
modified: README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
miner committed Jan 5, 2024
1 parent 5b2b8ce commit b3d86b5
Showing 1 changed file with 10 additions and 21 deletions.
31 changes: 10 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,27 +75,16 @@ Ceres.js takes a vector of residual equations that are all equal to zero when th
}
var solver = new Ceres();
solver.promise.then(function(result) {
solver.addFunction(fn1) //Add the first equation to the solver.
solver.addFunction(fn2) //Add the second equation to the solver.
solver.addCallback(c1) //Add the callback to the solver.
//solver.addLowerbound(0,1.6) //Add a lower bound to the x[0] variable
//solver.addUpperbound(1,1.7) //Add a upper bound to the x[1] variable
var x_guess = [1,2] //Guess the initial values of the solution.
var s = solver.solve(x_guess) //Solve the equation
var x = s.x //assign the calculated solution array to the variable x
console.log(s.report); //Print solver report
solver.reset() //enables the solver to run agin without reloading
solver.addFunction(fn1) //Add the first equation to the solver.
solver.addFunction(fn2) //Add the second equation to the solver.
solver.addCallback(c1) //Add the callback to the solver.
var x_guess = [2,3] //Guess the initial values of the solution.
var s = solver.solve(x_guess) //Solve the equation
console.log(s.report); //Print solver report
solver.remove() //required to free the memory in C++
})
solver.addFunction(fn1) //Add the first equation to the solver.
solver.addFunction(fn2) //Add the second equation to the solver.
solver.addCallback(c1) //Add the callback to the solver.
//solver.addLowerbound(0,1.6) //Add a lower bound to the x[0] variable
//solver.addUpperbound(1,1.7) //Add a upper bound to the x[1] variable
var x_guess = [1,2] //Guess the initial values of the solution.
let s = await solver.solve(x_guess) //Solve the equation
var x = s.x //assign the calculated solution array to the variable x
console.log(s.report); //Print solver report
solver.remove() //required to free the memory in C++
}
ceresLoading()
</script>
Expand Down

0 comments on commit b3d86b5

Please sign in to comment.