1 #include <shark/Algorithms/DirectSearch/Operators/Hypervolume/HypervolumeCalculatorMD.h> 9 std::vector<RealVector>
createRandomFront(std::size_t numPoints, std::size_t numObj,
double p){
10 std::vector<RealVector> points(numPoints);
11 for (std::size_t i = 0; i != numPoints; ++i) {
12 points[i].resize(numObj);
15 for(std::size_t j = 0; j != numObj; ++j){
17 sum += 1-points[i](j);
18 norm += std::pow(points[i](j),p);
20 norm = std::pow(norm,1/p);
26 int main(
int argc,
char **argv) {
30 for(std::size_t dim = 4; dim != 9; ++dim){
31 std::cout<<
"dimensions = " <<dim<<std::endl;
32 RealVector reference(dim,1.0);
33 for(
unsigned int numPoints = 10; numPoints != 110; numPoints +=10){
36 HypervolumeCalculatorMD algorithm1;
43 val1 = algorithm1(
set, reference);
50 val2 = algorithm2(
set, reference);
53 std::cout<<numPoints<<
"\t"<<stop1<<
"\t"<<stop2<<
"\t"<<val1-val2<<
"\t"<<std::endl;