#fixed #point #optimization #points

fixedpoint

A simple library to compute fixed points of a function

3 releases

Uses old Rust 2015

0.1.2 Jul 20, 2017
0.1.1 Feb 25, 2017
0.1.0 Feb 9, 2017

#81 in #fixed

Download history 19/week @ 2024-02-19 6/week @ 2024-02-26 5/week @ 2024-03-11 60/week @ 2024-04-01

60 downloads per month

MIT license

6KB
64 lines

FixedPoint

A simple library for computing the fixed point of a given function

Build Status Crates.io Crates.io Docs.rs

Look at the documentation for an example

Installation

[dependencies]
fixedpoint = "0.1"

Warning

I am still building this library and hence the API is unstable. Please be careful when using this library in your projects.

License

MIT

Contact

In case of any queries, please create a new issue on the Issue Tracker on GitHub.


lib.rs:

FixedPoint

A simple library for computing the fixed point of a given function

Example

extern crate fixedpoint;

use fixedpoint::fixedpoint;

fn func_with_fixed_point(num: u32, param: &u32) -> u32 {
    150 + (((num as f32 / param.clone() as f32).ceil() as u32)*100)
}

fn main() {
     let val = fixedpoint(&func_with_fixed_point, 0, &150, None, None).unwrap();
     println!("Fixed Point of function exists at: {}", val);
}

Dependencies

~2.7–4MB
~76K SLoC