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

51 lines
915 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 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
Factor& multiply (const Factor&);
2012-05-23 14:56:01 +01:00
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-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