Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members

plCndKernel Class Reference

The {plCndKernel} class is the base class of all conditional probability (and density) distributions like {P(A | B) }. More...

#include <plCndKernel.h>

Inheritance diagram for plCndKernel:

Inheritance graph
[legend]
Collaboration diagram for plCndKernel:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 plCndKernel ()
 Constructs an empty conditional kernel.
 plCndKernel (const plCndKernel &cnd_kernel)
 Constructs a conditional kernel from another conditional kernel.
 plCndKernel (const class plProduct &)
 Constructs a conditionalKernel from a plProduct.
 plCndKernel (const plComputableObjectList &fun_list)
 Constructs a conditionalKernel from a plComputableObjectList.
virtual ~plCndKernel ()
 Destroys the conditional kernel.
virtual kplComputableObject * get_root_kernel () const
 Returns the pointer to itself if the kernel is not a {built in kernel (function)}.
void instantiate (plKernel &kernel_to_instantiate, const plValues &values) const
 Produces a new kernel by instantiating the known variables given by a the plValues {values}.
void partial_instantiate (plCndKernel &kernel_to_instantiate, const plVariablesConjunction &variables_to_instantiate, const plValues &values) const
 Produces a new kernel by instantiating a subset of the known variables given by a the plValues {values}.
plCndKernel partial_instantiate (const plVariablesConjunction &variables_to_instantiate, const plValues &values) const
 Produces a new kernel by instantiating a subset of the known variables given by a the plValues {values}.
plKernel instantiate (const plValues &values) const
 Produces a new kernel by instantiating the known variables given by a the plValues {values}.
void instantiate (plKernel &kernel_to_instantiate, int *parameter) const
 Produces a new kernel by instantiating the known variables using the values given in an integer vector .
template<typename T>
plKernel instantiate (T parameter) const
 Produces a new kernel by instantiating the known variables given by a T (single, array, vector, plValues {values}).
template<typename T>
plKernel instantiate (const vector< T > &parameter) const
 Produces a new kernel by instantiating the known variables given by a const referrence on T (vector {values}).
void instantiate (plKernel &kernel_to_instantiate, unsigned int *parameter) const
 Produces a new kernel by instantiating the known variables using the values given in an unsigned integer C vector .
void instantiate (plKernel &kernel_to_instantiate, long int *parameter) const
 Produces a new kernel by instantiating the known variables using the values given in a long integer C vector.
void instantiate (plKernel &kernel_to_instantiate, float *parameter) const
 Produces a new kernel by instantiating the known variables given by a float C vector.
void instantiate (plKernel &kernel_to_instantiate, double *parameter) const
 Produces a new kernel by instantiating the known variables using the values given in a double C vector.
void instantiate (plKernel &kernel_to_instantiate, long double *parameter) const
 Produce a new kernel by instantiating the known variables using the values given in a long double C vector.
void instantiate (plKernel &kernel_to_instantiate, int parameter) const
 Produce a new kernel by instantiating the known variable using the value of a single integer.
void instantiate (plKernel &kernel_to_instantiate, unsigned int parameter) const
 Produces a new kernel by instantiating the known variable using the value of a single unsigned integer.
void instantiate (plKernel &kernel_to_instantiate, long int parameter) const
 Produces a new kernel by instantiating the known variable using the value of a single long integer.
void instantiate (plKernel &kernel_to_instantiate, float parameter) const
 Produces a new kernel by instantiating the known variable using the value of a single float.
void instantiate (plKernel &kernel_to_instantiate, double parameter) const
 Produces a new kernel by instantiating the known variable using the value of a single double.
void instantiate (plKernel &kernel_to_instantiate, long double parameter) const
 Produces a new kernel by instantiating the known variable using the value of a single long double.
void instantiate (plKernel &kernel_to_instantiate, const vector< int > &parameter) const
 Produces a new kernel by instantiating the known variables using the values given in an STL integer vector.
