message: changed comparison of floats and added radius function
diff: @@ -88,7 +88,7 @@ where
  subproblem.set_max_iters(2);
  TrustRegion {
  radius: 1.0,
  - max_radius: 10.0,
  + max_radius: 100.0,
  eta: 0.125,
  subproblem: subproblem,
  fxk: std::f64::NAN,
  @@ -97,6 +97,12 @@ where
  }
  }
  + /// set radius
  + pub fn set_radius(&mut self, radius: f64) -> &mut Self {
  + self.radius = radius;
  + self
  + }
  +
  /// Set maximum radius
  pub fn set_max_radius(&mut self, max_radius: f64) -> &mut Self {
  self.max_radius = max_radius;
  @@ -167,7 +173,8 @@ where
  self.radius = if rho < 0.25 {
  0.25 * pk_norm
  } else {
  - if rho > 0.75 && pk_norm == self.radius {
  + // if rho > 0.75 && pk_norm == self.radius {
  + if rho > 0.75 && (pk_norm - self.radius).abs() <= 10.0 * std::f64::EPSILON {
  self.max_radius.min(2.0 * self.radius)
  } else {
  self.radius
  