2013-02-07 17:50:02 +00:00
|
|
|
#ifndef YAP_PACKAGES_CLPBN_HORUS_FACTOR_H_
|
|
|
|
#define YAP_PACKAGES_CLPBN_HORUS_FACTOR_H_
|
2012-05-23 14:56:01 +01:00
|
|
|
|
2013-02-07 20:09:10 +00:00
|
|
|
#include <cassert>
|
|
|
|
|
2012-05-23 14:56:01 +01:00
|
|
|
#include <vector>
|
2013-02-07 20:09:10 +00:00
|
|
|
#include <string>
|
2012-05-23 14:56:01 +01:00
|
|
|
|
2013-03-04 15:47:47 +00:00
|
|
|
#include "GenericFactor.h"
|
2012-05-23 14:56:01 +01:00
|
|
|
#include "Util.h"
|
|
|
|
|
2013-02-07 23:53:13 +00:00
|
|
|
|
2013-02-08 21:12:46 +00:00
|
|
|
namespace Horus {
|
2013-02-07 23:53:13 +00:00
|
|
|
|
2013-03-04 15:47:47 +00:00
|
|
|
class Factor : public GenericFactor<VarId> {
|
2012-05-23 14:56:01 +01:00
|
|
|
public:
|
2013-02-28 19:45:37 +00:00
|
|
|
Factor() { }
|
2012-05-23 14:56:01 +01:00
|
|
|
|
|
|
|
Factor (const Factor&);
|
|
|
|
|
|
|
|
Factor (const VarIds&, const Ranges&, const Params&,
|
2013-02-08 21:01:53 +00:00
|
|
|
unsigned = Util::maxUnsigned());
|
2012-05-23 14:56:01 +01:00
|
|
|
|
|
|
|
Factor (const Vars&, const Params&,
|
2013-02-08 21:01:53 +00:00
|
|
|
unsigned = Util::maxUnsigned());
|
2012-05-23 14:56:01 +01:00
|
|
|
|
|
|
|
void sumOut (VarId);
|
|
|
|
|
|
|
|
void sumOutAllExcept (VarId);
|
|
|
|
|
|
|
|
void sumOutAllExcept (const VarIds&);
|
|
|
|
|
2012-05-24 22:55:20 +01:00
|
|
|
void sumOutAllExceptIndex (size_t idx);
|
2012-05-23 14:56:01 +01:00
|
|
|
|
|
|
|
void multiply (Factor&);
|
|
|
|
|
2013-02-28 19:45:37 +00:00
|
|
|
std::string getLabel() const;
|
2012-05-23 14:56:01 +01:00
|
|
|
|
2013-02-28 19:45:37 +00:00
|
|
|
void print() const;
|
2012-05-23 14:56:01 +01:00
|
|
|
|
|
|
|
private:
|
2013-02-28 19:45:37 +00:00
|
|
|
void sumOutFirstVariable();
|
2012-05-25 20:15:05 +01:00
|
|
|
|
2013-02-28 19:45:37 +00:00
|
|
|
void sumOutLastVariable();
|
2012-05-25 20:15:05 +01:00
|
|
|
|
2013-02-07 13:37:15 +00:00
|
|
|
void sumOutArgs (const std::vector<bool>& mask);
|
2012-12-20 23:19:10 +00:00
|
|
|
|
2012-05-25 21:22:48 +01:00
|
|
|
void clone (const Factor& f);
|
2012-05-23 14:56:01 +01:00
|
|
|
|
2012-12-27 22:25:45 +00:00
|
|
|
DISALLOW_ASSIGN (Factor);
|
2012-05-23 14:56:01 +01:00
|
|
|
};
|
|
|
|
|
2013-02-08 21:12:46 +00:00
|
|
|
} // namespace Horus
|
2013-02-07 23:53:13 +00:00
|
|
|
|
2013-02-08 00:20:01 +00:00
|
|
|
#endif // YAP_PACKAGES_CLPBN_HORUS_FACTOR_H_
|
2012-05-23 14:56:01 +01:00
|
|
|
|