50#ifndef DOXYGEN_SHOULD_SKIP_THIS
59 const Bijection< NodeId, std::size_t >& nodeId2columns) :
60 Prior(database, nodeId2columns) {
61 GUM_CONSTRUCTOR(SmoothingPrior);
65 INLINE SmoothingPrior::SmoothingPrior(
const SmoothingPrior& from) : Prior(from) {
66 GUM_CONS_CPY(SmoothingPrior);
70 INLINE SmoothingPrior::SmoothingPrior(SmoothingPrior&& from) noexcept : Prior(std::move(from)) {
71 GUM_CONS_MOV(SmoothingPrior);
75 INLINE SmoothingPrior* SmoothingPrior::clone()
const {
return new SmoothingPrior(*
this); }
78 INLINE SmoothingPrior::~SmoothingPrior() { GUM_DESTRUCTOR(SmoothingPrior); }
81 INLINE SmoothingPrior& SmoothingPrior::operator=(
const SmoothingPrior& from) =
default;
84 INLINE SmoothingPrior& SmoothingPrior::operator=(SmoothingPrior&& from) {
85 Prior::operator=(std::move(from));
90 INLINE
PriorType SmoothingPrior::getType()
const {
return PriorType::SmoothingPriorType; }
93 INLINE
bool SmoothingPrior::isInformative()
const {
return this->weight_ != 0.0; }
96 INLINE
void SmoothingPrior::addJointPseudoCount(
const IdCondSet& idset,
97 std::vector< double >& counts) {
99 if (idset.empty() || (this->weight_ == 0.0))
return;
102 for (
auto& count: counts)
103 count += this->weight_;
The class representing a tabular database as used by learning tasks.
the base class for all a priori
SmoothingPrior(const DatabaseTable &database, const Bijection< NodeId, std::size_t > &nodeId2columns=Bijection< NodeId, std::size_t >())
default constructor
include the inlined functions if necessary
gum is the global namespace for all aGrUM entities
the smooth a priori: adds a weight w to all the counts