This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
yap-6.3/packages/CLPBN/horus/Factor.h

57 lines
1001 B
C
Raw Normal View History

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
#include "GenericFactor.h"
2012-05-23 14:56:01 +01:00
#include "Util.h"
2013-02-07 23:53:13 +00:00
namespace Horus {
2013-02-07 23:53:13 +00:00
class Factor : public GenericFactor<VarId> {
2012-05-23 14:56:01 +01:00
public:
Factor() { }
2012-05-23 14:56:01 +01:00
Factor (const Factor&);
Factor (const VarIds&, const Ranges&, const Params&,
unsigned = Util::maxUnsigned());
2012-05-23 14:56:01 +01:00
Factor (const Vars&, const Params&,
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&);
std::string getLabel() const;
2012-05-23 14:56:01 +01:00
void print() const;
2012-05-23 14:56:01 +01:00
private:
void sumOutFirstVariable();
2012-05-25 20:15:05 +01: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
};
} // 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