31 const std::vector<std::size_t> &state_sizes);
42 const std::vector<std::size_t> &state_sizes,
double *preallocated_ptr);
45 [[nodiscard]]
const std::vector<NodeId> &
scope()
const {
return scope_; }
Fixed-capacity scratch buffer of doubles with pointer-bump allocation.
Dense row-major array of doubles with a fixed shape.
A potential over an ordered scope of variables.
Factor multiply(const Factor &other, class BumpAllocator *allocator=nullptr) const
Product of two factors.
Factor(const std::vector< NodeId > &scope, const std::vector< std::size_t > &state_sizes)
Creates a factor that owns zero-initialized storage.
void bind_data(double *ptr)
Redirects the value table to a caller buffer. See DenseTensor::bind_data().
std::vector< NodeId > scope_
const std::vector< NodeId > & scope() const
Variables of the factor, in tensor dimension order.
Factor marginalize(const std::vector< NodeId > &marg_vars, class BumpAllocator *allocator=nullptr) const
Sums variables out of the factor.
DenseTensor & tensor()
The value table.
const DenseTensor & tensor() const
The value table, read only.
bncore::DenseTensor, a row-major multi-dimensional array of doubles that either owns its storage or b...
Basic BNCore types: the NodeId variable handle and the VariableMetadata record that Graph stores for ...