LibCudaOptimize
1.0
|
Class representing a set of fitnesses. More...
#include <FitnessSet.h>
Public Member Functions | |
FitnessSet (unsigned int sn, unsigned int pn) | |
Create a Fitness Set. | |
void | set (float *ptr, POINTER_LOCATION loc=HOST_POINTER, unsigned int sid=ALL_SETS, unsigned int pid=ALL_SOLUTIONS) |
updates fitness values | |
void | setPtr (float *ptr) |
replaces the fitness device pointer | |
float * | get (unsigned int sid=ALL_SETS, unsigned int pid=ALL_SOLUTIONS) |
retrieve fitness values | |
const float * | get (unsigned int sid=ALL_SETS, unsigned int pid=ALL_SOLUTIONS) const |
retrieve a constant copy of the fitness values | |
void | init (unsigned int sn, unsigned int pn, std::string logger="") |
initialize (also re-initialize) the FitnessSet | |
void | free () |
release memory of the FitnessSet |
Class representing a set of fitnesses.
An instance of this class represents a set (or more than one) of fitnesses. It is used inside a SolutionSet or inside a EvalFuncPtr
Definition at line 49 of file FitnessSet.h.
FitnessSet::FitnessSet | ( | unsigned int | sn, |
unsigned int | pn | ||
) |
Create a Fitness Set.
sn | number of sets |
pn | number of solutions for each set |
float* FitnessSet::get | ( | unsigned int | sid = ALL_SETS , |
unsigned int | pid = ALL_SOLUTIONS |
||
) |
retrieve fitness values
sid | (optional) index of the set, if not all sets must be updated |
pid | (optional) index of the solution, if not all solutions must be updated |
Referenced by SolutionSet::getDeviceFitnesses(), and SolutionSet::getDeviceFitnessesConst().
const float* FitnessSet::get | ( | unsigned int | sid = ALL_SETS , |
unsigned int | pid = ALL_SOLUTIONS |
||
) | const |
retrieve a constant copy of the fitness values
sid | (optional) index of the set, if not all sets must be updated |
pid | (optional) index of the solution, if not all solutions must be updated |
void FitnessSet::init | ( | unsigned int | sn, |
unsigned int | pn, | ||
std::string | logger = "" |
||
) |
initialize (also re-initialize) the FitnessSet
sn | number of sets that the FitnessSet will contain |
pn | number of solutions for each set |
logger | file where to log |
void FitnessSet::set | ( | float * | ptr, |
POINTER_LOCATION | loc = HOST_POINTER , |
||
unsigned int | sid = ALL_SETS , |
||
unsigned int | pid = ALL_SOLUTIONS |
||
) |
updates fitness values
ptr | the pointer that contains the values to be copied inside the FitnessSet |
loc | a POINTER_LOCATION that represents whether the pointer is host or device (default = HOST_POINTER) |
sid | (optional) index of the set, if not all sets must be updated |
pid | (optional) index of the solution, if not all solutions must be updated |
void FitnessSet::setPtr | ( | float * | ptr | ) | [inline] |
replaces the fitness device pointer
ptr | a device pointer that contains the values to be replaced inside the FitnessSet |
Definition at line 79 of file FitnessSet.h.
Referenced by SolutionSet::setDeviceFitnessesPtr().