Skip to main content

hypervolume_3d

Function hypervolume_3d 

Source
pub fn hypervolume_3d(
    front: &[[f64; 3]],
    reference: &[f64; 3],
) -> OptimizeResult<f64>
Expand description

Compute the exact 3-D hypervolume using a slice-and-sweep approach.

The algorithm iterates over distinct z-values, computes the 2-D hypervolume of the projected front at each slice, and integrates over z.

§Arguments

  • front — Slice of 3-element arrays [f1, f2, f3].
  • reference — 3-element reference point array [r1, r2, r3].

§Errors

Returns an error if any point in front has length != 3.

§Examples

use scirs2_optimize::multiobjective::hypervolume::hypervolume_3d;
let front = [[0.0, 0.0, 1.0], [0.0, 1.0, 0.0], [1.0, 0.0, 0.0]];
let hv = hypervolume_3d(&front, &[2.0, 2.0, 2.0]).expect("valid input");
assert!(hv > 0.0);