How to use boost bisection?

后端 未结 2 1158
别跟我提以往
别跟我提以往 2020-12-15 12:56

Yesterday I had problems with another boost functions but luckily you guys helped me to solve them. Today I would need to know how to use bisection function properly.

<
2条回答
  •  一个人的身影
    2020-12-15 13:40

    Note that bisect also supports lambdas:

    using boost::math::tools::bisect;
    auto root = bisect
    (
        [](double x){return x;},
        -1.0, 1.0,
        [](double l, double r){return abs(l-r) < 1e-8;}
    );
    

提交回复
热议问题