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 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
|
|
|
|
2013-03-21 21:49:12 +00:00
|
|
|
Factor& multiply (const Factor&);
|
2012-05-23 14:56:01 +01:00
|
|
|
|
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-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
|
|
|
|