AIToolbox
A library that offers tools for AI problem solving.
|
This class represents a factored 2D matrix. More...
#include <AIToolbox/Factored/Utils/FactoredMatrix.hpp>
Public Member Functions | |
double | getValue (const Factors &space, const Factors &actions, const Factors &value, const Factors &action) const |
This function returns the value of the FactoredMatrix2D at the specified point. More... | |
double | getValue (const Factors &space, const Factors &actions, const Factors &value, const Factors &action, const Vector &weights) const |
This function returns the value of the FactoredMatrix2D multiplied by the input weights. More... | |
FactoredMatrix2D & | operator*= (const Vector &w) |
This function multiplies each basis function with a weight. More... | |
FactoredMatrix2D & | operator*= (const double v) |
This function multiplies all bases with a scalar. More... | |
Public Attributes | |
std::vector< BasisMatrix > | bases |
This class represents a factored 2D matrix.
Note that we can't use a multi_array since each FactoredMatrix2D may have a different number of BasisMatrices.
double AIToolbox::Factored::FactoredMatrix2D::getValue | ( | const Factors & | space, |
const Factors & | actions, | ||
const Factors & | value, | ||
const Factors & | action | ||
) | const |
This function returns the value of the FactoredMatrix2D at the specified point.
space | The factor space to use. |
actions | The action space to use. |
value | The factor to compute the value for. |
action | The action to compute the value for. |
double AIToolbox::Factored::FactoredMatrix2D::getValue | ( | const Factors & | space, |
const Factors & | actions, | ||
const Factors & | value, | ||
const Factors & | action, | ||
const Vector & | weights | ||
) | const |
This function returns the value of the FactoredMatrix2D multiplied by the input weights.
Note that if the weights contain an additional element, it will be added to the value as a constant basis.
space | The factor space to use. |
actions | The action space to use. |
value | The factor to compute the value for. |
action | The action to compute the value for. |
weights | The weights to multiply the bases with, with an optional constant basis. |
FactoredMatrix2D& AIToolbox::Factored::FactoredMatrix2D::operator*= | ( | const double | v | ) |
This function multiplies all bases with a scalar.
v | The scalar to multiply with. |
FactoredMatrix2D& AIToolbox::Factored::FactoredMatrix2D::operator*= | ( | const Vector & | w | ) |
This function multiplies each basis function with a weight.
The input Vector must have the same number of elements as the number of bases in this FactoredVector, or one optional more.
Each basis is multiplied by its respective scalar. If an additional weight is present in the input, it is divided by the number of bases and added to each of them. Note that if the FactoredMatrix2D contains duplicate tags this is probably not what you want!!
w | The weights to multiply with. |
std::vector<BasisMatrix> AIToolbox::Factored::FactoredMatrix2D::bases |