shark::OnePointCrossover Struct Reference

Implements one-point crossover. More...

#include <shark/Algorithms/DirectSearch/Operators/Recombination/OnePointCrossover.h>

Public Member Functions

template<class randomType , typename PointType >
PointType operator() (randomType &rng, const PointType &mom, const PointType &dad)
 Performs the one-point crossover. More...
 

Detailed Description

Implements one-point crossover.

Given two input points of same size n, draws a random number between 0 and n-1. all variables smaller than this index have the value of the left, all elements to the right have the value of the right parent.

Definition at line 43 of file OnePointCrossover.h.

Member Function Documentation

◆ operator()()

template<class randomType , typename PointType >
PointType shark::OnePointCrossover::operator() ( randomType &  rng,
const PointType &  mom,
const PointType &  dad 
)
inline

Performs the one-point crossover.

Definition at line 46 of file OnePointCrossover.h.

References shark::random::discrete(), and SIZE_CHECK.


The documentation for this struct was generated from the following file: