LibCudaOptimize  1.0
FitnessSet Class Reference

Class representing a set of fitnesses. More...

#include <FitnessSet.h>

List of all members.

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

Detailed Description

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.


Constructor & Destructor Documentation

FitnessSet::FitnessSet ( unsigned int  sn,
unsigned int  pn 
)

Create a Fitness Set.

Parameters:
snnumber of sets
pnnumber of solutions for each set

Member Function Documentation

float* FitnessSet::get ( unsigned int  sid = ALL_SETS,
unsigned int  pid = ALL_SOLUTIONS 
)

retrieve fitness values

Parameters:
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
Returns:
device pointer to the fitnesses

Referenced by SolutionSet::getDeviceFitnesses(), and SolutionSet::getDeviceFitnessesConst().

Here is the caller graph for this function:

const float* FitnessSet::get ( unsigned int  sid = ALL_SETS,
unsigned int  pid = ALL_SOLUTIONS 
) const

retrieve a constant copy of the fitness values

Parameters:
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
Returns:
device pointer to the fitnesses
void FitnessSet::init ( unsigned int  sn,
unsigned int  pn,
std::string  logger = "" 
)

initialize (also re-initialize) the FitnessSet

Parameters:
snnumber of sets that the FitnessSet will contain
pnnumber of solutions for each set
loggerfile 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

Parameters:
ptrthe pointer that contains the values to be copied inside the FitnessSet
loca 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

Parameters:
ptra device pointer that contains the values to be replaced inside the FitnessSet

Definition at line 79 of file FitnessSet.h.

Referenced by SolutionSet::setDeviceFitnessesPtr().

Here is the caller graph for this function:


The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Enumerations Enumerator Defines