Skip to content

Commit

Permalink
add readme
Browse files Browse the repository at this point in the history
  • Loading branch information
powei-lin committed Jul 23, 2023
1 parent 1adf00b commit 4430c5a
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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<NUM_PARAMETERS, NUM_RESIDUALS>`.
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<num_dual::DualSVec64<3>, 3>,
) -> nalgebra::SVector<num_dual::DualSVec64<3>, 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]);
}
}
```

0 comments on commit 4430c5a

Please sign in to comment.