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
Tiago Gomes a2e54a235a Factor: improve factor multiplication
Pass the argument as reference-to-const and also allow chaining of multiplications.
2013-03-21 21:49:12 +00:00

51 lines
915 B
C++

#ifndef YAP_PACKAGES_CLPBN_HORUS_FACTOR_H_
#define YAP_PACKAGES_CLPBN_HORUS_FACTOR_H_
#include <cassert>
#include <vector>
#include <string>
#include "GenericFactor.h"
#include "Util.h"
namespace Horus {
class Factor : public GenericFactor<VarId> {
public:
Factor() { }
Factor (const VarIds&, const Ranges&, const Params&,
unsigned = Util::maxUnsigned());
Factor (const Vars&, const Params&,
unsigned = Util::maxUnsigned());
void sumOut (VarId);
void sumOutAllExcept (VarId);
void sumOutAllExcept (const VarIds&);
void sumOutAllExceptIndex (size_t idx);
Factor& multiply (const Factor&);
std::string getLabel() const;
void print() const;
private:
void sumOutFirstVariable();
void sumOutLastVariable();
void sumOutArgs (const std::vector<bool>& mask);
};
} // namespace Horus
#endif // YAP_PACKAGES_CLPBN_HORUS_FACTOR_H_