diff --git a/README.md b/README.md index 8a069cf..7c0c861 100644 --- a/README.md +++ b/README.md @@ -1 +1,20 @@ # tiny-solver-rs +Inspired by ceres-solver and tiny-solver. This is a re-implemented version of [tiny-solver](https://github.com/keir/tinysolver/tree/master) in rust. + +### Usage +You need to implement the cost function of `TinySolver`. +Just like ceres-solver. + +See full example in `examples/example_solve.rs`. +```rust +impl TinySolver<3, 2> for ExampleStatic { + fn cost_function( + params: nalgebra::SVector, 3>, + ) -> nalgebra::SVector, 2> { + let x = params[0]; + let y = params[1]; + let z = params[2]; + return nalgebra::SVector::from([x + y.mul(2.0) + z.mul(4.0), y * z]); + } +} +```