void instantiate (plKernel &kernel_to_instantiate, const vector< unsigned int > &parameter) const
 Produces a new kernel by instantiating the known variables using the values given in an STL unsigned integer vector.
void instantiate (plKernel &kernel_to_instantiate, const vector< long int > &parameter) const
 Produces a new kernel by instantiating the known variables using the values given in an STL long integer vector.
void instantiate (plKernel &kernel_to_instantiate, const vector< float > &parameter) const
 Produces a new kernel by instantiating the known variables using the values given in an STL float vector.
void instantiate (plKernel &kernel_to_instantiate, const vector< double > &parameter) const
 Produce a new kernel by instantiating the known variables using the values given in an STL double vector.
void instantiate (plKernel &kernel_to_instantiate, const vector< long double > &parameter) const
 Produce a new kernel by instantiating the known variables using the values given in an STL long double vector.
ostream & write_head (ostream &out) const
 Writes the the conditional kernel head at the output stream {out}.
ostream & write_body (ostream &out) const
 Writes the conditional kernel body at the output stream {out}.
plCndKerneloperator= (const plCndKernel &assigned_Cnd_kernel)
 Assignement operator.
void replace (const plVariablesConjunction &left_vars, const plVariablesConjunction &right_vars, plCndKernel &new_cnd_kernel)
 Replace the conditional distribution P(left_vars | right_vars) by an other conditional distribution "new_cnd_kernel".
void replace (const plVariablesConjunction &left_vars, plKernel &new_kernel)
 Replace the distribution P(left_vars ) by an other distribution "new_kernel".
void compile (plCndKernel &result) const
 Compiles the conditional kernel P(left_vars | right_vars) by constructing a KernelTable of ProbTable.
void lowMemoryUse_compile (plCndKernel &result) const
 Compiles the conditional kernel P(left_vars | right_vars) by constructing a KernelTable of ProbTable.
plCndKernel compile () const
 Compiles the conditional kernel P(left_vars | right_vars) by constructing a KernelTable of ProbTable.
void compile (plCndKernel &result, plCompiledDistributionType compiled_distrib_type) const
 Compiles the conditional kernel P(left_vars | right_vars) by constructing a KernelTable.
plCndKernel compile (plCompiledDistributionType compiled_distrib_type) const
 Compiles the conditional kernel P(left_vars | right_vars) by constructing a KernelTable.
void n_compile (plCndKernel &result, unsigned long n_iterations, plGeneratorType generator_type=PL_MC_GENERATOR, plCompiledDistributionType compiled_distrib_type=PL_MAP) const
 Compiles the conditional kernel P(left_vars | right_vars) by constructing a KernelTable.
void time_compile (plCndKernel &result, double time_in_seconds, plGeneratorType generator_type=PL_MC_GENERATOR, plCompiledDistributionType compiled_distrib_type=PL_MAP) const
 Compiles the conditional kernel P(left_vars | right_vars) by constructing a KernelTable.
plCndKernel time_compile (double time_in_seconds, plGeneratorType generator_type=PL_MC_GENERATOR, plCompiledDistributionType distrib_type=PL_MAP) const
 Does a time_compile(), and returns the compiled kernel.

Protected Member Functions

virtual plProbValue kernel_compute (const plDataValues &params) const
 Computes the value of the function, according to a list of parameters at kernel level.
virtual void kernel_rename (const map< kplVariable *, kplVariable * > &rename_map)
 Renames the variables of a function at kernel level.

Detailed Description

The {plCndKernel} class is the base class of all conditional probability (and density) distributions like {P(A | B) }.

Definition at line 44 of file plCndKernel.h.


Member Function Documentation

plCndKernel plCndKernel::compile plCompiledDistributionType  compiled_distrib_type  )  const
 

Compiles the conditional kernel P(left_vars | right_vars) by constructing a KernelTable.

The index variables of the KernelTable are the discrete or discretized variables {right }. For each value of{right }, a compiled distribution of type {compiled_distrib_type} is constructed by exhaustively compiling the corresponding kernel (i.e. by visiting all points of the discrete or discretized {left } space.) Note that this method returns a freshly created object. If you are calling it in a loop, consider using the version that modifies an existing object instead.

void plCndKernel::compile plCndKernel result,
plCompiledDistributionType  compiled_distrib_type
const
 

Compiles the conditional kernel P(left_vars | right_vars) by constructing a KernelTable.

The index variables of the KernelTable are the discrete or discretized variables {right }. For each value of{right }, a compiled distribution of type {compiled_distrib_type} is constructed by exhaustively compiling the corresponding kernel (i.e. by visiting all points of the discrete or discretized {left } space.)

plCndKernel plCndKernel::compile  )  const
 

Compiles the conditional kernel P(left_vars | right_vars) by constructing a KernelTable of ProbTable.

The index variables of the KernelTable are the discrete or discretized variables {right }. For each value of{right }, a ProbTable is constructed by exhaustively compiling the corresponding kernel (i.e. by visiting all points of the discrete or discretized {left } space. Note that this method returns a freshly created object. If you are calling it in a loop, consider using the version that modifies an existing object instead.

void plCndKernel::compile plCndKernel result  )  const
 

Compiles the conditional kernel P(left_vars | right_vars) by constructing a KernelTable of ProbTable.

The index variables of the KernelTable are the discrete or discretized variables {right }. For each value of{right }, a ProbTable is constructed by exhaustively compiling the corresponding kernel (i.e. by visiting all points of the discrete or discretized {left } space.

virtual kplComputableObject* plCndKernel::get_root_kernel  )  const [virtual]
 

Returns the pointer to itself if the kernel is not a {built in kernel (function)}.

Otherwise, it returns a pointer to the kernel at kernel level

Implements plComputableObject.

template<typename T>
plKernel plCndKernel::instantiate const vector< T > &  parameter  )  const [inline]
 

Produces a new kernel by instantiating the known variables given by a const referrence on T (vector {values}).

Note that this method returns a freshly created object. If you are calling it in a loop, consider using the version that modifies an existing object instead. This is the fonctionnal version of the method above. It permits the following syntax : pL_R.instantiate( special_Right_values ).compute( special_Left_values ) which is the PL programming form of P([L = special_Left_values]|[R = special_Right_values])

Definition at line 151 of file plCndKernel.h.

References instantiate().

template<typename T>
plKernel plCndKernel::instantiate parameter  )  const [inline]
 

Produces a new kernel by instantiating the known variables given by a T (single, array, vector, plValues {values}).

Note that this method returns a freshly created object. If you are calling it in a loop, consider using the version that modifies an existing object instead. This is the fonctionnal version of the method above. It permits the following syntax : pL_R.instantiate( special_Right_values ).compute( special_Left_values ) which is the PL programming form of P([L = special_Left_values]|[R = special_Right_values])

Definition at line 133 of file plCndKernel.h.

References instantiate().

plKernel plCndKernel::instantiate const plValues values  )  const
 

Produces a new kernel by instantiating the known variables given by a the plValues {values}.

Note that this method returns a freshly created object. If you are calling it in a loop, consider using the version that modifies an existing object instead.

void plCndKernel::lowMemoryUse_compile plCndKernel result  )  const
 

Compiles the conditional kernel P(left_vars | right_vars) by constructing a KernelTable of ProbTable.

The index variables of the KernelTable are the discrete or discretized variables {right }. For each value of{right }, a ProbTable is constructed by exhaustively compiling the corresponding kernel (i.e. by visiting all points of the discrete or discretized {left } space.

void plCndKernel::n_compile plCndKernel result,
unsigned long  n_iterations,
plGeneratorType  generator_type = PL_MC_GENERATOR,
plCompiledDistributionType  compiled_distrib_type = PL_MAP
const
 

Compiles the conditional kernel P(left_vars | right_vars) by constructing a KernelTable.

The index variables of the KernelTable are the discrete or discretized variables {right }. For each value of{right }, the corresponding kernel is compiled by sampling the kernel using a set of points in the variables space. The used points may be generated using 4 possible methods (according to the value of generator_type):
1) Using all points of the discrete or discretized variables space (PL_EXHAUSTIVE_GENERATOR)
2) Using {n_iterations} as a number of points generated at random from the variables space (PL_RANDOM_GENERATOR)
3) Using {n_iterations} as a number of points generated using a Monte Carlo generator from the variables space (PL_MC_GENERATOR). It's the default value.
4) Using {n_iterations} as a number of points generated using a Genetic Algorithm generator from the variables space (PL_GA_GENERATOR).

Each resulting CompiledKernel is stored as (according to the value of compiled_distrib_type):
1) a table (PL_TABLE)
2) an MRBT (PL_MRBT) 3) a map (PL_MAP) for non-null values. It's the default value.

plCndKernel plCndKernel::partial_instantiate const plVariablesConjunction variables_to_instantiate,
const plValues values
const
 

Produces a new kernel by instantiating a subset of the known variables given by a the plValues {values}.

ie P(A | B C).partial_instantiate(C, c) yields P(A | B c) Note that this method returns a freshly created object. If you are calling it in a loop, consider using the version that modifies an existing object instead.

void plCndKernel::replace const plVariablesConjunction left_vars,
plKernel new_kernel
[virtual]
 

Replace the distribution P(left_vars ) by an other distribution "new_kernel".

new_kernel must have the same left variables.

Implements plComputableObject.

void plCndKernel::replace const plVariablesConjunction left_vars,
const plVariablesConjunction right_vars,
plCndKernel new_cnd_kernel
[virtual]
 

Replace the conditional distribution P(left_vars | right_vars) by an other conditional distribution "new_cnd_kernel".

new_cnd_kernel must have the same left and right variables.

Implements plComputableObject.

plCndKernel plCndKernel::time_compile double  time_in_seconds,
plGeneratorType  generator_type = PL_MC_GENERATOR,
plCompiledDistributionType  distrib_type = PL_MAP
const
 

Does a time_compile(), and returns the compiled kernel.

See time_compile() above for details.

Note that this method returns a freshly created object. If you are calling it in a loop, consider using the version that modifies an existing object instead.

void plCndKernel::time_compile plCndKernel result,
double  time_in_seconds,
plGeneratorType  generator_type = PL_MC_GENERATOR,
plCompiledDistributionType  compiled_distrib_type = PL_MAP
const
 

Compiles the conditional kernel P(left_vars | right_vars) by constructing a KernelTable.

The index variables of the KernelTable are the discrete or discretized variables {right }. For each value of{right }, the corresponding kernel is compiled by sampling the kernel using a set of points in the variables space. The used points may be generated using 4 possible methods (according to the value of generator_type):
1) Using all points of the discrete or discretized variables space (PL_EXHAUSTIVE_GENERATOR)
2) Generating, for {time_in_seconds/cardinality(right_vars) } seconds, a set of points at random from the variables space (PL_RANDOM_GENERATOR)
3) Generating, for {time_in_seconds} seconds, a set of points using a Monte Carlo generator from the variables space (PL_MC_GENERATOR). It's the default value.
4) Generating, for {time_in_seconds} seconds, a set of points using a Genetic Algorithm generator from the variables space (PL_MC_GENERATOR) (PL_GA_GENERATOR).

Each resulting CompiledKernel is stored as (according to the value of compiled_distrib_type):
1) a table (PL_TABLE)
2) an MRBT (PL_MRBT).
3) a map (PL_MAP) for non-null values. It's the default value.


The documentation for this class was generated from the following file:
Generated on Fri Apr 1 10:58:30 2005 for ProBT by  doxygen 1.4.1