aGrUM 3.3.2
a C++ library for (probabilistic) graphical models
gum Namespace Reference

gum is the global namespace for all aGrUM entities More...

Namespaces

namespace  __debug__
 Internal namespace for aGrUM debugging tools.
namespace  __sig__
 Internal namespace for aGrUM signaler/listener components.
namespace  _rand_namespace_
namespace  aggregator
 Aggregators are functional description of CPTs.
namespace  complexity
 Internal namespace for complexity tools (quite empty for now).
namespace  credal
 namespace for all credal networks entities
namespace  detail
namespace  dot
namespace  formula
namespace  graph
namespace  learning
 include the inlined functions if necessary
namespace  prm
 namespace for all probabilistic relational models entities
namespace  threadsOMP
namespace  threadsSTL

Classes

class  AbstractFMDPFactory
 A factory class to ease Factored Markov Decision Process construction. More...
class  AbstractLeaf
 <agrum/FMDP/learning/datastructure/leaves/abstractLeaf.h> More...
class  AbstractSimulator
 <agrum/FMDP/simulation/abstractSimulator.h> More...
class  ActionSet
 A class to store the optimal actions. More...
class  AdaptiveRMaxPlaner
 <agrum/FMDP/planning/adaptiveRMaxPlaner.h> More...
class  AggregatorDecomposition
 <agrum/BN/inference/tools/aggregatorDecomposition.h> More...
struct  AlmostDifferent
 Indicate whether two elements are (almost) different or not. More...
struct  AlmostDifferent< T * >
 Indicate whether two elements are (almost) different or not. More...
class  ApproximateInference
class  ApproximationPolicy
 Mother class for all approximation policy classes. More...
class  ApproximationScheme
 Approximation Scheme. More...
class  ApproximationSchemeListener
 The ApproximationSchemeListener class. More...
class  Arc
 The base class for all directed edges. More...
class  ArcGraphPart
 Classes for directed edge sets. More...
struct  ArgMaxSet
 Class to handle efficiently argMaxSet. More...
struct  ArgumentMaximises
 Arg Max function object class. More...
struct  ArgumentMaximisesAction
 <agrum/FMDP/planning/actionSet.h> More...
class  ASTBinaryOp
 Base class for binary algebraic operators (e.g., +, -, ×, ÷). More...
class  ASTdiv
 Elementwise division of two AST sub-expressions (left / right). More...
class  ASTjointProba
 Joint probability term ( \mathbb{P}(\mathrm{vars}) ) in an observational BN. More...
class  ASTminus
 Difference of two AST sub-expressions (left minus right). More...
class  ASTmult
 Elementwise product of two AST sub-expressions. More...
class  ASTplus
 Sum of two AST sub-expressions. More...
class  ASTposteriorProba
 Posterior probability term ( \mathbb{P}_{bn}(\mathrm{vars}\mid\mathrm{knw}) ). More...
class  ASTsum
 Summation (marginalization) over one or more variables. More...
class  ASTtree
 Root abstract node for the AST of algebraic expressions. More...
class  AVLTree
 AVL binary search tree. More...
class  AVLTreeIterator
 AVL binary search tree iterator. More...
class  AVLTreeIteratorSafe
 AVL binary search tree safe (w.r.t. More...
class  AVLTreeReverseIterator
 AVL binary search tree reverse iterator. More...
class  AVLTreeReverseIteratorSafe
 AVL binary search tree safe (w.r.t. More...
class  BarrenNodesFinder
 Detect barren nodes for inference in Bayesian networks. More...
class  BayesBall
 Implementation of Shachter's Bayes Balls algorithm. More...
class  BayesNet
 Class representing a Bayesian network. More...
class  BayesNetFactory
 A factory class to ease BayesNet construction. More...
class  BayesNetFragment
 Portion of a BN identified by the list of nodes and a BayesNet. More...
class  BayesNetInference
 <agrum/BN/inference/BayesNetInference.h> More...
class  BIFReader
 Definition of templatized reader of BIF files for Bayesian networks. More...
class  BIFWriter
 Writes a IBayesNet in the BIF format. More...
class  BIFXMLBNReader
 <agrum/BN/io/BIFXML/BIFXMLBNReader.h> More...
class  BIFXMLBNWriter
 <agrum/BN/io/BIFXML/BIFXMLBNWriter.h> More...
class  BIFXMLIDReader
 Read an influence diagram from an XML file with BIF format. More...
class  BIFXMLIDWriter
 Writes an influence diagram in a XML files with BIF format. More...
class  Bijection
 Set of pairs of elements with fast search for both elements. More...
class  BijectionImplementation
 A non scalar implementation of a Bijection. More...
class  BijectionIterator
 Unsafe iterators for bijection. More...
class  BijectionIteratorGet
 Dummy classes for discriminating scalars and non-scalars operators and -> wihtout any overhead. More...
struct  BijectionIteratorGet< true >
class  BijectionIteratorSafe
 Safe iterators for bijectionIterator. More...
class  BinaryJoinTreeConverter
class  BinaryJoinTreeConverterDefault
class  BinSearchTree
 A generic binary search tree. More...
class  BinSearchTreeIterator
 A Generic binary search tree. More...
class  BinTreeNode
 Nodes of a binary trees. More...
class  BNdistance
class  BNReader
 Pure virtual class for reading a BN from a file. More...
class  BNWriter
 virtual class for writing a BN to a file. More...
class  CausalFormula
 A container for an identified causal query. More...
class  CausalImpact
 Builds a CausalFormula for a query (d-sep -> backdoor -> frontdoor -> (optional) do-calculus). More...
class  CausalModel
 A causal model pairing a causal DAG with an optional observational BayesNet. More...
class  Chi2
 Static math utilities for the chi2 distribution. More...
class  Chi2TestPolicy
 <agrum/base/multidim/core/testPolicy/Chi2TestPolicy.h> More...
class  ChiSquare
 <agrum/FMDP/learning/core/testPolicy/chiSquare.h> More...
class  CliqueGraph
 Basic graph of cliques. More...
class  CNFWriter
 Writes a IBayesNet in the BN format. More...
class  CompleteProjectionRegister4MultiDim
 A container for registering complete projection functions on multiDimImplementations, i.e., functions projecting tables over all their variables. More...
struct  CompleteProjections4MultiDimInitialize
 a class used to register complete projections over non-pointers types More...
struct  CompleteProjections4MultiDimInitialize< GUM_ELEMENT * >
 a class used to register complete projections over pointers types More...
class  ComposedLeaf
 <agrum/FMDP/learning/datastructure/leaves/composedLeaf.h> More...
class  ConcreteLeaf
 <agrum/FMDP/learning/datastructure/leaves/concreteLeaf.h> More...
class  Configuration
 Sectioned key/value configuration with typed and documented keys. More...
class  ContextualDependenciesCNFWriter
 <agrum/BN/io/cnf/ContextualDependenciesCNFWriter.h> More...
class  ContingencyTable
 <agrum/FMDP/learning/core/contingencyTable.h> More...
class  ContinuousVariable
 Defines a continuous random variable. More...
class  Counterfactual
 Computes a counterfactual distribution by building a twin model, then evaluating a causal effect on that twin and adapting the result back to the original model’s variables. More...
class  DAG
 Base class for dag. More...
class  DAGCycleDetector
 A class for detecting directed cycles in DAGs when trying to apply many changes to the graph. More...
class  DAGmodel
 Virtual base class for PGMs using a DAG. More...
class  DecisionTensor
 <agrum/ID/inference/decisionTensor.h> More...
class  DefaultEliminationSequenceStrategy
 An efficient unconstrained elimination sequence algorithm. More...
class  DefaultJunctionTreeStrategy
 An algorithm producing a junction given the elimination tree produced by a triangulation algorithm. More...
class  DefaultPartialOrderedEliminationSequenceStrategy
 An Elimination sequence algorithm that imposes a given partial ordering on the nodes elimination sequence. More...
class  DefaultTriangulation
 The default triangulation algorithm used by aGrUM. More...
class  DiGraph
 Base class for all oriented graphs. More...
class  DiGraphListener
 Abstract Base class for all diGraph Listener. More...
class  Dirichlet
 A class for sampling w.r.t. More...
class  DiscreteGraphicalModel
 <agrum/base/graphicalModels/discreteGraphicalModel.h> More...
class  DiscreteVariable
 Base class for discrete random variable. More...
class  DiscretizedVariable
 Class for discretized random variable. More...
class  DoCalculus
 Instance-based do-calculus utilities bound to a single CausalModel. More...
class  DoorCriteria
 Implements Backdoor and Frontdoor criteria utilities for a DAG. More...
class  dSeparationAlgorithm
 the d-separation algorithm as described in Koller & Friedman (2009) More...
class  DSLReader
 Pure virtual class for reading a BN from a file. More...
class  DSLWriter
 Writes a IBayesNet in the DSL format. More...
class  dummyHash
class  E_GreedyDecider
 <agrum/FMDP/decision/E_GreedyDecider.h> More...
class  Edge
 The base class for all undirected edges. More...
class  EdgeGraphPart
 Classes for undirected edge sets. More...
class  EliminationSequenceStrategy
 The base class for all elimination sequence algorithms used by triangulation algorithms. More...
class  ErrorsContainer
 This class is used contain and manipulate gum::ParseError. More...
class  EssentialGraph
 Class building the essential graph from a BN. More...
class  Estimator
class  EvidenceInference
 <agrum/BN/inference/evidenceInference.h> More...
class  EvidenceMRFInference
 <agrum/MRF/inference/evidenceMRFInference.h> More...
class  ExactBNdistance
 ExactBNdistance computes exactly the KL divergence betweens 2 BNs. More...
class  ExactPolicy
 Class implementing exact approximation policy (meaning a value is approximate to itself). More...
class  ExactTerminalNodePolicy
 Implementation of a Terminal Node Policy that maps nodeid directly to value. More...
class  Exception
 Base class for all aGrUM's exceptions. More...
class  FactorisedValuesCNFWriter
 <agrum/BN/io/cnf/FactorisedValuesCNFWriter.h> More...
class  FactorySimulator
 A class to simulate the Factory problem. More...
class  FixedAllocator
 Allocates objects of one given size. More...
class  FMDP
 This class is used to implement factored decision process. More...
class  FMDPDatReader
 Definition of templatized reader of FMDPDat files for Factored Markov Decision Processes. More...
class  FMDPFactory
 A factory class to ease Factored Markov Decision Process construction. More...
class  FMDPLearner
class  FMDPReader
 Pure virtual class for reading a FMDP from a file. More...
class  FMDPSimulator
 <agrum/FMDP/simulation/fmdpSimulator.h> More...
class  Formula
 Evaluates a string as a algebraic formula. More...
class  FormulaPart
 Represents part of a formula. More...
class  FusionContext
 <agrum/FMDP/learning/datastructure/leaves/fusionContext.h> More...
class  GammaLog2
 The class for computing Log2 (Gamma(x)). More...
class  GeneralizedCNFWriter
 <agrum/BN/io/cnf/GeneralizedCNFWriter.h> More...
class  GibbsBNdistance
 GibbsKL computes the KL divergence betweens 2 BNs using an approximation pattern: GIBBS sampling. More...
class  GibbsOperator
 class containing all variables and methods required for Gibbssampling More...
class  GibbsSampling
 <agrum/BN/inference/gibbsSampling.h> More...
class  GraphicalModel
 Virtual base class for probabilistic graphical models. More...
class  GraphicalModelInference
 <agrum/base/graphicalModels/graphicalModel.h> More...
class  GTestPolicy
 <agrum/base/multidim/core/testPolicies/GTestPolicy.h> More...
class  GumBNReader
class  GumBNWriter
 Writes a IBayesNet in the GUM json format. More...
class  GumIDReader
 Reads an InfluenceDiagram from a GUM (json) file. More...
class  GumIDWriter
 Writes an InfluenceDiagram in the GUM json format. More...
class  GumMRFReader
 Reads a MarkovRandomField from a GUM (json) file. More...
class  GumMRFWriter
 Writes a MarkovRandomField in the GUM json format. More...
class  HashFunc
 This class should be useless as only its specializations should be used. More...
class  HashFunc< bool >
 Hash function for booleans. More...
class  HashFunc< credal::lp::LpCol >
class  HashFunc< Debug >
 Hash function for gum::Debug. More...
class  HashFunc< double >
 Hash function for doubles. More...
class  HashFunc< float >
 Hash function for floats. More...
class  HashFunc< Instantiation >
 Hash function for gum::Instantiation. More...
class  HashFunc< int >
 Hash function for integers. More...
class  HashFunc< learning::ArcAddition >
 the hash function for Arc Additions More...
class  HashFunc< learning::ArcDeletion >
 the hash function for Arc Deletions More...
class  HashFunc< learning::ArcReversal >
 the hash function for Arc Reversals More...
class  HashFunc< learning::ArcTriangleDeletion1 >
 the hash function for Arc Triangle Deletions creating a v-structure in node 1 More...
class  HashFunc< learning::ArcTriangleDeletion2 >
 the hash function for Arc Triangle Deletions creating a v-structure in node 2 More...
class  HashFunc< learning::EdgeAddition >
 the hash function for Edge Additions More...
class  HashFunc< learning::EdgeDeletion >
 the hash function for Edge Deletions More...
class  HashFunc< learning::GraphChange >
 the hash function for Graph Changes More...
class  HashFunc< learning::IdCondSet >
 the hash function for idSets More...
class  HashFunc< long >
 Hash function for long integers. More...
class  HashFunc< Set< T > >
 the hash function for sets of int More...
class  HashFunc< std::pair< Key1, Key2 > >
class  HashFunc< std::shared_ptr< Type > >
 Hash function for shared pointers. More...
class  HashFunc< std::string >
 Hash function for strings. More...
class  HashFunc< std::tuple< unsigned int, unsigned int, unsigned int > >
 the hash function for tuple (unsigned int, unsigned int,unsigned int) More...
class  HashFunc< std::vector< Idx > >
 Hash function for vectors of gum::Idx. More...
class  HashFunc< Type * >
 Hash function for pointers. More...
class  HashFunc< typename HashFuncConditionalType< std::size_t, unsigned long, unsigned int, long, int >::type >
 Hash function for std::size_t. More...
class  HashFunc< unsigned int >
 Hash function for unsigned integers. More...
class  HashFunc< unsigned long >
 Hash function for unsigned long integers. More...
class  HashFuncBase
 All hash functions should inherit from this class. More...
class  HashFuncCastKey
 Generic hash functions for keys castable as Size whose size is either smaller than Size, or equal to that of one or two Size. More...
class  HashFuncConditionalType
 This class enables to safely define hash functions for types that may or may not already has defined hash functions. More...
struct  HashFuncConditionalType< Key >
struct  HashFuncConditionalType< KEY_TYPE, FIRST_TYPE, OTHER_TYPES... >
struct  HashFuncConditionalType< KEY_TYPE, TYPE >
class  HashFuncConst
 Useful constants for hash functions. More...
class  HashFuncLargeCastKey
 Generic hash functions for keys castable as Size and whose size is precisely twice that of Size. More...
class  HashFuncMediumCastKey
 Generic hash functions for keys castable as Size and whose size is precisely that of Size. More...
class  HashFuncSmallCastKey
 Generic hash functions for keys castable as Size and whose size is strictly smaller than that of Size. More...
class  HashFuncSmallKey
 Generic hash functions for numeric keys smaller than or equal to Size. More...
class  HashTable
 The class for generic Hash Tables. More...
class  HashTableBucket
 A recipient for a pair of key value in a gum::HashTableList. More...
class  HashTableConst
 Parameters specifying the default behavior of the hashtables. More...
class  HashTableConstIteratorSafe
 Safe Const Iterators for hashtables. More...
class  HashTableList
 A chained list used by gum::HashTable. More...
class  Heap
 Heap data structure. More...
class  IApproximationSchemeConfiguration
 Approximation Scheme. More...
class  IBayesNet
 Class representing the minimal interface for Bayesian network with no numerical data. More...
class  IBayesNetFactory
 IBayesNetFactory is the non-template interface for BayesNetFactory : many ways to build a BN do not depend on the specification of the GUM_SCALAR template argument (for instance for BN readers). More...
class  IBayesNetGenerator
 Class for generating Bayesian networks. More...
class  IContinuousVariable
 A base class for continuous variables, independent of the GUM_SCALAR type. More...
class  IDecisionStrategy
 <agrum/FMDP/SDyna/IDecisionStrategy.h> More...
class  IDiscretizedVariable
 A base class for discretized variables, independent of the ticks type. More...
class  IDReader
 Pure virtual class for importing an ID from a file. More...
class  IDWriter
 Pure virtual class for exporting an ID. More...
class  ILearningStrategy
 <agrum/FMDP/SDyna/ILearningStrategy.h> More...
class  IMarkovRandomField
 Class representing the minimal interface for Markov random field. More...
class  IMDDI
class  ImportanceSampling
class  IncrementalGraphLearner
 <agrum/FMDP/learning/datastructure/incrementalGraphLearner> More...
class  IncrementalTriangulation
 Class that performs incremental triangulations. More...
class  IndexedTree
 The class for storing the nodes of the Arborescence. More...
class  InfluenceDiagram
 Class representing an Influence Diagram. More...
class  InfluenceDiagramGenerator
 <agrum/ID/generator/influenceDiagramGenerator.h> More...
class  InfluenceDiagramInference
 <agrum/ID/inference/influenceDiagramInference.h> More...
class  InformationTheory
 InformationTheory is a template class which aims at gathering the implementation of informational functions (entropy, mutual information, etc.). More...
class  Instantiation
 Class for assigning/browsing values to tuples of discrete variables. More...
struct  Int2Type
class  IntegerVariable
 class IntegerVariable More...
class  InternalNode
 Structure used to represent a node internal structure. More...
class  IOperatorStrategy
 <agrum/FMDP/SDyna/IOperatorStrategy.h> More...
class  IPlanningStrategy
 <agrum/FMDP/SDyna/IPlanningStrategy.h> More...
class  IScheduleMultiDim
 The Table-agnostic base class of scheduleMultiDim. More...
class  ITerminalNodePolicy
 Interface specifying the methods to be implemented by any TerminalNodePolicy. More...
class  ITestPolicy
 <agrum/base/multidim/core/testPolicies/ITestPolicy.h> More...
struct  IThreadNumberManager
class  ITI
 Learn a graphical representation of a function as a decision tree. More...
class  IVisitableGraphLearner
 <agrum/FMDP/SDyna/IVisitableGraphLearner.h> More...
class  JointTargetedInference
 <agrum/BN/inference/jointTargetedInference.h> More...
class  JointTargetedMRFInference
 <agrum/MRF/inference/jointTargetedMRFInference.h> More...
class  JunctionTreeStrategy
 Base Class for all the algorithms producing a junction given a set of cliques/subcliques resulting from a triangulation. More...
class  KTBN
 Class representing a k-order dynamic Bayesian network (k-DBN). More...
class  KTBNGenerator
 Draws a random k-DBN template (structure and, optionally, CPTs). More...
class  KTBNInference
 Exact inference on a gum::KTBN with observations and interventions, by the interface algorithm. More...
class  KTBNModality
 A parent's value in gum::KTBN::fillCPT(): a modality index or a modality label. More...
class  LabelizedVariable
 class LabelizedVariable More...
class  LazyDecider
 Class to make decision randomly. More...
class  LazyPropagation
 Implementation of a Shafer-Shenoy's-like version of lazy propagation for inference in Bayesian networks. More...
class  LeafAggregator
 <agrum/FMDP/learning/FunctionGraph/leafAggregator.h> More...
class  LeafPair
 <agrum/FMDP/learning/datastructure/leaves/leafPair.h> More...
struct  LearnerSelect
struct  LearnerSelect< ITILEARNER, A, B >
class  LeastSquareTestPolicy
 <agrum/base/multidim/core/testPolicy/leastSquareTestPolicy.h> More...
class  LinearApproximationPolicy
 Class implementing linear approximation policy (meaning possible value are split out in interval). More...
 Link of a chain list allocated using the SmallObjectAllocator. More...
class  LinkedList
 Chain list allocated using the SmallObjectAllocator. More...
class  List
 Generic doubly linked lists. More...
class  ListBucket
 Bucket for a chained list. More...
class  ListConstIterator
 Unsafe but fast const iterators for Lists. More...
class  ListConstIteratorSafe
 Safe const iterators for Lists. More...
class  Listener
 Every class who would catch signal from signaler should derive from Listener. More...
class  ListIterator
 Unsafe but fast iterators for Lists. More...
class  ListIteratorSafe
 Safe iterators for Lists. More...
class  LoopyBeliefPropagation
 <agrum/BN/inference/loopyBeliefPropagation.h> More...
class  LoopySamplingInference
 <agrum/BN/inference/loopySamplingInference.h> More...
class  MarginalTargetedInference
 <agrum/BN/inference/marginalTargetedInference.h> More...
class  MarginalTargetedMRFInference
 <agrum/MRF/inference/marginalTargetedMRFInference.h> More...
class  MarkovBlanket
 Class building the markov Blanket from a BN and a nodeName. More...
struct  Maximizes
 Maximization function object class. More...
class  MaxInducedWidthMCBayesNetGenerator
 maxInducedWidthMCBayesNetGenerator.h <agrum/BN/generator/SimpleMCayesNetGenerator.h> More...
class  MaxParentsMCBayesNetGenerator
 <agrum/BN/generator/SimpleMCayesNetGenerator.h> More...
class  MCBayesNetGenerator
 <agrum/BN/generator/MCayesNetGenerator.h> More...
class  MCBNDistance
 MCBNDistance computes the KL divergence betweens 2 BNs using an approximation pattern: independent (forward/topological) Monte Carlo sampling. More...
class  MDDOperatorStrategy
 <agrum/FMDP/planning/mddOperatorStrategy.h> More...
class  MeekRules
 Applies Meek's orientation rules to propagate arc directions in a mixed graph. More...
struct  Minimizes
 Minimization function object class. More...
class  MixedGraph
 Base class for mixed graphs. More...
class  MixedGraphListener
 Abstract Base class for all mixed Graph Listener. More...
class  MonteCarloSampling
class  MRFInference
 <agrum/MRF/inference/MRFInference.h> More...
class  MRFReader
 Pure virtual class for reading a MRF from a file. More...
class  MRFWriter
 Pure virtual class for writing a MRF to a file. More...
class  MultiDimAdressable
 Abstract base class for all multi dimensionnal addressable. More...
class  MultiDimArray
 Multidimensional matrix stored as an array in memory. More...
class  MultiDimBijArray
 Decorator of a MultiDimArray, using a bijection over the variables. More...
class  MultiDimBucket
 A multidim implementation for buckets. More...
class  MultiDimCombination
 A generic interface to combine efficiently several MultiDim tables. More...
class  MultiDimCombinationDefault
 A class to combine efficiently several MultiDim tables. More...
class  MultiDimCombineAndProject
 A generic interface to combine and project efficiently MultiDim tables. More...
class  MultiDimCombineAndProjectDefault
 An efficient class for combining and projecting MultiDim tables. More...
class  MultiDimCompleteProjection
 A generic class to project efficiently a MultiDim table over all of its variables. More...
class  MultiDimContainer
 Abstract base class for all multi dimensionnal containers. More...
class  MultiDimDecorator
 Decorator design pattern in order to separate implementations from multidimensional matrix concepts. More...
class  MultiDimFunctionGraph
 Class implementingting a function graph. More...
class  MultiDimFunctionGraphGenerator
 Class implementing a function graph generator with template type double. More...
class  MultiDimFunctionGraphManager
 Class implementingting a function graph manager. More...
class  MultiDimFunctionGraphOperator
 Class used to perform Function Graph Operations. More...
class  MultiDimFunctionGraphProjector
 Class used to perform Function Graph projections. More...
class  MultiDimFunctionGraphROManager
class  MultiDimFunctionGraphTreeManager
class  MultiDimICIModel
 abstract class for Conditional Indepency Models More...
class  MultiDimImplementation
 <agrum/base/multidim/multiDimImplementation.h> More...
class  MultiDimInterface
 Interface for all classes addressing in a multiDim fashion. More...
class  MultiDimLogit
 Logit representation. More...
class  MultiDimNoisyAND
 Noisy AND representation. More...
class  MultiDimNoisyORCompound
 Noisy OR representation. More...
class  MultiDimNoisyORNet
 Noisy OR representation. More...
class  MultiDimPartialInstantiation
 A generic class to instantiate a subset of variables of a multidimensional table. More...
class  MultiDimProjection
 A generic class to project efficiently a MultiDim table over a subset of its variables. More...
class  MultiDimReadOnly
 Abstract base class for all multi dimensionnal read only structure. More...
class  MultiDimSparse
 Multidimensional matrix stored as a sparse array in memory. More...
class  MultiDimWithOffset
 Abstract class for Multidimensional matrix stored as an array in memory and with an offset associated with each slave instantiation. More...
class  MultiPriorityQueue
 A MultiPriorityQueue is a heap in which each element has a mutable priority and duplicates are allowed. More...
class  NetReader
 Pure virtual class for reading a BN from a file. More...
class  NetWriter
 Writes a IBayesNet in the BN format. More...
class  NodeDatabase
 <agrum/FMDP/learning/datastructure/nodeDatabase.h> More...
class  NodeGraphPart
 Class for node sets in graph. More...
class  NodeGraphPartIterator
 Unsafe iterator on the node set of a graph. More...
class  NodeGraphPartIteratorSafe
 Safe iterator on the node set of a graph. More...
class  NumericalDiscreteVariable
 class NumericalDiscreteVariable More...
class  O3prmBNReader
 Read an O3PRM and transform the gum::prm::PRMSystem into gum::BayesNet. More...
class  O3prmBNWriter
 <agrum/PRM/o3prm/O3prmBNWriter.h> More...
class  O4DGContext
 Class used to manipulate context during Function Graph Operations. More...
class  Observation
class  OperatorRegister4MultiDim
 A container for registering binary functions on multiDimImplementations. More...
struct  Operators4MultiDimInitialize
 a class used to register operators over non-pointers types More...
struct  Operators4MultiDimInitialize< GUM_ELEMENT * >
 a class used to register operators over pointers types More...
class  optional_ref
 A lightweight wrapper around a pointer providing an optional-like API for references (not supported by std::optional<T&>). More...
class  OrderedEliminationSequenceStrategy
 An Elimination sequence algorithm that imposes a given complete ordering on the nodes elimination sequence. More...
class  OrderedTriangulation
 class for graph triangulations for which we enforce a given complete ordering on the nodes eliminations. More...
class  PAG
 Partial Ancestral Graph: undirected topology with endpoint marks. More...
class  Parent
 Represent a node's parent. More...
class  ParseError
 This class is used to represent parsing errors for the different parser implemented in aGrUM. More...
class  PartialInstantiation4MultiDimInitialize
 A class used to register instantiation functions over non-pointers types. More...
struct  PartialInstantiation4MultiDimInitialize< GUM_ELEMENT * >
class  PartialInstantiationRegister4MultiDim
 A container for registering partial instantiation functions on multiDimImplementations, i.e., functions assigning values to subsets of the variables of some tables. More...
class  PartialOrderedEliminationSequenceStrategy
 Base class for all elimination sequence algorithm that impose a given partial ordering on the nodes elimination sequence, that is, the set of all the nodes is divided into several subsets. More...
class  PartialOrderedTriangulation
 class for graph triangulations for which we enforce a given partial ordering on the nodes eliminations, that is, the set of all the nodes is divided into several subsets. More...
class  PDAG
 Base class for partially directed acyclic graphs. More...
class  PriorityQueue
 A priorityQueue is a heap in which each element has a mutable priority. More...
class  PriorityQueueImplementation
 The internal class for representing priority queues. More...
class  ProgressListener
 The ProgressListener class. More...
class  ProgressNotifier
 Notification for progress using listener. More...
class  ProjectionRegister4MultiDim
 A container for registering projection functions on multiDimImplementations, i.e., functions projecting tables over a subset of their variables. More...
struct  Projections4MultiDimInitialize
 a class used to register projections over non-pointers types More...
struct  Projections4MultiDimInitialize< GUM_ELEMENT * >
 a class used to register projections over pointers types More...
class  RandomDecider
 Class to make decision randomly. More...
class  RangeVariable
 Defines a discrete random variable over an integer interval. More...
class  Rational
 Class template used to approximate decimal numbers by rationals. More...
class  Regress
 Class used to perform Function Graph Operations in the FMDP Framework. More...
class  SamplingInference
 <agrum/BN/inference/samplingInference.h> More...
class  Schedule
 Class containing a schedule of operations to perform on multidims. More...
class  ScheduleBinaryCombination
 a binary Combination operator class used for scheduling inferences More...
class  ScheduledInference
 the class containing the scheduler used by schedule-based inferences More...
class  ScheduleMultiDim
 a Wrapper for multi-dimensional tables used for scheduling inferences More...
class  ScheduleOperator
 the base class for "low-level" operators used to schedule inferences More...
class  ScheduleProjection
 a Projection operator class used for scheduling inferences More...
class  Scheduler
 The common interface of all the schedulers. More...
class  SchedulerParallel
 A scheduler that executes available operators in parallel. More...
class  SchedulerSequential
class  ScheduleStorage
 Class for storing multidimensional tables into containers (sets, etc.). More...
class  SDYNA
 The general SDyna architecture abstract class. More...
class  Separation
 Consolidated d-separation utilities (DAG-centric). More...
class  Sequence
 The generic class for storing (ordered) sequences of objects. More...
class  SequenceImplementation
 The internal class for storing (ordered) sequences of objects. More...
class  SequenceIteratorSafe
 Safe iterators for Sequence. More...
class  Set
 Representation of a set. More...
class  SetInst
 Class for assigning/browsing values to tuples of discrete variables. More...
class  SetIterator
 Unsafe iterators for the Set class. More...
class  SetIteratorSafe
 Safe iterators for the Set class. More...
class  SetTerminalNodePolicy
 Implementation of a Terminal Node Policy that maps nodeid to a set of value. More...
class  ShaferShenoyInference
 Implementation of Shafer-Shenoy's propagation algorithm for inference in Bayesian networks. More...
class  ShaferShenoyLIMIDInference
class  ShaferShenoyMRFInference
 <agrum/MRF/inference/ShaferShenoyMRFInference.h> More...
class  Signaler
 Variadic template signaler for any number of arguments. More...
class  SimpleBayesNetGenerator
 <agrum/BN/generator/simpleBayesNetGenerator.h> More...
class  SimpleCPTDisturber
 <agrum/BN/generator/simpleCPTDisturber.h> More...
class  SimpleCPTGenerator
 <agrum/BN/generator/simpleCPTGenerator.h> More...
class  SimpleUTGenerator
 Class for generating Utility Tables. More...
class  SimplicialSet
 Class enabling fast retrieval of simplicial, quasi and almost simplicial nodes. More...
class  SmallObjectAllocator
 <agrum/base/core/smallObjectAllocator.h> More...
class  SortedPriorityQueue
 A priority queue in which we can iterate over the elements from the top to bottom or conversely. More...
class  SortedPriorityQueueIterator
 Sorted priority queue iterator. More...
class  SortedPriorityQueueIteratorSafe
 Sorted priority queues safe (w.r.t. More...
class  SortedPriorityQueueReverseIterator
 Sorted priority queue reverse iterator. More...
class  SortedPriorityQueueReverseIteratorSafe
 Sorted priority queue safe (w.r.t. More...
class  SpanningForest
 Base class for computing min cost spanning trees or forests. More...
class  SpanningForestPrim
 The Prim algorithm for computing min cost spanning trees or forests. More...
class  SplayBinaryNode
 the nodes of splay trees More...
class  SplayTree
 A splay tree. More...
class  StatesChecker
 <agrum/FMDP/simulation/statesChecker.h> More...
class  StatesCounter
 <agrum/FMDP/simulation/statesCounter.h> More...
class  StaticTriangulation
 base class for all non-incremental triangulation methods More...
class  StatisticalLazyDecider
 <agrum/FMDP/decision/statisticalLazyDecider.h> More...
class  StructuralMetrics
 A class for comparing graphs based on their structures. More...
class  StructuredPlaner
 <agrum/FMDP/planning/structuredPlaner.h> More...
class  TaxiSimulator
 A class to simulate the Taxi problem. More...
class  Tensor
 aGrUM's Tensor is a multi-dimensional array with tensor operators. More...
struct  TestSelect
struct  TestSelect< CHI2TEST, A, B, C >
struct  TestSelect< LEASTSQUARETEST, A, B, C >
class  ThreadData
 A wrapper that enables to store data in a way that prevents false cacheline sharing. More...
class  ThreadExecutorBase
 Set the max number of threads to be used. More...
class  ThreadNumberManager
 A class to manage the number of threads to use in an algorithm. More...
class  Timer
 Class used to compute response times for benchmark purposes. More...
class  TreeOperator
 Class used to perform Decision Tree Operation in the FMDP Framework. More...
class  TreeOperatorStrategy
 <agrum/FMDP/planning/treeOperatorStrategy.h> More...
class  TreeRegress
 Class used to perform Decision Tree Regression in the FMDP Framework. More...
class  Triangulation
 Interface for all the triangulation methods. More...
class  UAIBNReader
 Pure virtual class for reading a BN from a file. More...
class  UAIBNWriter
 Writes a Bayes net in a text file with UAI format. More...
class  UAIMRFReader
 Pure virtual class for reading a MRF from a file. More...
class  UAIMRFWriter
 <agrum/MRF/io/UAI/UAIMRFWriter.h> More...
class  UGmodel
 Virtual base class for PGMs using a undirected graph. More...
class  UnconstrainedEliminationSequenceStrategy
 The base class for all elimination sequence algorithms that require only the graph to be triangulated and the nodes' domain sizes to produce the node elimination ordering. More...
class  UnconstrainedTriangulation
 Interface for all triangulation methods without constraints on node elimination orderings. More...
class  UndiGraph
 Base class for undirected graphs. More...
class  UndiGraphListener
 Abstract Base class for all undiGraph Listener. More...
class  UTGenerator
 Abstract class for generating Utility Tables. More...
struct  ValueSelect
struct  ValueSelect< false, A, B >
class  Variable
 Base class for every random variable. More...
class  VariableElimination
 Implementation of a Variable Elimination's-like version of lazy propagation for inference in Bayesian networks. More...
class  VariableLog2ParamComplexity
 the class for computing the log2 of the parametric complexity of an r-ary multinomial variable More...
class  VariableNodeMap
 Container used to map discrete variables with nodes. More...
class  VariableSelector
 <agrum/FMDP/planning/FunctionGraph/variableselector.h> More...
class  WeightedSampling
class  XDSLBNReader
 <agrum/BN/io/XDSL/XDSLBNReader.h> More...
class  XDSLBNWriter
 <agrum/BN/io/XDSLXML/XDSLBNWriter.h> More...
class  XmlDocument
 An XML document, opaque over ticpp::Document. More...
class  XmlElement
 A non-owning handle to an XML element, opaque over ticpp::Element. More...
class  XmlException
 Thrown by XmlDocument/XmlElement on any ticpp/tinyxml parse or access error. More...

Concepts

concept  GUM_DiGraphable
 Concept for directed graphs (arcs with parents/children).
concept  GUM_HasNumericLimits
 Concept checking that std::numeric_limits is specialized for a type.
concept  GUM_IsGumScalar
 Concept defining requirements for scalar types used as GUM_SCALAR.
concept  GUM_MixedGraphable
 Concept for mixed graphs (both arcs and edges).
concept  GUM_NodeGraphable
 Concept for any graph that exposes node-level queries.
concept  GUM_Numeric
 Complete concept for GUM_SCALAR template parameter.
concept  GUM_UndiGraphable
 Concept for undirected graphs (edges with neighbours).
concept  JointTargettable

Typedefs

using Signaler0 = Signaler<>
 Signaler with no arguments.
using ThreadExecutor = threadsSTL::ThreadExecutor
using JunctionTree = CliqueGraph
 a junction tree is a clique graph satisfying the running intersection property and such that no clique is included into another one.
using JoinTree = CliqueGraph
 a join tree is a clique graph satisfying the running intersection property (but some cliques may be included into others)
using NodeId = Size
 Type for node ids.
using VariableSet = Set< const DiscreteVariable* >
template<GUM_Numeric GUM_SCALAR>
using HybridMonteCarloSampling = LoopySamplingInference< GUM_SCALAR, MonteCarloSampling >
template<GUM_Numeric GUM_SCALAR>
using HybridWeightedSampling = LoopySamplingInference< GUM_SCALAR, WeightedSampling >
template<GUM_Numeric GUM_SCALAR>
using HybridImportanceSampling = LoopySamplingInference< GUM_SCALAR, ImportanceSampling >
template<GUM_Numeric GUM_SCALAR>
using HybridGibbsSampling = LoopySamplingInference< GUM_SCALAR, GibbsSampling >
using LatentDescriptorIds = std::pair< std::string, std::vector< NodeId > >
 LatentDescriptorIds = (latentName, (child1Id, child2Id, ...)).
using LatentDescriptorVector = std::vector< LatentDescriptorIds >
 Collection of latent descriptors (see LatentDescriptorIds).
using pair_iterator = HashTableConstIteratorSafe< LeafPair*, std::vector< Size > >
template<GUM_Numeric GUM_SCALAR>
using FactorTable = HashTable< NodeSet, const Tensor< GUM_SCALAR >* >
using Size = std::size_t
 In aGrUM, hashed values are unsigned long int.
using Idx = Size
 Type for indexes.
template<class VAL>
using NodeProperty = HashTable< NodeId, VAL >
 Property on graph elements.
template<class VAL>
using EdgeProperty = HashTable< Edge, VAL >
 Property on graph elements.
template<class VAL>
using ArcProperty = HashTable< Arc, VAL >
 Property on graph elements.

Enumerations

enum class  BinTreeDir : char { LEFT_CHILD = 0 , RIGHT_CHILD = 1 , NO_PARENT = 2 }
 The direction of a given edge in a binary tree. More...
enum class  StaticInitializer : char { CONSTINIT , CONSTEXPR }
enum class  ScheduleOperatorType : char { COMBINE_MULTIDIM , PROJECT_MULTIDIM , DELETE_MULTIDIM , STORE_MULTIDIM }
 the currently supported types of "low-level" operators More...
enum  SchedulerType { SEQUENTIAL , PARALLEL_OPERATORS }
 the type of scheduler that can be used More...
enum class  EdgeMark : uint8_t { Circle = 0 , Tail = 1 , Arrowhead = 2 }
 Endpoint marks used in PAG edges. More...
enum class  VarType : char {
  DISCRETIZED , LABELIZED , INTEGER , NUMERICAL ,
  RANGE , CONTINUOUS
}
enum class  Complexity : char { Heavy , Difficult , Correct }
 Complexity allows to characterize the awaited difficulty for an algorithm given a specific instance Therefore this is not a theoretical characterization but rather a pragmatic rate of that very instance. More...
enum class  FindBarrenNodesType { FIND_NO_BARREN_NODES , FIND_BARREN_NODES }
 type of algorithm to determine barren nodes More...
enum class  RelevantTensorsFinderType { FIND_ALL , DSEP_BAYESBALL_NODES , DSEP_BAYESBALL_TENSORS , DSEP_KOLLER_FRIEDMAN_2009 }
 type of algorithm for determining the relevant tensors for combinations using some d-separation analysis More...
enum class  FMDPfactory_state : char {
  NONE , VARIABLE , ACTION , TRANSITION ,
  COST , REWARD , DISCOUNT
}
 The enumeration of states in which the factory can be in. More...
enum  TESTNAME { GTEST = 1 , CHI2TEST = 2 , LEASTSQUARETEST = 3 }
enum  LEARNERNAME { IMDDILEARNER = 1 , ITILEARNER = 2 }
enum  FactorySimulationLandmark : Idx {
  HOME = 0 , WORK = 1 , THEATER = 2 , CLUB = 3 ,
  Factory = 4
}
enum  FactorySimulationLandmarkX : Idx {
  HOMEX = 0 , WORKX = 0 , THEATERX = 3 , CLUBX = 4 ,
  STATIONX = 2
}
enum  FactorySimulationLandmarkY : Idx {
  HOMEY = 0 , WORKY = 4 , THEATERY = 0 , CLUBY = 4 ,
  STATIONY = 1
}
enum  FactorySimulationAction : Idx {
  GoNorth = 0 , GoEast = 1 , GoSouth = 2 , GoWest = 3 ,
  PickUp = 4 , PutDown = 5 , FillUp = 6
}
enum  TaxiSimulationLandmark : Idx {
  HOME = 0 , WORK = 1 , THEATER = 2 , CLUB = 3 ,
  TAXI = 4
}
enum  TaxiSimulationLandmarkX : Idx {
  HOMEX = 0 , WORKX = 0 , THEATERX = 3 , CLUBX = 4 ,
  STATIONX = 2
}
enum  TaxiSimulationLandmarkY : Idx {
  HOMEY = 0 , WORKY = 4 , THEATERY = 0 , CLUBY = 4 ,
  STATIONY = 1
}
enum  TaxiSimulationAction : Idx {
  GoNorth = 0 , GoEast = 1 , GoSouth = 2 , GoWest = 3 ,
  PickUp = 4 , PutDown = 5 , FillUp = 6
}

Functions

template<typename Val, typename Cmp>
std::ostream & operator<< (std::ostream &stream, const AVLTree< Val, Cmp > &tree)
 display the content of a tree
template<typename T1, typename T2>
std::ostream & operator<< (std::ostream &, const Bijection< T1, T2 > &bijection)
 For friendly display of the content of the gum::Bijection.
std::string_view configurationEmbeddedDefaults ()
std::string_view configurationEmbeddedPyAgrumDefaults ()
Configuration & config ()
 A short name for Configuration::instance() : gum::config().epsilonStandard(). It is not inline so that it is exported by the library (shared build on Windows).
GUM_SHARED_PUBLIC unsigned int _hashTableLog2_ (const Size nb)
 Returns the size in bits - 1 necessary to store the smallest power of 2 greater than or equal to nb.
template<typename Key, typename Val>
std::ostream & operator<< (std::ostream &s, const HashTableList< Key, Val > &list)
 Prints the content of a gum::HashTableList in the stream.
template<typename Key, typename Val>
std::ostream & operator<< (std::ostream &s, const HashTableList< Key *, Val > &list)
 Prints the content of a gum::HashTableList with pointers key in the stream.
template<typename Key, typename Val>
std::ostream & operator<< (std::ostream &s, const HashTable< Key, Val > &table)
 Prints the content of a gum::HashTable in the stream.
template<typename Key, typename Val>
std::ostream & operator<< (std::ostream &s, const HashTable< Key *, Val > &table)
 Prints the content of a gum::HashTable with pointers key in the stream.
HashTableIteratorSafe< Key, Val > & operator++ () noexcept
HashTableIteratorSafe< Key, Val > & operator+= (Size i) noexcept
 Makes the iterator point to i elements further in the hashtable.
HashTableIteratorSafe< Key, Val > operator+ (Size i) const
 Returns a new iterator pointing to i elements further in the hashtable.
bool operator== (const HashTableIteratorSafe< Key, Val > &from) const noexcept
 Checks whether two iterators are pointing toward equal elements.
value_type & operator* ()
 Returns the value pointed to by the iterator.
template<typename Val, typename Cmp>
std::ostream & operator<< (std::ostream &, const Heap< Val, Cmp > &)
template<typename Key, typename Data>
std::ostream & operator<< (std::ostream &, const IndexedTree< Key, Data > &)
 Necessary for the hashtable operator <<.
template<typename Val>
std::ostream & operator<< (std::ostream &stream, const List< Val > &list)
 an << operator for List
template<typename Val>
ListConstIterator< Val >::difference_type operator- (const ListConstIterator< Val > &iter1, const ListConstIterator< Val > &iter2)
 For STL compliance, a distance operator.
template<typename Val>
ListConstIteratorSafe< Val >::difference_type operator- (const ListConstIteratorSafe< Val > &iter1, const ListConstIteratorSafe< Val > &iter2)
 For STL compliance, a distance operator.
void print_stack (std::stack< FormulaPart > s)
void print_output (std::vector< FormulaPart > v)
std::string func2str (FormulaPart::token_function func)
Formula operator- (const Formula &a)
Formula operator+ (const Formula &a, const Formula &b)
Formula operator- (const Formula &a, const Formula &b)
Formula operator* (const Formula &a, const Formula &b)
Formula operator/ (const Formula &a, const Formula &b)
std::string to_string (const Formula &f)
std::ostream & operator<< (std::ostream &os, const Formula &f)
template<typename T>
bool isCloseToZero (T x, T tol=static_cast< T >(config().epsilonFine()))
 Is |x| <= tol ? By default, tol is the key core.epsilonFine of the configuration.
template<typename T>
bool isCloseToOne (T x, T tol=static_cast< T >(config().epsilonFine()))
 Is |x - 1| <= tol ? By default, tol is the key core.epsilonFine of the configuration.
template<typename T>
bool isfinite (T arg)
template<typename Val, typename Priority, typename Cmp>
std::ostream & operator<< (std::ostream &stream, const MultiPriorityQueue< Val, Priority, Cmp > &queue)
template<typename Val, typename Priority, typename Cmp>
std::ostream & operator<< (std::ostream &, const PriorityQueue< Val, Priority, Cmp > &)
template<typename Key>
std::ostream & operator<< (std::ostream &stream, const Sequence< Key > &s)
 A << operator for displaying the content of the Sequence.
template<typename Key, bool Gen>
std::ostream & operator<< (std::ostream &stream, const SequenceImplementation< Key, Gen > &seq)
template<typename Key>
std::ostream & operator<< (std::ostream &stream, const SequenceImplementation< Key, true > &seq)
template<typename Key>
std::ostream & operator<< (std::ostream &, const Set< Key > &)
 A << operator for HashTableList.
template<typename Val, typename Priority, typename Cmp>
std::ostream & operator<< (std::ostream &stream, const SortedPriorityQueue< Val, Priority, Cmp > &queue)
 display the content of a sorted priority queue
template<typename Element>
INLINE std::ostream & operator<< (std::ostream &out, const SplayBinaryNode< Element > &e)
 Display the node.
template<typename Element>
INLINE std::ostream & operator<< (std::ostream &out, const SplayTree< Element > &s)
 Display the tree.
template<class Element>
static void removeInfo (const SplayBinaryNode< Element > *e, HashTable< Element, SplayBinaryNode< Element > * > &addr)
template<typename Element>
std::ostream & operator<< (std::ostream &out, const SplayBinaryNode< Element > &e)
 Display the node.
template<typename Element>
std::ostream & operator<< (std::ostream &out, const SplayTree< Element > &s)
 Display the tree.
void setNumberOfThreads (unsigned int number)
 Set the max number of threads to be used when entering the next parallel region.
bool isOMP ()
 indicates whether aGrUM uses openMP or STL threads
std::vector< std::pair< Idx, Idx > > dispatchRangeToThreads (Idx beg, Idx end, unsigned int nb_threads)
 returns a vector equally splitting elements of a range among threads
std::ostream & operator<< (std::ostream &os, const Timer &t)
template<typename GENERATOR>
Idx randomValue (GENERATOR &generator, const Size max)
NodeSet junctionTreeRoots (const JunctionTree &jt, const GraphicalModel &model, const NodeSet &preferred)
 Returns one root for each connected component of a junction tree.
GUM_SHARED_PUBLIC std::ostream & operator<< (std::ostream &, const VariableNodeMap &)
 for friendly displaying the content of clique graphs
GUM_SHARED_PUBLIC std::ostream & operator<< (std::ostream &, const CliqueGraph &)
 for friendly displaying the content of clique graphs
std::ostream & operator<< (std::ostream &stream, const DiGraph &g)
 for friendly displaying the content of directed graphs
template<GUM_NodeGraphable GRAPH_TYPE = MixedGraph>
GRAPH_TYPE fastGraph (std::string_view desc)
 Builds a GRAPH_TYPE from a DOT-like textual description.
GUM_SHARED_PUBLIC std::ostream & operator<< (std::ostream &stream, const Edge &edge)
 to friendly display an edge
GUM_SHARED_PUBLIC std::ostream & operator<< (std::ostream &stream, const Arc &arc)
 to friendly display an arc
std::ostream & operator<< (std::ostream &stream, const MixedGraph &g)
 for friendly displaying the content of directed graphs
std::ostream & operator<< (std::ostream &stream, const PAG &g)
std::ostream & operator<< (std::ostream &s, const ArcGraphPart &a)
 for friendly displaying the content of arc set
std::ostream & operator<< (std::ostream &, const EdgeGraphPart &)
 for friendly displaying the content of an edge set
std::ostream & operator<< (std::ostream &, const NodeGraphPart &)
 for friendly displaying the content of node set
bool rec_hasMixedReallyOrientedPath (const PDAG &gr, NodeSet &marked, NodeId node, NodeId goal, bool alreadyOriented)
std::ostream & operator<< (std::ostream &stream, const UndiGraph &g)
 for friendly displaying the content of undirected graphs
int defaultJgumIndent ()
 The indentation used by the GUM writers (jgum text format) when none is given: the value of the key jgumIndent of section core in gum::Configuration.
GUM_SHARED_PUBLIC std::vector< uint8_t > _readVector_ (std::istream &is)
 Reads a length-prefixed byte vector from a binary stream (bgum format).
GUM_SHARED_PUBLIC void _writeVector_ (std::ostream &os, const std::vector< uint8_t > &vec)
 Writes a length-prefixed byte vector to a binary stream (bgum format).
template<GUM_Numeric GUM_SCALAR>
std::ostream & operator<< (std::ostream &s, const MultiDimLogit< GUM_SCALAR > &ag)
 For friendly displaying the content of the array.
template<GUM_Numeric GUM_SCALAR>
std::ostream & operator<< (std::ostream &s, const MultiDimNoisyAND< GUM_SCALAR > &ag)
 For friendly displaying the content of the array.
template<GUM_Numeric GUM_SCALAR>
std::ostream & operator<< (std::ostream &s, const MultiDimNoisyORCompound< GUM_SCALAR > &ag)
 For friendly displaying the content of the array.
template<GUM_Numeric GUM_SCALAR>
std::ostream & operator<< (std::ostream &s, const MultiDimNoisyORNet< GUM_SCALAR > &ag)
 For friendly displaying the content of the array.
template<typename GUM_ELEMENT>
std::ostream & operator<< (std::ostream &out, const MultiDimContainer< GUM_ELEMENT > &array)
template<typename GUM_ELEMENT>
void _initTensorOperators__ ()
template<typename GUM_ELEMENT>
std::ostream & operator<< (std::ostream &, const MultiDimImplementation< GUM_ELEMENT > &)
 For friendly displaying the content of the array.
template<typename GUM_ELEMENT>
MultiDimImplementation< GUM_ELEMENT > & operator<< (MultiDimImplementation< GUM_ELEMENT > &array, const DiscreteVariable &v)
MultiDimInterface & operator<< (MultiDimInterface &c, const DiscreteVariable &v)
 Adds a new var to the sequence of vars.
MultiDimInterface & operator>> (MultiDimInterface &c, const DiscreteVariable &v)
 Removes a var from the variables of the MutliDimAdressing.
std::ostream & operator<< (std::ostream &, const Instantiation &)
 Print information of the instantiation in the stream.
GUM_SHARED_PUBLIC std::ostream & operator<< (std::ostream &, const SetInst &)
 Print information of the SetInst in the stream.
GUM_SHARED_PUBLIC gum::SetInst & operator<< (gum::SetInst &inst, const gum::DiscreteVariable &i)
 Adds a variable to inst.
GUM_SHARED_PUBLIC gum::SetInst & operator>> (gum::SetInst &inst, const gum::DiscreteVariable &i)
 Removes a variable to inst.
template<GUM_Numeric GUM_SCALAR>
Tensor< GUM_SCALAR > log2 (const Tensor< GUM_SCALAR > &arg)
template<GUM_Numeric GUM_SCALAR>
Tensor< GUM_SCALAR > abs (const Tensor< GUM_SCALAR > &arg)
template<GUM_Numeric GUM_SCALAR>
Tensor< GUM_SCALAR > sq (const Tensor< GUM_SCALAR > &arg)
template<GUM_Numeric GUM_SCALAR>
std::ostream & operator<< (std::ostream &out, const Tensor< GUM_SCALAR > &array)
template<typename GUM_ELEMENT>
void registerCompleteProjection (std::string_view projection_name, std::string_view type_multidim, typename CompleteProjectionRegister4MultiDim< GUM_ELEMENT >::CompleteProjectionPtr function)
 A function to more easily register new projection functions in MultiDims.
template<typename GUM_ELEMENT>
GUM_ELEMENT projectMax (const MultiDimImplementation< GUM_ELEMENT > &table, Instantiation *instantiation=0)
 the function to be used to project a MultiDimImplementation using a Max
template<typename GUM_ELEMENT>
GUM_ELEMENT projectMin (const MultiDimImplementation< GUM_ELEMENT > &table, Instantiation *instantiation=0)
 the function to be used to project a MultiDimImplementation using a Min
template<typename GUM_ELEMENT>
GUM_ELEMENT projectSum (const MultiDimImplementation< GUM_ELEMENT > &table, Instantiation *instantiation=0)
 the function to be used to project a MultiDimImplementation using a sum
template<typename GUM_ELEMENT>
GUM_ELEMENT projectProduct (const MultiDimImplementation< GUM_ELEMENT > &table, Instantiation *instantiation=0)
 the function to be used to project a MultiDimImplementation using a Product
template<typename GUM_ELEMENT>
void completeProjections4MultiDimInit ()
 the function used to register all the complete projection operators on multidimImplementations over non-pointers types.
template<typename GUM_ELEMENT>
void pointerCompleteProjections4MultiDimInit ()
 The function used to register all the complete projections on multidimImplementations over pointers types.
template<typename GUM_ELEMENT>
void registerOperator (std::string_view operation_name, std::string_view type1, std::string_view type2, typename OperatorRegister4MultiDim< GUM_ELEMENT >::OperatorPtr function)
 A function to more easily register new operators in MultiDims.
template<typename GUM_ELEMENT>
void operators4MultiDimInit ()
 the function used to register all the operators on multidimImplementations over non-pointers types.
template<typename GUM_ELEMENT>
void pointerOperators4MultiDimInit ()
 the function used to register all the operators on multidimImplementations over pointers types.
template<typename GUM_ELEMENT>
void registerProjection (std::string_view projection_name, std::string_view type_multidim, typename ProjectionRegister4MultiDim< GUM_ELEMENT >::ProjectionPtr function)
 A function to more easily register new projection functions in MultiDims.
template<typename GUM_ELEMENT>
MultiDimImplementation< GUM_ELEMENT > * projectMax (const MultiDimImplementation< GUM_ELEMENT > &table, const gum::VariableSet &del_vars)
 The function to be used to project a MultiDimImplementation using a Max.
template<typename GUM_ELEMENT>
MultiDimImplementation< GUM_ELEMENT > * projectMin (const MultiDimImplementation< GUM_ELEMENT > &table, const gum::VariableSet &del_vars)
 The function to be used to project a MultiDimImplementation using a Min.
template<typename GUM_ELEMENT>
MultiDimImplementation< GUM_ELEMENT > * projectSum (const MultiDimImplementation< GUM_ELEMENT > &table, const gum::VariableSet &del_vars)
 The function to be used to project a MultiDimImplementation using a Sum.
template<typename GUM_ELEMENT>
MultiDimImplementation< GUM_ELEMENT > * projectProduct (const MultiDimImplementation< GUM_ELEMENT > &table, const gum::VariableSet &del_vars)
 The function to be used to project a MultiDimImplementation using a Product.
template<typename GUM_ELEMENT>
void projections4MultiDimInit ()
 the function used to register all the projection operators on multidimImplementations over non-pointers types.
template<typename GUM_ELEMENT>
void pointerProjections4MultiDimInit ()
 the function used to register all the projections on multidimImplementations over pointers types.
template<typename GUM_ELEMENT>
MultiDimArray< GUM_ELEMENT > * partialInstantiationMultiDimArray (const MultiDimArray< GUM_ELEMENT > *table, const HashTable< const DiscreteVariable *, Idx > &inst_vars)
 A specialized function for instantiating variables in a multiDimArray.
template<typename GUM_ELEMENT>
MultiDimImplementation< GUM_ELEMENT > * partialInstantiationMultiDimArray (const MultiDimImplementation< GUM_ELEMENT > *table, const HashTable< const DiscreteVariable *, Idx > &inst_vars)
 A specialized function for instantiating variables in a MultiDimImplementation.
template<typename GUM_ELEMENT>
MultiDimArray< GUM_ELEMENT * > * partialInstantiationMultiDimArray4Pointers (const MultiDimArray< GUM_ELEMENT * > *table, const HashTable< const DiscreteVariable *, Idx > &inst_vars)
 A specialized function for instantiating variables in a MultiDimArray.
template<typename GUM_ELEMENT>
MultiDimImplementation< GUM_ELEMENT * > * partialInstantiationMultiDimArray4Pointers (const MultiDimImplementation< GUM_ELEMENT * > *table, const HashTable< const DiscreteVariable *, Idx > &inst_vars)
 A specialized function for instantiating variables in a MultiDimArray.
template<typename GUM_ELEMENT>
MultiDimImplementation< GUM_ELEMENT > * partialInstantiation (const MultiDimImplementation< GUM_ELEMENT > &table, const HashTable< const DiscreteVariable *, Idx > &inst_vars)
 Instantiate variables in a MultiDimImplementation.
template<typename GUM_ELEMENT>
MultiDimImplementation< GUM_ELEMENT > * partialInstantiation (const MultiDimDecorator< GUM_ELEMENT > &table, const HashTable< const DiscreteVariable *, Idx > &inst_vars)
 Instantiate variables in a MultiDimDecorator.
template<typename GUM_ELEMENT>
void partialInstantiation4MultiDimInit ()
 The function used to register all the instantiation operators on multidimImplementations over non-pointers types.
template<typename GUM_ELEMENT>
void pointerPartialInstantiation4MultiDimInit ()
 The function used to register all the instantiations on multidimImplementations over pointers types.
template<typename GUM_ELEMENT>
void registerPartialInstantiation (std::string_view instantiation_func_name, std::string_view type_multidim, typename PartialInstantiationRegister4MultiDim< GUM_ELEMENT >::PartialInstantiationPtr function)
 A function to more easily register new instantiation functions in MultiDims.
template<GUM_Numeric GUM_SCALAR = double>
std::unique_ptr< DiscreteVariable > fastVariable (std::string var_description, Size default_domain_size)
 Create a pointer on a Discrete Variable from a "fast" syntax.
template<GUM_Numeric GUM_SCALAR = double>
std::unique_ptr< DiscreteVariable > fastVariable (std::string var_description, std::string_view default_domain="[2]")
 Create a pointer on a Discrete Variable from a "fast" syntax.
template<typename T_VAL>
std::ostream & operator<< (std::ostream &, const ContinuousVariable< T_VAL > &)
 for friendly displaying the content of the variable
GUM_SHARED_PUBLIC std::ostream & operator<< (std::ostream &, const DiscreteVariable &)
 for friendly displaying the content of the variable
template<GUM_Numeric GUM_SCALAR>
std::ostream & operator<< (std::ostream &output, const BayesNet< GUM_SCALAR > &bn)
 Prints map's DAG in output using the Graphviz-dot format.
template<GUM_Numeric GUM_SCALAR>
NodeId build_node (gum::BayesNet< GUM_SCALAR > &bn, std::string_view node, std::string_view default_domain)
template<GUM_Numeric GUM_SCALAR>
gum::Size getMaxModality (gum::BayesNet< GUM_SCALAR > &bayesNet)
template<GUM_Numeric GUM_SCALAR>
std::ostream & operator<< (std::ostream &output, const IBayesNet< GUM_SCALAR > &bn)
 Prints map's DAG in output using the Graphviz-dot format.
template<GUM_Numeric GUM_SCALAR>
static INLINE Tensor< GUM_SCALAR > LPNewmultiTensor (const Tensor< GUM_SCALAR > &t1, const Tensor< GUM_SCALAR > &t2)
template<GUM_Numeric GUM_SCALAR>
static INLINE Tensor< GUM_SCALAR > LPNewprojTensor (const Tensor< GUM_SCALAR > &t1, const gum::VariableSet &del_vars)
template<GUM_Numeric GUM_SCALAR>
static INLINE Tensor< GUM_SCALAR > LPMaxprojTensor (const Tensor< GUM_SCALAR > &t1, const gum::VariableSet &del_vars)
template<GUM_Numeric GUM_SCALAR>
static INLINE Tensor< GUM_SCALAR > SSNewmultiTensor (const Tensor< GUM_SCALAR > &t1, const Tensor< GUM_SCALAR > &t2)
template<GUM_Numeric GUM_SCALAR>
static INLINE Tensor< GUM_SCALAR > SSNewprojTensor (const Tensor< GUM_SCALAR > &t1, const gum::VariableSet &del_vars)
template<GUM_Numeric GUM_SCALAR>
static INLINE Tensor< GUM_SCALAR > VENewmultiTensor (const Tensor< GUM_SCALAR > &t1, const Tensor< GUM_SCALAR > &t2)
template<GUM_Numeric GUM_SCALAR>
static INLINE Tensor< GUM_SCALAR > VENewprojTensor (const Tensor< GUM_SCALAR > &t1, const gum::VariableSet &del_vars)
template<GUM_Numeric GUM_SCALAR>
PYGUM_PUBLIC std::tuple< CausalImpact< GUM_SCALAR >, Tensor< GUM_SCALAR >, std::string > causalImpact (const CausalModel< GUM_SCALAR > &cm, const Set< std::string > &on, const Set< std::string > &doing, const Set< std::string > &knowing=Set< std::string >(), const HashTable< std::string, std::string > &values=HashTable< std::string, std::string >())
 Standalone helper that mirrors the Python function causalImpact(...).
template<GUM_Numeric GUM_SCALAR>
Instantiation makeInstantiationFromValues (const Tensor< GUM_SCALAR > &tensor, const HashTable< std::string, std::string > &values)
 Creates an instance for a tensor based on a HashTable.
std::string _formatVarsForSentence_ (const Set< std::string > &vars)
std::string _dsepExplanation_ (const Set< std::string > &on, const Set< std::string > &doing, const Set< std::string > &knowing)
DAG _removeIncomingIntoLocal_ (const DAG &g, const NodeSet &xset)
template<GUM_Numeric GUM_SCALAR>
std::string _formatNodeSetNames_ (const CausalModel< GUM_SCALAR > &cm, const NodeSet &zset)
template<GUM_Numeric GUM_SCALAR>
std::tuple< CausalImpact< GUM_SCALAR >, Tensor< GUM_SCALAR >, std::string > causalImpact (const CausalModel< GUM_SCALAR > &cm, const Set< std::string > &on, const Set< std::string > &doing, const Set< std::string > &knowing, const HashTable< std::string, std::string > &values)
 Standalone helper that mirrors the Python function causalImpact(...).
template Tensor< double > counterfactual< double > (const CausalModel< double > &, const Set< std::string > &, const Set< std::string > &, const HashTable< std::string, std::string > &, const HashTable< std::string, std::string > &)
template CausalModel< double > counterfactualModel< double > (const CausalModel< double > &, const HashTable< std::string, std::string > &, const Set< std::string > &)
template<GUM_Numeric GUM_ELEMENT>
PYGUM_PUBLIC Tensor< GUM_ELEMENT > counterfactual (const CausalModel< GUM_ELEMENT > &cm, const Set< std::string > &on, const Set< std::string > &whatif, const HashTable< std::string, std::string > &profile=HashTable< std::string, std::string >(), const HashTable< std::string, std::string > &values=HashTable< std::string, std::string >())
 Compute a counterfactual distribution using the high-level API.
template<GUM_Numeric GUM_ELEMENT>
CausalModel< GUM_ELEMENT > counterfactualModel (const CausalModel< GUM_ELEMENT > &cm, const HashTable< std::string, std::string > &profile, const Set< std::string > &whatif)
 Build the twin causal model.
template<GUM_Numeric GUM_ELEMENT>
Tensor< GUM_ELEMENT > counterfactual (const CausalModel< GUM_ELEMENT > &cm, const Set< std::string > &on, const Set< std::string > &whatif, const HashTable< std::string, std::string > &profile, const HashTable< std::string, std::string > &values)
 Compute a counterfactual distribution using the high-level API.
template<GUM_Numeric GUM_SCALAR>
std::unique_ptr< ASTtree< GUM_SCALAR > > productOfTrees (std::vector< std::unique_ptr< ASTtree< GUM_SCALAR > > > &&lterms)
 Build a product AST from a list of terms.
template std::unique_ptr< ASTtree< double > > productOfTrees< double > (std::vector< std::unique_ptr< ASTtree< double > > > &&)
INLINE std::ostream & operator<< (std::ostream &streamy, const ActionSet &objy)
template<GUM_Numeric GUM_SCALAR>
std::ostream & operator<< (std::ostream &out, const DecisionTensor< GUM_SCALAR > &array)
template<GUM_Numeric GUM_SCALAR>
NodeId build_node_for_ID (gum::InfluenceDiagram< GUM_SCALAR > &infdiag, std::string node, std::string_view domain)
template<GUM_Numeric GUM_SCALAR>
std::ostream & operator<< (std::ostream &output, const KTBN< GUM_SCALAR > &kdbn)
 Prints the k-DBN using its toString() description.
template<GUM_Numeric GUM_SCALAR>
std::ostream & operator<< (std::ostream &output, const IMarkovRandomField< GUM_SCALAR > &mn)
 Prints map's graph in output using the Graphviz-dot format.
template<GUM_Numeric GUM_SCALAR>
static INLINE Tensor< GUM_SCALAR > SSNewMNmultiTensor (const Tensor< GUM_SCALAR > &t1, const Tensor< GUM_SCALAR > &t2)
template<GUM_Numeric GUM_SCALAR>
static INLINE Tensor< GUM_SCALAR > SSNewMNprojTensor (const Tensor< GUM_SCALAR > &t1, const gum::VariableSet &del_vars)
template<GUM_Numeric GUM_SCALAR>
NodeId build_node_for_MN (MarkovRandomField< GUM_SCALAR > &mn, std::string_view node, std::string_view default_domain)
template<GUM_Numeric GUM_SCALAR>
std::ostream & operator<< (std::ostream &output, const MarkovRandomField< GUM_SCALAR > &mn)
GUM_SHARED_PUBLIC unsigned int getMaxNumberOfThreads ()
 Returns the maximum number of threads you should use at any time.
unsigned int getNumberOfThreads ()
 returns the max number of threads used by default when entering the next parallel region
GUM_SHARED_PUBLIC unsigned int getNumberOfLogicalProcessors ()
 Get the number of logical processors.
Integers Pow utility methods
GUM_SHARED_PUBLIC unsigned long intPow (unsigned long base, unsigned long exponent)
 Specialized pow function with integers (faster implementation).
GUM_SHARED_PUBLIC uint64_t int2Pow (uint64_t exponent)
 Specialized base 2 pow function with integer.
GUM_SHARED_PUBLIC void superiorPow (unsigned long card, unsigned long &num_bits, unsigned long &new_card)
 Compute the superior and closest power of two of an integer.
GUM_SHARED_PUBLIC Idx randomValue (const Size max=2)
 Returns a random Idx between 0 and max-1 included.
GUM_SHARED_PUBLIC double randomProba ()
 Returns a random double between 0 and 1 included (i.e.
template<GUM_Numeric GUM_SCALAR>
std::vector< GUM_SCALAR > randomDistribution (Size n)
 Return a random discrete distribution.
GUM_SHARED_PUBLIC unsigned int randomGeneratorSeed ()
 Returns the aGrUM's seed used by the std::generators.
GUM_SHARED_PUBLIC unsigned int currentRandomGeneratorValue ()
 returns the current generator's value
GUM_SHARED_PUBLIC void initRandom (unsigned int seed=0)
 Initialize random generator seed.
GUM_SHARED_PUBLIC std::mt19937 & randomGenerator ()
 define a random_engine with correct seed
std::string getUniqueFileName ()
 Returns a path to a unique file name.
bool endsWith (const std::string_view &value, const std::string_view &ending)
 Returns true if value ends with ending.
std::vector< std::string > split (std::string_view orig, std::string_view delimiter)
 Split str using the delimiter.
std::string replace (std::string_view s, std::string_view val, std::string_view new_val)
 Replace val by new_val in s.
bool isIntegerWithResult (std::string_view val, int *res)
 return true is a string contains an integer value
bool isNumericalWithResult (std::string_view val, double *res)
 return true is a string contains a numerical (double) value
bool parseDecimal (std::string_view val, double &res)
 parse a decimal number, whatever the locale of the program
GUM_SHARED_PUBLIC std::string toLower (std::string_view str)
 Returns the lowercase version of str.
GUM_SHARED_PUBLIC bool contains (std::string_view s, std::string_view needle)
 true if needle in s
GUM_SHARED_PUBLIC bool isInteger (std::string_view val)
 return true is a string contains an integer value
GUM_SHARED_PUBLIC bool isNumerical (std::string_view val)
 return true is a string contains a numerical (double) value
GUM_SHARED_PUBLIC void ltrim (std::string &s)
 trim from start (in place)
GUM_SHARED_PUBLIC void rtrim (std::string &s)
 trim from end (in place)
GUM_SHARED_PUBLIC void trim (std::string &s)
 trim from both ends (in place)
GUM_SHARED_PUBLIC std::string trim_copy (std::string_view s)
 trim from both ends (copying)
GUM_SHARED_PUBLIC std::string remove_newline (std::string_view s)
 remove all newlines in a string
template<typename T>
std::string compact_tostr (T value)
 Returns a path to a unique file name.
Project Max Operators
template<typename GUM_ELEMENT>
GUM_ELEMENT projectMaxMultiDimArray (const MultiDimArray< GUM_ELEMENT > *table, Instantiation *instantiation=0)
 A specialized function for projecting a multiDimArray using a Max operator.
template<typename GUM_ELEMENT>
GUM_ELEMENT projectMaxMultiDimArray (const MultiDimImplementation< GUM_ELEMENT > *table, Instantiation *instantiation=0)
 A specialized function for projecting a multiDimArray using a Max operator.
template<typename GUM_ELEMENT>
GUM_ELEMENT * projectMaxMultiDimArray4Pointers (const MultiDimArray< GUM_ELEMENT * > *table, Instantiation *instantiation=0)
 A specialized function for projecting a multiDimArray using a Max operator.
template<typename GUM_ELEMENT>
GUM_ELEMENT * projectMaxMultiDimArray4Pointers (const MultiDimImplementation< GUM_ELEMENT * > *table, Instantiation *instantiation=0)
 A specialized function for projecting a multiDimArray using a Max operator.
Project Min Operators
template<typename GUM_ELEMENT>
GUM_ELEMENT projectMinMultiDimArray (const MultiDimArray< GUM_ELEMENT > *table, Instantiation *instantiation=0)
 A specialized function for projecting a multiDimArray using a Min operator.
template<typename GUM_ELEMENT>
GUM_ELEMENT projectMinMultiDimArray (const MultiDimImplementation< GUM_ELEMENT > *table, Instantiation *instantiation=0)
 A specialized function for projecting a multiDimArray using a Min operator.
template<typename GUM_ELEMENT>
GUM_ELEMENT * projectMinMultiDimArray4Pointers (const MultiDimArray< GUM_ELEMENT * > *table, Instantiation *instantiation=0)
 A specialized function for projecting a multiDimArray using a Min operator.
template<typename GUM_ELEMENT>
GUM_ELEMENT * projectMinMultiDimArray4Pointers (const MultiDimImplementation< GUM_ELEMENT * > *table, Instantiation *instantiation=0)
 A specialized function for projecting a multiDimArray using a Min operator.
Project Sum Operators
template<typename GUM_ELEMENT>
GUM_ELEMENT projectSumMultiDimArray (const MultiDimArray< GUM_ELEMENT > *table, Instantiation *instantiation=0)
 a specialized function for projecting a multiDimArray using a Sum operator
template<typename GUM_ELEMENT>
GUM_ELEMENT projectSumMultiDimArray (const MultiDimImplementation< GUM_ELEMENT > *table, Instantiation *instantiation=0)
 a specialized function for projecting a multiDimArray using a Sum operator
template<typename GUM_ELEMENT>
GUM_ELEMENT * projectSumMultiDimArray4Pointers (const MultiDimArray< GUM_ELEMENT * > *table, Instantiation *instantiation=0)
 a specialized function for projecting a multiDimArray using a Sum operator
template<typename GUM_ELEMENT>
GUM_ELEMENT * projectSumMultiDimArray4Pointers (const MultiDimImplementation< GUM_ELEMENT * > *table, Instantiation *instantiation=0)
 a specialized function for projecting a multiDimArray using a Sum operator
Project Multiply Operators
template<typename GUM_ELEMENT>
GUM_ELEMENT projectProductMultiDimArray (const MultiDimArray< GUM_ELEMENT > *table, Instantiation *instantiation=0)
 a function for projecting a multiDimArray using a Product operator
template<typename GUM_ELEMENT>
GUM_ELEMENT projectProductMultiDimArray (const MultiDimImplementation< GUM_ELEMENT > *table, Instantiation *instantiation=0)
 a function for projecting a multiDimArray using a Product operator
template<typename GUM_ELEMENT>
GUM_ELEMENT * projectProductMultiDimArray4Pointers (const MultiDimArray< GUM_ELEMENT * > *table, Instantiation *instantiation=0)
 a function for projecting a multiDimArray using a Product operator
template<typename GUM_ELEMENT>
GUM_ELEMENT * projectProductMultiDimArray4Pointers (const MultiDimImplementation< GUM_ELEMENT * > *table, Instantiation *instantiation=0)
 a function for projecting a multiDimArray using a Product operator
Add MultiDims
template<typename T>
MultiDimArray< T > * add2MultiDimArrays (const MultiDimArray< T > *t1, const MultiDimArray< T > *t2)
 a specialized function for summing two multiDimArrays
template<typename T>
MultiDimImplementation< T > * add2MultiDimArrays (const MultiDimImplementation< T > *t1, const MultiDimImplementation< T > *t2)
 a specialized function for summing two multiDimArrays
template<typename T>
MultiDimArray< T * > * add2MultiDimArrays4Pointers (const MultiDimArray< T * > *t1, const MultiDimArray< T * > *t2)
 a specialized function for summing two multiDimArrays
template<typename T>
MultiDimImplementation< T * > * add2MultiDimArrays4Pointers (const MultiDimImplementation< T * > *t1, const MultiDimImplementation< T * > *t2)
 a specialized function for summing two multiDimArrays
template<typename T>
MultiDimFunctionGraph< T > * add2MultiDimFunctionGraphs (const MultiDimFunctionGraph< T > *t1, const MultiDimFunctionGraph< T > *t2)
 a specialized function for summing two multiDimArrays
template<typename T>
MultiDimImplementation< T > * add2MultiDimFunctionGraphs (const MultiDimImplementation< T > *t1, const MultiDimImplementation< T > *t2)
 a specialized function for summing two multiDimArrays
Substract MultiDims
template<typename T>
MultiDimArray< T > * subtract2MultiDimArrays (const MultiDimArray< T > *t1, const MultiDimArray< T > *t2)
 a specialized function for subtracting two multiDimArrays
template<typename T>
MultiDimImplementation< T > * subtract2MultiDimArrays (const MultiDimImplementation< T > *t1, const MultiDimImplementation< T > *t2)
 a specialized function for subtracting two multiDimArrays
template<typename T>
MultiDimArray< T * > * subtract2MultiDimArrays4Pointers (const MultiDimArray< T * > *t1, const MultiDimArray< T * > *t2)
 a specialized function for subtracting two multiDimArrays
template<typename T>
MultiDimImplementation< T * > * subtract2MultiDimArrays4Pointers (const MultiDimImplementation< T * > *t1, const MultiDimImplementation< T * > *t2)
 a specialized function for subtracting two multiDimArrays
template<typename T>
MultiDimFunctionGraph< T > * subtract2MultiDimFunctionGraphs (const MultiDimFunctionGraph< T > *t1, const MultiDimFunctionGraph< T > *t2)
 a specialized function for subtracting two multiDimArrays
template<typename T>
MultiDimImplementation< T > * subtract2MultiDimFunctionGraphs (const MultiDimImplementation< T > *t1, const MultiDimImplementation< T > *t2)
 a specialized function for subtracting two multiDimArrays
Multiply MultiDims
template<typename T>
MultiDimArray< T > * multiply2MultiDimArrays (const MultiDimArray< T > *t1, const MultiDimArray< T > *t2)
 a specialized function for multiplying two multiDimArrays
template<typename T>
MultiDimImplementation< T > * multiply2MultiDimArrays (const MultiDimImplementation< T > *t1, const MultiDimImplementation< T > *t2)
 a specialized function for multiplying two multiDimArrays
template<typename T>
MultiDimArray< T * > * multiply2MultiDimArrays4Pointers (const MultiDimArray< T * > *t1, const MultiDimArray< T * > *t2)
 a specialized function for multiplying two multiDimArrays
template<typename T>
MultiDimImplementation< T * > * multiply2MultiDimArrays4Pointers (const MultiDimImplementation< T * > *t1, const MultiDimImplementation< T * > *t2)
 a specialized function for multiplying two multiDimArrays
template<typename T>
MultiDimFunctionGraph< T > * multiply2MultiDimFunctionGraphs (const MultiDimFunctionGraph< T > *t1, const MultiDimFunctionGraph< T > *t2)
 a specialized function for multiplying two multiDimArrays
template<typename T>
MultiDimImplementation< T > * multiply2MultiDimFunctionGraphs (const MultiDimImplementation< T > *t1, const MultiDimImplementation< T > *t2)
 a specialized function for multiplying two multiDimArrays
Divide MultiDims
template<typename T>
MultiDimArray< T > * divide2MultiDimArrays (const MultiDimArray< T > *t1, const MultiDimArray< T > *t2)
 a specialized function for dividing two multiDimArrays
template<typename T>
MultiDimImplementation< T > * divide2MultiDimArrays (const MultiDimImplementation< T > *t1, const MultiDimImplementation< T > *t2)
 a specialized function for dividing two multiDimArrays
template<typename T>
MultiDimArray< T * > * divide2MultiDimArrays4Pointers (const MultiDimArray< T * > *t1, const MultiDimArray< T * > *t2)
 a specialized function for dividing two multiDimArrays
template<typename T>
MultiDimImplementation< T * > * divide2MultiDimArrays4Pointers (const MultiDimImplementation< T * > *t1, const MultiDimImplementation< T * > *t2)
 a specialized function for dividing two multiDimArrays
template<typename T>
MultiDimFunctionGraph< T > * divide2MultiDimFunctionGraphs (const MultiDimFunctionGraph< T > *t1, const MultiDimFunctionGraph< T > *t2)
 a specialized function for dividing two multiDimArrays
template<typename T>
MultiDimImplementation< T > * divide2MultiDimFunctionGraphs (const MultiDimImplementation< T > *t1, const MultiDimImplementation< T > *t2)
 a specialized function for dividing two multiDimArrays
Maximise MultiDims
template<typename T>
MultiDimFunctionGraph< T > * maximise2MultiDimFunctionGraphs (const MultiDimFunctionGraph< T > *t1, const MultiDimFunctionGraph< T > *t2)
 a specialized function for compare value from two multiDimFunctionGraphs and gets the maximal
template<typename T>
MultiDimImplementation< T > * maximise2MultiDimFunctionGraphs (const MultiDimImplementation< T > *t1, const MultiDimImplementation< T > *t2)
 a specialized function for compare value from two multiDimFunctionGraphs and gets the maximal
Operators over MultiDim
template<typename T>
MultiDimImplementation< T > * operator+ (const MultiDimImplementation< T > &, const MultiDimImplementation< T > &)
 The function to be used to add two MultiDimImplementations.
template<typename T>
MultiDimImplementation< T > * operator- (const MultiDimImplementation< T > &, const MultiDimImplementation< T > &)
 The function to be used to subtract two MultiDimImplementations.
template<typename T>
MultiDimImplementation< T > * operator* (const MultiDimImplementation< T > &, const MultiDimImplementation< T > &)
 The function to be used to multiply two MultiDimImplementations.
template<typename T>
MultiDimImplementation< T > * operator/ (const MultiDimImplementation< T > &, const MultiDimImplementation< T > &)
 The function to be used to divide two MultiDimImplementations.
Project Max for MultiDim
template<typename GUM_ELEMENT>
MultiDimArray< GUM_ELEMENT > * projectMaxMultiDimArray (const MultiDimArray< GUM_ELEMENT > *table, const gum::VariableSet &del_vars)
 a specialized function for projecting a multiDimArray using a Max operator
template<typename GUM_ELEMENT>
MultiDimImplementation< GUM_ELEMENT > * projectMaxMultiDimArray (const MultiDimImplementation< GUM_ELEMENT > *table, const gum::VariableSet &del_vars)
 a specialized function for projecting a multiDimArray using a Max operator
template<typename GUM_ELEMENT>
MultiDimArray< GUM_ELEMENT * > * projectMaxMultiDimArray4Pointers (const MultiDimArray< GUM_ELEMENT * > *table, const gum::VariableSet &del_vars)
 a specialized function for projecting a multiDimArray using a Max operator
template<typename GUM_ELEMENT>
MultiDimImplementation< GUM_ELEMENT * > * projectMaxMultiDimArray4Pointers (const MultiDimImplementation< GUM_ELEMENT * > *table, const gum::VariableSet &del_vars)
 a specialized function for projecting a multiDimArray using a Max operator
Project Min for MultiDim
template<typename GUM_ELEMENT>
MultiDimArray< GUM_ELEMENT > * projectMinMultiDimArray (const MultiDimArray< GUM_ELEMENT > *table, const gum::VariableSet &del_vars)
 a specialized function for projecting a multiDimArray using a Min operator
template<typename GUM_ELEMENT>
MultiDimImplementation< GUM_ELEMENT > * projectMinMultiDimArray (const MultiDimImplementation< GUM_ELEMENT > *table, const gum::VariableSet &del_vars)
 a specialized function for projecting a multiDimArray using a Min operator
template<typename GUM_ELEMENT>
MultiDimArray< GUM_ELEMENT * > * projectMinMultiDimArray4Pointers (const MultiDimArray< GUM_ELEMENT * > *table, const gum::VariableSet &del_vars)
 a specialized function for projecting a multiDimArray using a Min operator
template<typename GUM_ELEMENT>
MultiDimImplementation< GUM_ELEMENT * > * projectMinMultiDimArray4Pointers (const MultiDimImplementation< GUM_ELEMENT * > *table, const gum::VariableSet &del_vars)
 a specialized function for projecting a multiDimArray using a Min operator
Project Sum for MultiDim
template<typename GUM_ELEMENT>
MultiDimArray< GUM_ELEMENT > * projectSumMultiDimArray (const MultiDimArray< GUM_ELEMENT > *table, const gum::VariableSet &del_vars)
 a specialized function for projecting a multiDimArray using a summation
template<typename GUM_ELEMENT>
MultiDimImplementation< GUM_ELEMENT > * projectSumMultiDimArray (const MultiDimImplementation< GUM_ELEMENT > *table, const gum::VariableSet &del_vars)
 a specialized function for projecting a multiDimArray using a summation
template<typename GUM_ELEMENT>
MultiDimArray< GUM_ELEMENT * > * projectSumMultiDimArray4Pointers (const MultiDimArray< GUM_ELEMENT * > *table, const gum::VariableSet &del_vars)
 a specialized function for projecting a multiDimArray using a summation
template<typename GUM_ELEMENT>
MultiDimImplementation< GUM_ELEMENT * > * projectSumMultiDimArray4Pointers (const MultiDimImplementation< GUM_ELEMENT * > *table, const gum::VariableSet &del_vars)
 a specialized function for projecting a multiDimArray using a summation
Project Product for MultiDim
template<typename GUM_ELEMENT>
MultiDimArray< GUM_ELEMENT > * projectProductMultiDimArray (const MultiDimArray< GUM_ELEMENT > *table, const gum::VariableSet &del_vars)
 a specialized function for projecting a multiDimArray using products
template<typename GUM_ELEMENT>
MultiDimImplementation< GUM_ELEMENT > * projectProductMultiDimArray (const MultiDimImplementation< GUM_ELEMENT > *table, const gum::VariableSet &del_vars)
 a specialized function for projecting a multiDimArray using products
template<typename GUM_ELEMENT>
MultiDimArray< GUM_ELEMENT * > * projectProductMultiDimArray4Pointers (const MultiDimArray< GUM_ELEMENT * > *table, const gum::VariableSet &del_vars)
 a specialized function for projecting a multiDimArray using products
template<typename GUM_ELEMENT>
MultiDimImplementation< GUM_ELEMENT * > * projectProductMultiDimArray4Pointers (const MultiDimImplementation< GUM_ELEMENT * > *table, const gum::VariableSet &del_vars)
 a specialized function for projecting a multiDimArray using products
Project Function for MultiDim
template<typename GUM_ELEMENT>
MultiDimArray< GUM_ELEMENT > * ProjectFuncMultiDimArray (const MultiDimArray< GUM_ELEMENT > *t1, const MultiDimArray< GUM_ELEMENT > *t2, const GUM_ELEMENT(*f)(const GUM_ELEMENT &, const GUM_ELEMENT &))
 a specialized function for functionally projecting a multiDimArray
template<typename GUM_ELEMENT>
MultiDimImplementation< GUM_ELEMENT > * combine2MultiDimArrays (const MultiDimImplementation< GUM_ELEMENT > *t1, const MultiDimImplementation< GUM_ELEMENT > *t2, const GUM_ELEMENT(*f)(const GUM_ELEMENT &, const GUM_ELEMENT &))
 a specialized function for functionally projecting a multiDimArray
Projectors For Function Graphs
template<typename GUM_ELEMENT>
MultiDimFunctionGraph< GUM_ELEMENT > * projectMaxMultiDimFunctionGraph (const MultiDimFunctionGraph< GUM_ELEMENT > *table, const gum::VariableSet &del_vars)
 a specialized function for projecting a multiDimFunctionGraph using a Max operator
template<typename GUM_ELEMENT>
MultiDimImplementation< GUM_ELEMENT > * projectMaxMultiDimFunctionGraph (const MultiDimImplementation< GUM_ELEMENT > *table, const gum::VariableSet &del_vars)
 a specialized function for projecting a multiDimFunctionGraph using a Max operator
template<typename GUM_ELEMENT>
MultiDimFunctionGraph< GUM_ELEMENT > * projectMinMultiDimFunctionGraph (const MultiDimFunctionGraph< GUM_ELEMENT > *table, const gum::VariableSet &del_vars)
 a specialized function for projecting a multiDimFunctionGraph using a Min operator
template<typename GUM_ELEMENT>
MultiDimImplementation< GUM_ELEMENT > * projectMinMultiDimFunctionGraph (const MultiDimImplementation< GUM_ELEMENT > *table, const gum::VariableSet &del_vars)
 a specialized function for projecting a multiDimFunctionGraph using a Min operator
template<typename GUM_ELEMENT>
MultiDimFunctionGraph< GUM_ELEMENT > * projectSumMultiDimFunctionGraph (const MultiDimFunctionGraph< GUM_ELEMENT > *table, const gum::VariableSet &del_vars)
 a specialized function for projecting a multiDimFunctionGraph using a summation
template<typename GUM_ELEMENT>
MultiDimImplementation< GUM_ELEMENT > * projectSumMultiDimFunctionGraph (const MultiDimImplementation< GUM_ELEMENT > *table, const gum::VariableSet &del_vars)
 a specialized function for projecting a multiDimFunctionGraph using a summation
template<typename GUM_ELEMENT>
MultiDimFunctionGraph< GUM_ELEMENT > * projectProductMultiDimFunctionGraph (const MultiDimFunctionGraph< GUM_ELEMENT > *table, const gum::VariableSet &del_vars)
 a specialized function for projecting a multiDimFunctionGraph using products
template<typename GUM_ELEMENT>
MultiDimImplementation< GUM_ELEMENT > * projectProductMultiDimFunctionGraph (const MultiDimImplementation< GUM_ELEMENT > *table, const gum::VariableSet &del_vars)
 a specialized function for projecting a multiDimFunctionGraph using products

Variables

const double VariableLog2ParamComplexityCTable [4][1000]
constexpr std::size_t VariableLog2ParamComplexityCTableRSize {std::size_t(4)}
constexpr std::size_t VariableLog2ParamComplexityCTableNSize {std::size_t(1000)}
template class GUM_SHARED_PUBLIC HashFunc< Set< unsigned long > >
template class GUM_SHARED_PUBLIC MultiDimICIModel< double >
template class GUM_SHARED_PUBLIC MultiDimNoisyORCompound< double >
template class GUM_SHARED_PUBLIC MultiDimNoisyORNet< double >
template class GUM_SHARED_PUBLIC MultiDimArray< double >
template class GUM_SHARED_PUBLIC MultiDimBijArray< double >
template class GUM_SHARED_PUBLIC MultiDimBucket< double >
template<>
const float MultiDimFunctionGraph< float >::defaultValue = 0.0f
template<>
const double MultiDimFunctionGraph< double >::defaultValue = 0.0
template class GUM_SHARED_PUBLIC MultiDimImplementation< double >
template class GUM_SHARED_PUBLIC MultiDimSparse< double >
template class GUM_SHARED_PUBLIC MultiDimWithOffset< double >
template class GUM_SHARED_PUBLIC Tensor< double >
template class GUM_SHARED_PUBLIC Link< Idx >
template class GUM_SHARED_PUBLIC DiscretizedVariable< double >
template class GUM_PUBLIC_BN BNdistance< double >
template class GUM_PUBLIC_BN ExactBNdistance< double >
template class GUM_PUBLIC_BN GibbsBNdistance< double >
template class GUM_PUBLIC_BN MCBNDistance< double >
template class GUM_PUBLIC_BN BayesNet< double >
template class GUM_PUBLIC_BN BayesNetFactory< double >
template class GUM_PUBLIC_BN BayesNetFragment< double >
template class GUM_PUBLIC_BN SimpleCPTGenerator< double >
template class GUM_PUBLIC_BN IBayesNet< double >
template class GUM_PUBLIC_BN GibbsSampling< double >
template class GUM_PUBLIC_BN ImportanceSampling< double >
template class GUM_PUBLIC_BN LazyPropagation< double >
template class GUM_PUBLIC_BN LoopySamplingInference< float, WeightedSampling >
template class GUM_PUBLIC_BN LoopySamplingInference< double, WeightedSampling >
template class GUM_PUBLIC_BN LoopySamplingInference< float, ImportanceSampling >
template class GUM_PUBLIC_BN LoopySamplingInference< double, ImportanceSampling >
template class GUM_PUBLIC_BN LoopySamplingInference< float, MonteCarloSampling >
template class GUM_PUBLIC_BN LoopySamplingInference< double, MonteCarloSampling >
template class GUM_PUBLIC_BN LoopySamplingInference< float, GibbsSampling >
template class GUM_PUBLIC_BN LoopySamplingInference< double, GibbsSampling >
template class GUM_PUBLIC_BN MonteCarloSampling< double >
template class GUM_PUBLIC_BN ShaferShenoyInference< double >
template class GUM_PUBLIC_BN GibbsOperator< double >
template class GUM_PUBLIC_BN SamplingInference< double >
template class GUM_PUBLIC_BN VariableElimination< double >
template class GUM_PUBLIC_BN WeightedSampling< double >
template class GUM_PUBLIC_BN BIFReader< double >
template class GUM_PUBLIC_BN BIFWriter< double >
template class GUM_PUBLIC_BN BIFXMLBNReader< double >
template class GUM_PUBLIC_BN BIFXMLBNWriter< double >
template class GUM_PUBLIC_BN BNReader< double >
template class GUM_PUBLIC_BN BNWriter< double >
template class GUM_PUBLIC_BN DSLReader< double >
template class GUM_PUBLIC_BN GumBNReader< double >
template class GUM_PUBLIC_BN GumBNWriter< double >
template class GUM_PUBLIC_BN NetReader< double >
template class GUM_PUBLIC_BN NetWriter< double >
template class GUM_PUBLIC_BN UAIBNReader< double >
template class GUM_PUBLIC_BN UAIBNWriter< double >
template class GUM_PUBLIC_BN XDSLBNReader< double >
template class GUM_PUBLIC_BN XDSLBNWriter< double >
template class GUM_PUBLIC_CM CausalImpact< double >
template class GUM_PUBLIC_CM CausalModel< double >
template class GUM_PUBLIC_CM Counterfactual< double >
template class GUM_PUBLIC_ID GumIDReader< double >
template class GUM_PUBLIC_ID GumIDWriter< double >
template class GUM_PUBLIC_KTBN KTBNGenerator< double >
template class GUM_PUBLIC_KTBN KTBNInference< double >
template class GUM_PUBLIC_KTBN KTBN< double >
template class GUM_PUBLIC_MRF IMarkovRandomField< double >
template class GUM_PUBLIC_MRF ShaferShenoyMRFInference< double >
template class GUM_PUBLIC_MRF GumMRFReader< double >
template class GUM_PUBLIC_MRF GumMRFWriter< double >
template class GUM_PUBLIC_MRF MRFReader< double >
template class GUM_PUBLIC_MRF MRFWriter< double >
template class GUM_PUBLIC_MRF UAIMRFReader< double >
template class GUM_PUBLIC_MRF UAIMRFWriter< double >
template class GUM_PUBLIC_PRM O3prmBNWriter< double >
template<typename T1, typename T2>
using forbidden_type = typename std::enable_if< !std::is_same< T1, T2 >::value, int >::type
 Forbidden_type<T1,T2> return the "int" type if T1 and T2 are of the same type, else nothing.
double almostDifferentEpsilon ()
 The tolerance of AlmostDifferent : the key core.epsilonStandard of the configuration.
bool Memcmp (const void *const in_, const void *const out_, unsigned long size)
 Cross-platform replacement for memcmp.
void _atexit_ ()
 Used for debug purpose.
using EdgeSet = Set< Edge >
 Some typdefs and define for shortcuts ...
using NodeSet = Set< NodeId >
 Some typdefs and define for shortcuts ...
using ArcSet = Set< Arc >
 Some typdefs and define for shortcuts ...
using ArcSetIterator = ArcSet::const_iterator
 Some typdefs and define for shortcuts ...
using EdgeSetIterator = EdgeSet::const_iterator
 Some typdefs and define for shortcuts ...
using NodeSetIterator = NodeSet::const_iterator
 Some typdefs and define for shortcuts ...
const NodeSet emptyNodeSet
 Some typdefs and define for shortcuts ...

Detailed Description

gum is the global namespace for all aGrUM entities

c++11 stuff, like declval ( decltype from prototype without a default constructor )

include the inlined functions if necessary

the function to be used to partially instantiate a MultiDimDecorator

class for LOGIT implementation as multiDim

Author
Pierre-Henri WUILLEMIN(_at_LIP6) & Christophe GONZALES(_at_AMU)
Todo
virtual for all functions that MAY be one day redefined in any derived class

Typedef Documentation

◆ FactorTable

template<GUM_Numeric GUM_SCALAR>
using gum::FactorTable = HashTable< NodeSet, const Tensor< GUM_SCALAR >* >

Definition at line 66 of file IMarkovRandomField.h.

◆ HybridGibbsSampling

template<GUM_Numeric GUM_SCALAR>
using gum::HybridGibbsSampling = LoopySamplingInference< GUM_SCALAR, GibbsSampling >

Definition at line 120 of file loopySamplingInference.h.

◆ HybridImportanceSampling

template<GUM_Numeric GUM_SCALAR>
using gum::HybridImportanceSampling = LoopySamplingInference< GUM_SCALAR, ImportanceSampling >

Definition at line 118 of file loopySamplingInference.h.

◆ HybridMonteCarloSampling

template<GUM_Numeric GUM_SCALAR>
using gum::HybridMonteCarloSampling = LoopySamplingInference< GUM_SCALAR, MonteCarloSampling >

Definition at line 114 of file loopySamplingInference.h.

◆ HybridWeightedSampling

template<GUM_Numeric GUM_SCALAR>
using gum::HybridWeightedSampling = LoopySamplingInference< GUM_SCALAR, WeightedSampling >

Definition at line 116 of file loopySamplingInference.h.

◆ JoinTree

a join tree is a clique graph satisfying the running intersection property (but some cliques may be included into others)

Definition at line 357 of file cliqueGraph.h.

◆ JunctionTree

a junction tree is a clique graph satisfying the running intersection property and such that no clique is included into another one.

Definition at line 353 of file cliqueGraph.h.

◆ LatentDescriptorIds

using gum::LatentDescriptorIds = std::pair< std::string, std::vector< NodeId > >

LatentDescriptorIds = (latentName, (child1Id, child2Id, ...)).

Compact descriptor for a single latent variable and its observed children.

The first element is the name of the latent to create; the second element is the list of **NodeId**s of observed children the latent points to in the causal DAG.

Definition at line 68 of file causalModel.h.

◆ LatentDescriptorVector

Collection of latent descriptors (see LatentDescriptorIds).

Definition at line 71 of file causalModel.h.

◆ pair_iterator

Definition at line 70 of file fusionContext.h.

◆ Signaler0

Signaler with no arguments.

This is an alias for Signaler<> (empty parameter pack). The callback signature is void handler(const void* src).

Definition at line 273 of file signaler.h.

◆ ThreadExecutor

◆ VariableSet

Definition at line 192 of file discreteVariable.h.

Enumeration Type Documentation

◆ BinTreeDir

enum class gum::BinTreeDir : char
strong

The direction of a given edge in a binary tree.

Enumerator
LEFT_CHILD 
RIGHT_CHILD 
NO_PARENT 

Definition at line 56 of file binTreeNode.h.

◆ Complexity

enum class gum::Complexity : char
strong

Complexity allows to characterize the awaited difficulty for an algorithm given a specific instance Therefore this is not a theoretical characterization but rather a pragmatic rate of that very instance.

Enumerator
Heavy 
Difficult 
Correct 

Definition at line 64 of file BNdistance.h.

◆ EdgeMark

enum class gum::EdgeMark : uint8_t
strong

Endpoint marks used in PAG edges.

Convention: marks_[Arc(x,y)] stores the mark at the y-endpoint when traversing from x. For edge x-y:

  • x→y : marks_[Arc(x,y)] = Arrowhead, marks_[Arc(y,x)] = Tail
  • x↔y : both = Arrowhead
  • xo-oy : both = Circle
Enumerator
Circle 
Tail 
Arrowhead 

Definition at line 69 of file PAG.h.

69: uint8_t { Circle = 0, Tail = 1, Arrowhead = 2 };
@ Arrowhead
Definition PAG.h:69

◆ FactorySimulationAction

Enumerator
GoNorth 
GoEast 
GoSouth 
GoWest 
PickUp 
PutDown 
FillUp 

Definition at line 80 of file factorySimulator.h.

80 : Idx {
81 GoNorth = 0,
82 GoEast = 1,
83 GoSouth = 2,
84 GoWest = 3,
85 PickUp = 4,
86 PutDown = 5,
87 FillUp = 6
88 };
Size Idx
Type for indexes.
Definition types.h:79

◆ FactorySimulationLandmark

Enumerator
HOME 
WORK 
THEATER 
CLUB 
Factory 

Definition at line 62 of file factorySimulator.h.

62: Idx { HOME = 0, WORK = 1, THEATER = 2, CLUB = 3, Factory = 4 };

◆ FactorySimulationLandmarkX

Enumerator
HOMEX 
WORKX 
THEATERX 
CLUBX 
STATIONX 

Definition at line 64 of file factorySimulator.h.

64 : Idx {
65 HOMEX = 0,
66 WORKX = 0,
67 THEATERX = 3,
68 CLUBX = 4,
69 STATIONX = 2
70 };

◆ FactorySimulationLandmarkY

Enumerator
HOMEY 
WORKY 
THEATERY 
CLUBY 
STATIONY 

Definition at line 72 of file factorySimulator.h.

72 : Idx {
73 HOMEY = 0,
74 WORKY = 4,
75 THEATERY = 0,
76 CLUBY = 4,
77 STATIONY = 1
78 };

◆ FindBarrenNodesType

enum class gum::FindBarrenNodesType
strong

type of algorithm to determine barren nodes

When constructing messages from one clique to its neighbor, we can determine that some nodes are barren, i.e., they are the only one at the left hand side of a conditioning bar and they appear in only one tensor. In such case, in a classical BN inference, there is no need to take them into account since their removal will necessarily create a constant tensor. So, we can discard their tensor from the computation. However, when computing p(evidence), we should not do that because the constant is important and need be computed.

Enumerator
FIND_NO_BARREN_NODES 
FIND_BARREN_NODES 

Definition at line 73 of file BayesNetInference.h.

73 {
74 FIND_NO_BARREN_NODES, // do not try to find barren nodes
75 FIND_BARREN_NODES // use a bottom-up algorithm to detect barren nodes
76 };

◆ FMDPfactory_state

enum class gum::FMDPfactory_state : char
strong

The enumeration of states in which the factory can be in.

Every documentation section's name indicates from which state you can call it's methods, and in which state it places the factory.

There is an exception for the delegated CPT definition methods which do not changes the state of the factory.

Enumerator
NONE 
VARIABLE 
ACTION 
TRANSITION 
COST 
REWARD 
DISCOUNT 

Definition at line 71 of file IfmdpFactory.h.

◆ LEARNERNAME

Enumerator
IMDDILEARNER 
ITILEARNER 

Definition at line 87 of file templateStrategy.h.

87{ IMDDILEARNER = 1, ITILEARNER = 2 };

◆ RelevantTensorsFinderType

enum class gum::RelevantTensorsFinderType
strong

type of algorithm for determining the relevant tensors for combinations using some d-separation analysis

When constructing messages from one clique to its neighbor, we can exploit d-separation to determine that some tensors are irrelevant for the message computation. So we can discard them and, thereby, speed-up the computations.

Enumerator
FIND_ALL 
DSEP_BAYESBALL_NODES 
DSEP_BAYESBALL_TENSORS 
DSEP_KOLLER_FRIEDMAN_2009 

Definition at line 63 of file relevantTensorsFinderType.h.

63 {
64 FIND_ALL, // do not perform d-separation analysis
65 DSEP_BAYESBALL_NODES, // BayesBall requisite nodes -> tensors
66 DSEP_BAYESBALL_TENSORS, // BayesBall requisite tensors (directly)
67 DSEP_KOLLER_FRIEDMAN_2009 // Koller & Friedman 2009 requisite tensors
68 };

◆ ScheduleOperatorType

enum class gum::ScheduleOperatorType : char
strong

the currently supported types of "low-level" operators

the types of "low-level" operators used for scheduling inferences

Enumerator
COMBINE_MULTIDIM 

combine 2 ScheduleMultiDims

PROJECT_MULTIDIM 

project a ScheduleMultiDim over a subset of its variables

DELETE_MULTIDIM 

remove from memory a multidimensional table stored in a ScheduleMultiDim

STORE_MULTIDIM 

store a multidimensional table outside of the scheduler

Definition at line 67 of file scheduleOperator.h.

67 : char {
76 };
@ STORE_MULTIDIM
store a multidimensional table outside of the scheduler
@ PROJECT_MULTIDIM
project a ScheduleMultiDim over a subset of its variables
@ DELETE_MULTIDIM
remove from memory a multidimensional table stored in a ScheduleMultiDim
@ COMBINE_MULTIDIM
combine 2 ScheduleMultiDims

◆ SchedulerType

the type of scheduler that can be used

Enumerator
SEQUENTIAL 
PARALLEL_OPERATORS 

Definition at line 61 of file scheduler.h.

61 {
62 SEQUENTIAL, // fully sequential scheduler
63 PARALLEL_OPERATORS // combinations and projections are dispatched among threads
64 };
@ PARALLEL_OPERATORS
Definition scheduler.h:63
@ SEQUENTIAL
Definition scheduler.h:62

◆ StaticInitializer

enum class gum::StaticInitializer : char
strong
Enumerator
CONSTINIT 
CONSTEXPR 

Definition at line 68 of file staticInitializer.h.

◆ TaxiSimulationAction

Enumerator
GoNorth 
GoEast 
GoSouth 
GoWest 
PickUp 
PutDown 
FillUp 

Definition at line 81 of file taxiSimulator.h.

81 : Idx {
82 GoNorth = 1,
83 GoEast = 2,
84 GoSouth = 3,
85 GoWest = 4,
86 PickUp = 5,
87 PutDown = 6,
88 FillUp = 7
89 };

◆ TaxiSimulationLandmark

Enumerator
HOME 
WORK 
THEATER 
CLUB 
TAXI 

Definition at line 63 of file taxiSimulator.h.

63: Idx { HOME = 0, WORK = 1, THEATER = 2, CLUB = 3, TAXI = 4 };

◆ TaxiSimulationLandmarkX

Enumerator
HOMEX 
WORKX 
THEATERX 
CLUBX 
STATIONX 

Definition at line 65 of file taxiSimulator.h.

65 : Idx {
66 HOMEX = 0,
67 WORKX = 0,
68 THEATERX = 3,
69 CLUBX = 4,
70 STATIONX = 2
71 };

◆ TaxiSimulationLandmarkY

Enumerator
HOMEY 
WORKY 
THEATERY 
CLUBY 
STATIONY 

Definition at line 73 of file taxiSimulator.h.

73 : Idx {
74 HOMEY = 0,
75 WORKY = 4,
76 THEATERY = 0,
77 CLUBY = 4,
78 STATIONY = 1
79 };

◆ TESTNAME

Enumerator
GTEST 
CHI2TEST 
LEASTSQUARETEST 

Definition at line 60 of file templateStrategy.h.

60{ GTEST = 1, CHI2TEST = 2, LEASTSQUARETEST = 3 };
@ LEASTSQUARETEST

◆ VarType

enum class gum::VarType : char
strong
Enumerator
DISCRETIZED 
LABELIZED 
INTEGER 
NUMERICAL 
RANGE 
CONTINUOUS 

Definition at line 62 of file variable.h.

Function Documentation

◆ _dsepExplanation_()

std::string gum::_dsepExplanation_ ( const Set< std::string > & on,
const Set< std::string > & doing,
const Set< std::string > & knowing )
inline

Definition at line 70 of file causalImpact_tpl.h.

72 {
73 std::string os = std::format("No causal effect of {} on {} because they are d-separated "
74 "after removing incoming edges into {}",
78 if (!knowing.empty()) {
79 os += std::format(" and conditioning on {}", _formatVarsForSentence_(knowing));
80 }
81 os += ".";
82 return os;
83 }
bool empty() const noexcept
Indicates whether the set is the empty set.
Definition set_tpl.h:613
std::string _formatVarsForSentence_(const Set< std::string > &vars)

References _dsepExplanation_(), _formatVarsForSentence_(), and gum::Set< Key >::empty().

Referenced by _dsepExplanation_().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _formatNodeSetNames_()

template<GUM_Numeric GUM_SCALAR>
std::string gum::_formatNodeSetNames_ ( const CausalModel< GUM_SCALAR > & cm,
const NodeSet & zset )

Definition at line 96 of file causalImpact_tpl.h.

96 {
97 std::vector< std::string > names;
98 for (auto id: zset) {
99 names.push_back(cm.nameFromId(id));
100 }
101 std::ranges::sort(names);
102 std::string out = "[";
103 for (size_t i = 0; i < names.size(); ++i) {
104 if (i > 0) out += ", ";
105 out += "'" + names[i] + "'";
106 }
107 out += "]";
108 return out;
109 }
std::string nameFromId(NodeId id) const
Variable name from node id (observed or latent).

References _formatNodeSetNames_().

Referenced by gum::CausalImpact< GUM_ELEMENT >::_buildFromIds_(), and _formatNodeSetNames_().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _formatVarsForSentence_()

std::string gum::_formatVarsForSentence_ ( const Set< std::string > & vars)
inline

Definition at line 51 of file causalImpact_tpl.h.

51 {
52 std::vector< std::string > names;
53 for (const auto& v: vars) {
54 names.push_back(v);
55 }
56 std::ranges::sort(names);
57
58 if (names.empty()) { return ""; }
59 if (names.size() == 1) { return names[0]; }
60 if (names.size() == 2) { return names[0] + " and " + names[1]; }
61
62 std::string os;
63 for (size_t i = 0; i < names.size(); ++i) {
64 if (i > 0) { os += (i + 1 == names.size() ? ", and " : ", "); }
65 os += names[i];
66 }
67 return os;
68 }

References _formatVarsForSentence_().

Referenced by _dsepExplanation_(), and _formatVarsForSentence_().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _initTensorOperators__()

template<typename GUM_ELEMENT>
void gum::_initTensorOperators__ ( )

Definition at line 63 of file multiDimDecorator_tpl.h.

63 {
64 // ensure that only one thread will register the projections
65 static std::once_flag first;
66 std::call_once(first, []() {
67 // register the operators that will be used by the decorator
69 op.init();
70
71 // register the projectors that will be used by the decorator
73 proj.init();
74
75 // register the projectors that will be used by the decorator
77 comp_proj.init();
78
79 // register the partial instantiators that will be used by the decorator
81 inst.init();
82 });
83 }
a class used to register complete projections over non-pointers types
a class used to register operators over non-pointers types
A class used to register instantiation functions over non-pointers types.
void init()
Initialize the partial instantiation functions.
a class used to register projections over non-pointers types

References _initTensorOperators__(), gum::CompleteProjections4MultiDimInitialize< GUM_ELEMENT >::init(), gum::Operators4MultiDimInitialize< GUM_ELEMENT >::init(), gum::PartialInstantiation4MultiDimInitialize< GUM_ELEMENT >::init(), and gum::Projections4MultiDimInitialize< GUM_ELEMENT >::init().

Referenced by gum::MultiDimDecorator< GUM_ELEMENT >::MultiDimDecorator(), gum::MultiDimDecorator< GUM_ELEMENT >::MultiDimDecorator(), _initTensorOperators__(), and gum::MultiDimDecorator< GUM_SCALAR >::variablesSequence().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _readVector_()

INLINE std::vector< uint8_t > gum::_readVector_ ( std::istream & is)

Reads a length-prefixed byte vector from a binary stream (bgum format).

The first 8 bytes encode the payload length as a little-endian uint64_t, followed by that many payload bytes.

Parameters
isThe input binary stream.
Returns
The payload bytes.

Definition at line 50 of file GumBinaryIO_inl.h.

50 {
51 uint64_t size = 0;
52 is.read(reinterpret_cast< char* >(&size), sizeof(size));
53 if (!is) throw std::runtime_error("GumBinaryIO: failed to read vector size");
54 constexpr uint64_t kMaxVecSize = uint64_t(256) << 20;
55 if (size > kMaxVecSize)
56 throw std::runtime_error("GumBinaryIO: vector size exceeds 256 MB limit");
57 std::vector< uint8_t > vec(size);
58 is.read(reinterpret_cast< char* >(vec.data()), static_cast< std::streamsize >(size));
59 if (!is) throw std::runtime_error("GumBinaryIO: failed to read vector data");
60 return vec;
61 }

References _readVector_().

Referenced by _readVector_().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _removeIncomingIntoLocal_()

DAG gum::_removeIncomingIntoLocal_ ( const DAG & g,
const NodeSet & xset )
inline

Definition at line 85 of file causalImpact_tpl.h.

85 {
86 DAG out(g);
87 for (const auto x: xset) {
88 const auto parents = out.parents(x);
89 for (const auto p: parents)
90 out.eraseArc(Arc(p, x));
91 }
92 return out;
93 }
Arc(NodeId tail, NodeId head)
basic constructor. Creates tail -> head.
Base class for dag.
Definition DAG.h:121

References _removeIncomingIntoLocal_().

Referenced by _removeIncomingIntoLocal_().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _writeVector_()

INLINE void gum::_writeVector_ ( std::ostream & os,
const std::vector< uint8_t > & vec )

Writes a length-prefixed byte vector to a binary stream (bgum format).

Parameters
osThe output binary stream.
vecThe payload bytes to write.

Definition at line 63 of file GumBinaryIO_inl.h.

63 {
64 uint64_t size = vec.size();
65 os.write(reinterpret_cast< const char* >(&size), sizeof(size));
66 os.write(reinterpret_cast< const char* >(vec.data()), size);
67 }

References _writeVector_().

Referenced by _writeVector_().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ abs()

template<GUM_Numeric GUM_SCALAR>
Tensor< GUM_SCALAR > gum::abs ( const Tensor< GUM_SCALAR > & arg)
inline

References abs().

Referenced by abs().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ build_node()

template<GUM_Numeric GUM_SCALAR>
NodeId gum::build_node ( gum::BayesNet< GUM_SCALAR > & bn,
std::string_view node,
std::string_view default_domain )

Definition at line 79 of file BayesNet_tpl.h.

81 {
82 auto v = fastVariable< GUM_SCALAR >(std::string{node}, std::string(default_domain));
83
84 NodeId res;
85 if (bn.exists(v->name())) res = bn.idFromName(v->name());
86 else res = bn.add(*v);
87 return res;
88 }
NodeId idFromName(std::string_view name) const override
Returns the NodeId of a variable given its name.
NodeId add(const DiscreteVariable &var)
Add a variable to the gum::BayesNet.
bool exists(NodeId node) const final
Return true if this node exists in this graphical model.
std::unique_ptr< DiscreteVariable > fastVariable(std::string var_description, Size default_domain_size)
Create a pointer on a Discrete Variable from a "fast" syntax.

References gum::BayesNet< GUM_SCALAR >::add(), build_node(), gum::DAGmodel::exists(), fastVariable(), and gum::BayesNet< GUM_SCALAR >::idFromName().

Referenced by build_node(), and gum::BayesNet< GUM_SCALAR >::fastPrototype().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ build_node_for_ID()

template<GUM_Numeric GUM_SCALAR>
NodeId gum::build_node_for_ID ( gum::InfluenceDiagram< GUM_SCALAR > & infdiag,
std::string node,
std::string_view domain )

Definition at line 65 of file influenceDiagram_tpl.h.

67 {
68 bool isUtil = false;
69 bool isDeci = false;
70 bool isChanc = false;
71 std::string ds(domain);
72 switch (*(node.begin())) {
73 case '*' :
74 isDeci = true;
75 node.erase(0, 1);
76 break;
77 case '$' :
78 isUtil = true;
79 ds = "[1]";
80 node.erase(0, 1);
81 break;
82 default : isChanc = true;
83 }
84 auto v = fastVariable< GUM_SCALAR >(node, ds);
85
86 NodeId res;
87 if (infdiag.exists(v->name())) {
88 res = infdiag.idFromName(v->name());
89 } else {
90 if (isChanc) res = infdiag.addChanceNode(*v);
91 else if (isDeci) res = infdiag.addDecisionNode(*v);
92 else if (isUtil) res = infdiag.addUtilityNode(*v);
93 else
94 GUM_ERROR(FatalError,
95 "No type (chance, decision or utility) for the node '" << node << "'.")
96 }
97
98 return res;
99 }
NodeId idFromName(std::string_view name) const override
Returns the NodeId of a variable given its name.
NodeId addChanceNode(const DiscreteVariable &variable, NodeId id=0)
Add a chance variable, it's associate node and it's CPT.
NodeId addUtilityNode(const DiscreteVariable &variable, NodeId id=0)
Add a utility variable, it's associate node and it's UT.
NodeId addDecisionNode(const DiscreteVariable &variable, NodeId id=0)
Add a decision variable.
#define GUM_ERROR(type, msg)
Definition exceptions.h:76

References gum::InfluenceDiagram< GUM_SCALAR >::addChanceNode(), gum::InfluenceDiagram< GUM_SCALAR >::addDecisionNode(), gum::InfluenceDiagram< GUM_SCALAR >::addUtilityNode(), build_node_for_ID(), gum::DAGmodel::exists(), fastVariable(), GUM_ERROR, and gum::InfluenceDiagram< GUM_SCALAR >::idFromName().

Referenced by build_node_for_ID(), and gum::InfluenceDiagram< GUM_SCALAR >::fastPrototype().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ build_node_for_MN()

template<GUM_Numeric GUM_SCALAR>
NodeId gum::build_node_for_MN ( MarkovRandomField< GUM_SCALAR > & mn,
std::string_view node,
std::string_view default_domain )

Definition at line 76 of file MarkovRandomField_tpl.h.

78 {
79 auto v = fastVariable< GUM_SCALAR >(std::string{node}, default_domain);
80
81 NodeId res;
82 if (mn.exists(v->name())) res = mn.idFromName(v->name());
83 else res = mn.add(*v);
84 return res;
85 }

References build_node_for_MN(), and fastVariable().

Referenced by build_node_for_MN().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ causalImpact() [1/2]

template<GUM_Numeric GUM_SCALAR>
std::tuple< CausalImpact< GUM_SCALAR >, Tensor< GUM_SCALAR >, std::string > gum::causalImpact ( const CausalModel< GUM_SCALAR > & cm,
const Set< std::string > & on,
const Set< std::string > & doing,
const Set< std::string > & knowing = Set< std::string >(),
const HashTable< std::string, std::string > & values = HashTable< std::string, std::string >() )

Standalone helper that mirrors the Python function causalImpact(...).

Returns: (symbolic CausalFormula, numeric Tensor, explanation string). If not identifiable, the formula carries a null AST and the tensor is empty.

Definition at line 324 of file causalImpact_tpl.h.

328 {
329 // Delegate to the dedicated class.
330 CausalImpact< GUM_SCALAR > ci(cm, on, doing, knowing);
331
332 // Numeric value: empty tensor if not identifiable
333 Tensor< GUM_SCALAR > numeric;
334 if (ci.isIdentified()) { numeric = ci.eval(); }
335
336 // If specific values were provided, strictly slice the tensor to those values
337 if (!values.empty() && numeric.nbrDim() > 0) {
338 const auto I
339 = makeInstantiationFromValues(numeric, values); // throws if any key/label is invalid
340 numeric = numeric.extract(I); // keep only remaining free dimensions (if any)
341 }
342
343 // Always return the explanation the class computed
344 // Capture before moving ci: explanation() returns a const ref into ci internals
345 std::string expl = ci.explanation();
346 return std::make_tuple(std::move(ci), std::move(numeric), std::move(expl));
347 }
Builds a CausalFormula for a query (d-sep -> backdoor -> frontdoor -> (optional) do-calculus).
bool empty() const noexcept
Indicates whether the hash table is empty.
Instantiation makeInstantiationFromValues(const Tensor< GUM_SCALAR > &tensor, const HashTable< std::string, std::string > &values)
Creates an instance for a tensor based on a HashTable.

References causalImpact(), gum::HashTable< Key, Val >::empty(), gum::CausalImpact< GUM_SCALAR >::eval(), gum::CausalImpact< GUM_SCALAR >::explanation(), gum::CausalImpact< GUM_SCALAR >::isIdentified(), and makeInstantiationFromValues().

Referenced by causalImpact().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ causalImpact() [2/2]

template<GUM_Numeric GUM_SCALAR>
PYGUM_PUBLIC std::tuple< CausalImpact< GUM_SCALAR >, Tensor< GUM_SCALAR >, std::string > gum::causalImpact ( const CausalModel< GUM_SCALAR > & cm,
const Set< std::string > & on,
const Set< std::string > & doing,
const Set< std::string > & knowing = Set< std::string >(),
const HashTable< std::string, std::string > & values = HashTable< std::string, std::string >() )

Standalone helper that mirrors the Python function causalImpact(...).

Returns: (symbolic CausalFormula, numeric Tensor, explanation string). If not identifiable, the formula carries a null AST and the tensor is empty.

Definition at line 324 of file causalImpact_tpl.h.

328 {
329 // Delegate to the dedicated class.
330 CausalImpact< GUM_SCALAR > ci(cm, on, doing, knowing);
331
332 // Numeric value: empty tensor if not identifiable
333 Tensor< GUM_SCALAR > numeric;
334 if (ci.isIdentified()) { numeric = ci.eval(); }
335
336 // If specific values were provided, strictly slice the tensor to those values
337 if (!values.empty() && numeric.nbrDim() > 0) {
338 const auto I
339 = makeInstantiationFromValues(numeric, values); // throws if any key/label is invalid
340 numeric = numeric.extract(I); // keep only remaining free dimensions (if any)
341 }
342
343 // Always return the explanation the class computed
344 // Capture before moving ci: explanation() returns a const ref into ci internals
345 std::string expl = ci.explanation();
346 return std::make_tuple(std::move(ci), std::move(numeric), std::move(expl));
347 }

References causalImpact(), gum::HashTable< Key, Val >::empty(), gum::CausalImpact< GUM_SCALAR >::eval(), gum::CausalImpact< GUM_SCALAR >::explanation(), gum::CausalImpact< GUM_SCALAR >::isIdentified(), and makeInstantiationFromValues().

Referenced by causalImpact().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ combine2MultiDimArrays()

template<typename GUM_ELEMENT>
MultiDimImplementation< GUM_ELEMENT > * gum::combine2MultiDimArrays ( const MultiDimImplementation< GUM_ELEMENT > * t1,
const MultiDimImplementation< GUM_ELEMENT > * t2,
const GUM_ELEMENT(* f )(const GUM_ELEMENT &, const GUM_ELEMENT &) )

a specialized function for functionally projecting a multiDimArray

The function produces a tensorial functional combination of t1 and t2, that is, if t1 and t2 are multiDimArrays over variables A,B,C,D and D,B,E respectively, function combine2MultiDimArrays will return a multiDimArray T defined as T[A,B,C,D,E] = f ( t1[A,B,C,D],t2[D,B,E] ) for all A,B,C,D,E.

Returns
function combine2MultiDimArrays allocates on the heap the new T multiDimArray and returns it.

References combine2MultiDimArrays().

Referenced by combine2MultiDimArrays().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ config()

GUM_SHARED_PUBLIC Configuration & gum::config ( )

A short name for Configuration::instance() : gum::config().epsilonStandard(). It is not inline so that it is exported by the library (shared build on Windows).

Definition at line 888 of file configuration.cpp.

888{ return Configuration::instance(); }
static Configuration & instance()
The global configuration.

References config(), and gum::Configuration::instance().

Referenced by gum::prm::o3prm::O3ClassFactory< GUM_SCALAR >::_checkRawCPT_(), gum::prm::o3prm::O3ClassFactory< GUM_SCALAR >::_checkRuleCPTSumsTo1_(), gum::credal::CredalNet< GUM_SCALAR >::_initParams_(), gum::credal::CredalNet< GUM_SCALAR >::_intervalToCredal_(), gum::credal::MultipleInferenceEngine< GUM_SCALAR, BNInferenceEngine >::_updateThreadCredalSets_(), almostDifferentEpsilon(), gum::IBayesNet< GUM_SCALAR >::check(), config(), gum::Rational< GUM_SCALAR >::continuedFracBest(), gum::Rational< GUM_SCALAR >::continuedFracFirst(), gum::Chi2::criticalValue(), gum::learning::IKTBNLearner< GUM_SCALAR >::defaultPriorWeight_(), gum::learning::IKTBNLearner< GUM_SCALAR >::defaultTabuListSize_(), gum::learning::IKTBNLearner< GUM_SCALAR >::defaultTabuNbDecrease_(), gum::credal::LRSWrapper< GUM_SCALAR >::fillV(), gum::credal::LRSWrapper< GUM_SCALAR >::H2V(), gum::IMarkovRandomField< GUM_SCALAR >::operator==(), gum::InfluenceDiagram< GUM_SCALAR >::operator==(), gum::learning::IBNLearner::preferredAlgo(), gum::credal::CredalNet< GUM_SCALAR >::setCPT(), gum::credal::CredalNet< GUM_SCALAR >::setCPT(), gum::credal::CredalNet< GUM_SCALAR >::setCPTs(), gum::credal::InferenceEngine< GUM_SCALAR >::updateCredalSets_(), gum::learning::IBNLearner::useBDeuPrior(), gum::learning::IBNLearner::useDirichletPrior(), gum::learning::IBNLearner::useEM(), gum::learning::IBNLearner::useEMWithDiffCriterion(), gum::learning::IBNLearner::useEMWithRateCriterion(), gum::learning::IBNLearner::useLocalSearchWithTabuList(), gum::learning::IBNLearner::useLocalSearchWithTabuList(), and gum::learning::IBNLearner::useSmoothingPrior().

Here is the call graph for this function:

◆ configurationEmbeddedDefaults()

std::string_view gum::configurationEmbeddedDefaults ( )

References configurationEmbeddedDefaults().

Referenced by configurationEmbeddedDefaults(), and gum::Configuration::instance().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ configurationEmbeddedPyAgrumDefaults()

std::string_view gum::configurationEmbeddedPyAgrumDefaults ( )

References configurationEmbeddedPyAgrumDefaults().

Referenced by configurationEmbeddedPyAgrumDefaults(), and gum::Configuration::instance().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ counterfactual() [1/2]

template<GUM_Numeric GUM_ELEMENT>
Tensor< GUM_ELEMENT > gum::counterfactual ( const CausalModel< GUM_ELEMENT > & cm,
const Set< std::string > & on,
const Set< std::string > & whatif,
const HashTable< std::string, std::string > & profile = HashTable< std::string, std::string >(),
const HashTable< std::string, std::string > & values = HashTable< std::string, std::string >() )

Compute a counterfactual distribution using the high-level API.

Mirrors the Python function counterfactual(cm, profile, on, whatif, values). Internally constructs a Counterfactual<GUM_ELEMENT> instance and returns its evaluated tensor adapted to variables from cm.

Template Parameters
GUM_ELEMENTnumeric scalar type (e.g., double)
Parameters
cmCausal model (original, observational world)
onNames of variables of interest (can be a singleton)
whatifIntervention targets (do-variables) by name
profileOptional evidence on original world (name -> label)
valuesOptional intervention values (name -> label). If empty, the result spans all values of the whatif variables.
Returns
Tensor<GUM_ELEMENT> probability distribution over on (variables are those of cm).

Definition at line 308 of file counterfactual_tpl.h.

312 {
313 // Use the class implementation and return the adapted tensor.
314 Counterfactual< GUM_ELEMENT > cf(cm, on, whatif, profile, values);
315 return cf.value();
316 }
Computes a counterfactual distribution by building a twin model, then evaluating a causal effect on t...

References counterfactual(), and gum::Counterfactual< GUM_ELEMENT >::value().

Referenced by counterfactual().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ counterfactual() [2/2]

template<GUM_Numeric GUM_ELEMENT>
PYGUM_PUBLIC Tensor< GUM_ELEMENT > gum::counterfactual ( const CausalModel< GUM_ELEMENT > & cm,
const Set< std::string > & on,
const Set< std::string > & whatif,
const HashTable< std::string, std::string > & profile = HashTable< std::string, std::string >(),
const HashTable< std::string, std::string > & values = HashTable< std::string, std::string >() )

Compute a counterfactual distribution using the high-level API.

Mirrors the Python function counterfactual(cm, profile, on, whatif, values). Internally constructs a Counterfactual<GUM_ELEMENT> instance and returns its evaluated tensor adapted to variables from cm.

Template Parameters
GUM_ELEMENTnumeric scalar type (e.g., double)
Parameters
cmCausal model (original, observational world)
onNames of variables of interest (can be a singleton)
whatifIntervention targets (do-variables) by name
profileOptional evidence on original world (name -> label)
valuesOptional intervention values (name -> label). If empty, the result spans all values of the whatif variables.
Returns
Tensor<GUM_ELEMENT> probability distribution over on (variables are those of cm).

Definition at line 308 of file counterfactual_tpl.h.

312 {
313 // Use the class implementation and return the adapted tensor.
314 Counterfactual< GUM_ELEMENT > cf(cm, on, whatif, profile, values);
315 return cf.value();
316 }

References counterfactual(), and gum::Counterfactual< GUM_ELEMENT >::value().

Referenced by counterfactual().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ counterfactual< double >()

template Tensor< double > gum::counterfactual< double > ( const CausalModel< double > & ,
const Set< std::string > & ,
const Set< std::string > & ,
const HashTable< std::string, std::string > & ,
const HashTable< std::string, std::string > &  )

References CausalModel< double >, counterfactual< double >(), and Tensor< double >.

Referenced by counterfactual< double >().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ counterfactualModel()

template<GUM_Numeric GUM_ELEMENT>
CausalModel< GUM_ELEMENT > gum::counterfactualModel ( const CausalModel< GUM_ELEMENT > & cm,
const HashTable< std::string, std::string > & profile,
const Set< std::string > & whatif )

Build the twin causal model.

Mirrors the Python function counterfactualModel(cm, profile, whatif). It computes posteriors of idiosyncratic nodes in the original BN given profile and replaces their priors in a cloned model.

Template Parameters
GUM_ELEMENTnumeric scalar type (e.g., double)
Parameters
cmOriginal causal model
profileOptional evidence on the original BN (name -> label)
whatifIntervention targets (do-variables) by name
Returns
CausalModel<GUM_ELEMENT> the twin causal model

Definition at line 320 of file counterfactual_tpl.h.

322 {
323 const auto& origBN = cm.observationalBN();
324
325 // Clone model (copy semantics)
326 CausalModel< GUM_ELEMENT > twincm(origBN);
327
328 // what-if ids
329 NodeSet whatifIds;
330 for (const auto& w: whatif)
331 whatifIds.insert(cm.idFromName(w));
332
333 // idiosyncratic = parentless \ (whatif ∪ latent)
334 NodeSet idiosyncratic;
335 for (auto nid: origBN.nodes())
336 if (origBN.parents(nid).size() == 0) idiosyncratic.insert(nid);
337 for (auto id: whatifIds)
338 idiosyncratic.erase(id);
339 for (auto id: cm.latentVariablesIds())
340 idiosyncratic.erase(id);
341
342 // Posteriors in the original BN
344 if (!profile.empty()) {
345 for (const auto& kv: profile) {
346 const NodeId nid = cm.idFromName(kv.first);
347 const auto& var = origBN.variable(nid);
348 const Idx valId = var.index(kv.second);
349 ie.addEvidence(nid, valId);
350 }
351 }
352 ie.makeInference();
353
354 // Update priors in the twin with posteriors
355 auto& twinBN = twincm.observationalBN();
356 for (auto f: idiosyncratic) {
357 const auto& name = origBN.variable(f).name();
358 const NodeId twinId = twinBN.idFromName(name);
359 const Tensor< GUM_ELEMENT > post = ie.posterior(f);
360 twinBN.cpt(twinId).fillWith(post);
361 }
362
363 return twincm;
364 }
NodeSet latentVariablesIds() const
Node ids of all latent variables.
NodeId idFromName(std::string_view name) const
Node id from variable name (observed or latent).
const BayesNet< GUM_SCALAR > & observationalBN() const
Observational BN (observed variables only).
Implementation of a Shafer-Shenoy's-like version of lazy propagation for inference in Bayesian networ...
void insert(const Key &k)
Inserts a new element into the set.
Definition set_tpl.h:510
void erase(const Key &k)
Erases an element from the set.
Definition set_tpl.h:553
const Tensor< GUM_SCALAR > & fillWith(const Tensor< GUM_SCALAR > &src) const
copy a Tensor data using name of variables and labels (not necessarily the same variables in the same...
Definition tensor_tpl.h:305
Size NodeId
Type for node ids.
Set< NodeId > NodeSet
Some typdefs and define for shortcuts ...

References gum::GraphicalModelInference< GUM_SCALAR >::addEvidence(), counterfactualModel(), gum::HashTable< Key, Val >::empty(), gum::Set< Key >::erase(), gum::CausalModel< GUM_SCALAR >::idFromName(), gum::Set< Key >::insert(), gum::CausalModel< GUM_SCALAR >::latentVariablesIds(), gum::GraphicalModelInference< GUM_SCALAR >::makeInference(), gum::CausalModel< GUM_SCALAR >::observationalBN(), and gum::JointTargetedInference< GUM_SCALAR >::posterior().

Referenced by counterfactualModel().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ counterfactualModel< double >()

template CausalModel< double > gum::counterfactualModel< double > ( const CausalModel< double > & ,
const HashTable< std::string, std::string > & ,
const Set< std::string > &  )

References CausalModel< double >, and counterfactualModel< double >().

Referenced by counterfactualModel< double >().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ defaultJgumIndent()

GUM_SHARED_PUBLIC int gum::defaultJgumIndent ( )

The indentation used by the GUM writers (jgum text format) when none is given: the value of the key jgumIndent of section core in gum::Configuration.

Returns
The indentation (-1 is the most compact output).

Definition at line 51 of file GumBinaryIO.cpp.

51 {
52 const auto indent = Configuration::instance().typed< std::int64_t >("core", "jgumIndent");
53 return static_cast< int >(std::clamp< std::int64_t >(indent, -1, INT_MAX));
54 }
T typed(std::string_view section, std::string_view key) const
Value of section.key converted according to its declared type.

References defaultJgumIndent(), gum::Configuration::instance(), and gum::Configuration::typed().

Referenced by defaultJgumIndent().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dispatchRangeToThreads()

GUM_SHARED_PUBLIC std::vector< std::pair< Idx, Idx > > gum::dispatchRangeToThreads ( Idx beg,
Idx end,
unsigned int nb_threads )

returns a vector equally splitting elements of a range among threads

Parameters
begthe beginning of the range (included)
endthe end of the range (excluded)
nb_threadsthe number of threads over which we would like performing the splitting
Returns
a vector containing the range [beginning,end) that each thread should work on

Definition at line 76 of file threads.cpp.

76 {
77 // there should always be at least one thread
78 const auto real_nb_threads
79 = nb_threads < 1 ? static_cast< Idx >(1) : static_cast< Idx >(nb_threads);
80 const Idx range_size = end - beg;
81 std::vector< std::pair< Idx, Idx > > result;
82 result.reserve(real_nb_threads);
83
84 // if the number of elements in the range is lower than or equal to the
85 // number of threads, assign only one element per thread
86 if (range_size <= real_nb_threads) {
87 for (Idx i = static_cast< Idx >(0); i < range_size; ++i) {
88 result.emplace_back(i, i + 1);
89 }
90 for (Idx i = range_size; i < real_nb_threads; ++i) {
91 result.emplace_back(range_size, range_size);
92 }
93 } else {
94 // here there are more elements in the range than threads. So try to balance
95 // the number of elements among the threads
96 Idx nb_elts_par_thread = range_size / real_nb_threads;
97 Idx rest_elts = range_size - nb_elts_par_thread * real_nb_threads;
98
99 Idx begin_index = beg;
100 for (Idx i = static_cast< Idx >(0); i < real_nb_threads; ++i) {
101 Idx end_index = begin_index + nb_elts_par_thread;
102 if (rest_elts != static_cast< Idx >(0)) {
103 ++end_index;
104 --rest_elts;
105 }
106 result.emplace_back(begin_index, end_index);
107 begin_index = end_index;
108 }
109 }
110
111 return result;
112 }

References dispatchRangeToThreads().

Referenced by gum::credal::CredalNet< GUM_SCALAR >::_H2Vlrs_(), dispatchRangeToThreads(), gum::credal::CNLoopyPropagation< GUM_SCALAR >::enum_combi_(), gum::credal::CNLoopyPropagation< GUM_SCALAR >::enum_combi_(), gum::credal::MultipleInferenceEngine< GUM_SCALAR, BNInferenceEngine >::expFusion_(), gum::credal::CNMonteCarloSampling< GUM_SCALAR, BNInferenceEngine >::makeInference(), and gum::credal::MultipleInferenceEngine< GUM_SCALAR, BNInferenceEngine >::verticesFusion_().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fastGraph()

template<GUM_NodeGraphable GRAPH_TYPE = MixedGraph>
GRAPH_TYPE gum::fastGraph ( std::string_view desc)

Builds a GRAPH_TYPE from a DOT-like textual description.

Syntax: "->" separates two node tokens with a directed arc, "<-" with a directed arc in the other direction, "-" separates them with an undirected edge, ";" separates independent chains, e.g. "A->B->C; B->E" or "A->B<-C" (both A and C point to B) or "A->B-C".

"-" (not "--") is used for edges on purpose: MRF's own fast syntax already uses "--" to list the variables of a single factor (a clique), a different construct from a chain of pairwise edges.

If every node token in desc parses as a non-negative integer, those integers are used directly as NodeIds (addNodeWithId). Otherwise every token — including numeric-looking ones — is treated as a string name (addNode + setName).

Template Parameters
GRAPH_TYPEConcrete graph type to build (DiGraph, UndiGraph, MixedGraph, DAG, PDAG, ...). Defaults to MixedGraph.
Parameters
descthe DOT-like description.
Returns
the built graph.
Exceptions
InvalidArcif desc requires a directed arc but GRAPH_TYPE cannot represent arcs (not GUM_DiGraphable), or if the description is malformed (e.g. an operator without a following node token).
InvalidEdgeif desc requires an undirected edge but GRAPH_TYPE cannot represent edges (not GUM_UndiGraphable).
InvalidDirectedCyclepropagated as-is if GRAPH_TYPE is a DAG (or any type enforcing acyclicity) and desc would create a cycle.
DuplicateElementpropagated as-is if desc reuses a name across distinct nodes.

Definition at line 210 of file fastGraph_tpl.h.

210 {
211 using namespace detail;
212
213 std::vector< std::vector< std::pair< std::string, FastGraphOp > > > chains;
214 bool useIds = true;
215
216 for (const auto& chainStr: split(remove_newline(desc), ";")) {
217 if (trim_copy(chainStr).empty()) { continue; }
218
219 auto tokens = fastGraphTokenize(chainStr);
220 for (const auto& [token, op]: tokens) {
221 if (token.empty()) {
223 "fastGraph: malformed description '" << desc
224 << "' (operator without a node token)")
225 }
226 if (!fastGraphIsNodeIdToken(token)) { useIds = false; }
227 }
228 chains.push_back(std::move(tokens));
229 }
230
231 GRAPH_TYPE g;
232
233 auto resolve = [&](const std::string& token) { return fastGraphBuildNode(g, token, useIds); };
234 auto addArc = [&](NodeId tail, NodeId head, const std::string& token) {
235 if constexpr (GUM_DiGraphable< GRAPH_TYPE >) {
236 g.addArc(tail, head);
237 } else {
238 GUM_ERROR(InvalidArc,
239 "fastGraph: '" << token << "' is preceded by an arc operator but the "
240 << "requested graph type does not support arcs")
241 }
242 };
243 auto addEdge = [&](NodeId a, NodeId b, const std::string& token) {
244 if constexpr (GUM_UndiGraphable< GRAPH_TYPE >) {
245 g.addEdge(a, b);
246 } else {
247 GUM_ERROR(InvalidEdge,
248 "fastGraph: '" << token << "' is preceded by '-' but the "
249 << "requested graph type does not support edges")
250 }
251 };
252
253 for (const auto& tokens: chains) {
254 fastGraphWalkTokens(tokens, desc, resolve, addArc, addEdge);
255 }
256
257 return g;
258 }
Exception : there is something wrong with an arc.
Concept for directed graphs (arcs with parents/children).
Concept for undirected graphs (edges with neighbours).
GUM_SHARED_PUBLIC std::string remove_newline(std::string_view s)
remove all newlines in a string
GUM_SHARED_PUBLIC std::string trim_copy(std::string_view s)
trim from both ends (copying)
std::vector< std::string > split(std::string_view str, std::string_view delim)
Split str using the delimiter.
void fastGraphWalkTokens(const std::vector< std::pair< std::string, FastGraphOp > > &tokens, std::string_view desc, Resolve resolve, AddArc addArc, AddEdge addEdge)
Walks one already-tokenized chain (see fastGraphTokenize()), resolving each token to a NodeId via res...
NodeId fastGraphBuildNode(GRAPH_TYPE &g, const std::string &token, bool useIds)
gets or creates the node denoted by token, in NodeId or name mode
bool fastGraphIsNodeIdToken(const std::string &token)
true if token must be read as a NodeId (non-negative integer)

References fastGraph(), GUM_ERROR, remove_newline(), split(), and trim_copy().

Referenced by fastGraph().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fastVariable() [1/2]

template<GUM_Numeric GUM_SCALAR = double>
std::unique_ptr< DiscreteVariable > gum::fastVariable ( std::string var_description,
Size default_domain_size )

Create a pointer on a Discrete Variable from a "fast" syntax.

Parameters
var_description: the string in "fast" syntax
default_domain_size: the domain size if the description does not give this information. Note that if default_domain_size=1, a variable with a domain Size=1 is not an error.
Returns
an unique_ptr on the new variable.

Definition at line 52 of file allDiscreteVariables_tpl.h.

53 {
54 if (default_domain_size < 1)
55 GUM_ERROR(InvalidArgument, "default_domain_size can not be less than 1")
56
57 const std::string domain = "[" + std::to_string(default_domain_size) + "]";
58 return fastVariable< GUM_SCALAR >(var_description, domain);
59 }
Exception: at least one argument passed to a function is not what was expected.
std::string to_string(const Formula &f)
STL namespace.

References fastVariable(), and GUM_ERROR.

Referenced by gum::BayesNet< GUM_SCALAR >::add(), gum::KTBN< GUM_SCALAR >::add(), gum::InfluenceDiagram< GUM_SCALAR >::addChanceNode(), gum::InfluenceDiagram< GUM_SCALAR >::addDecisionNode(), gum::InfluenceDiagram< GUM_SCALAR >::addUtilityNode(), build_node(), build_node_for_ID(), build_node_for_MN(), fastVariable(), and fastVariable().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fastVariable() [2/2]

template<GUM_Numeric GUM_SCALAR = double>
std::unique_ptr< DiscreteVariable > gum::fastVariable ( std::string var_description,
std::string_view default_domain = "[2]" )

Create a pointer on a Discrete Variable from a "fast" syntax.

Parameters
var_description: the string in "fast" syntax
default_domain_size: the domain size if the description does not give this information. Note that if default_domain_size=1, a variable with a domain Size=1 is not an error.
Returns
an unique_ptr on the new variable.

Definition at line 62 of file allDiscreteVariables_tpl.h.

63 {
64 Size ds = 0;
65 long range_min = 0;
66 long range_max = 1;
67 std::vector< std::string > labels;
68 std::vector< GUM_SCALAR > ticks;
69 std::string name;
70
71 std::vector< int > values;
72 std::vector< double > numerical_values;
73
74 trim(var_description);
75
76 if (default_domain.empty()) GUM_ERROR(InvalidArgument, "default_domain can not be empty")
77
78
79 if (auto t = *default_domain.begin(); t != '[' && t != '{')
81 "default_domain (" << default_domain << ") must start with '[' or '{'")
82
83 if (var_description.find('[') == std::string::npos
84 && var_description.find('{') == std::string::npos) {
85 var_description += default_domain;
86 }
87
88 // [1,3,5]...
89 if (*(var_description.rbegin()) == ']') {
90 // The domain spec is the LAST bracket group, not the first: a name may
91 // itself legally contain "[...]" (e.g. gum::KTBN's "base[slice]" engine
92 // names), and such a name must survive round-tripping through toFast().
93 if (auto posBrack = var_description.rfind('['); posBrack != std::string::npos) {
94 name = var_description.substr(0, posBrack);
95 const auto& s_args
96 = var_description.substr(posBrack + 1, var_description.size() - posBrack - 2);
97 const auto& args = split(s_args, ",");
98 if (args.empty()) {
99 // n[]
100 GUM_ERROR(InvalidArgument, "Empty range for variable " << var_description)
101 } else if (args.size() == 1) {
102 // n[4] or n[0:5.5:10]
103
104 const auto& labels = split(args[0], ":");
105
106 if (labels.size() == 3) {
107 // b{1.1:3.31:5}
108 const double fmin = std::stod(labels[0]);
109 const double fmax = std::stod(labels[1]);
110 const int nbr = std::stoi(labels[2]);
111
112 if (fmax <= fmin) { GUM_ERROR(InvalidArgument, "last<=first in " << var_description) }
113 if (nbr <= 1) { GUM_ERROR(InvalidArgument, "nbr<=1 in " << var_description) }
114 const auto step = (fmax - fmin) / nbr;
115 double current = fmin;
116 for (auto i = 0; i <= nbr; i += 1) {
117 ticks.push_back(current);
118 current += step;
119 }
120 ds = ticks.size();
121 } else {
122 // n[4]
123 int n = std::stoi(args[0]);
124 if ((n < 2) && (default_domain != "[1]"))
125 GUM_ERROR(InvalidArgument, n << " is not >=2 for variable " << var_description)
126 ds = static_cast< Size >(n);
127 range_min = 0;
128 range_max = static_cast< long >(ds) - 1;
129 }
130 } else if (args.size() == 2) {
131 // n[5,10]
132 range_min = std::stol(args[0]);
133 range_max = std::stol(args[1]);
134
135 if (range_max < range_min)
136 GUM_ERROR(InvalidArgument,
137 "Invalid range for variable " << var_description << ": max<min")
138 if (range_max == range_min && default_domain != "[1]")
139 GUM_ERROR(InvalidArgument,
140 "Invalid range for variable "
141 << var_description << ": max==min not allowed if default_domain_size>1")
142
143 ds = static_cast< Size >(1 + range_max - range_min);
144 } else {
145 // n[3.14,5,10,12]
146 for (const auto& tick: args) {
147 ticks.push_back(static_cast< GUM_SCALAR >(std::strtod(tick.c_str(), nullptr)));
148 }
149 ds = args.size() - 1;
150 }
151 }
152 // var_description like "n{one|two|three}" or b{1.1:3.31:5}
153 } else if (*(var_description.rbegin()) == '}') {
154 if (auto posBrack = var_description.find('{'); posBrack != std::string::npos) {
155 name = var_description.substr(0, posBrack);
156 labels = split(var_description.substr(posBrack + 1, var_description.size() - posBrack - 2),
157 ":");
158 if (labels.size() == 3) {
159 // b{1.1:3.31:5}
160 const auto fmin = std::stod(labels[0]);
161 const auto fmax = std::stod(labels[1]);
162 const int nbr = std::stoi(labels[2]);
163
164 if (fmax <= fmin) { GUM_ERROR(InvalidArgument, "last<=first in " << var_description) }
165 if (nbr <= 1) { GUM_ERROR(InvalidArgument, "nbr<=1 in " << var_description) }
166 const auto step = double((fmax - fmin) / (nbr - 1));
167
168 if ((trunc(step) == step) && (trunc(fmin) == fmin) && (trunc(fmax) == fmax)) {
169 // b{1:6:5} => IntegerVariable
170 labels.clear();
171 numerical_values.clear();
172 int v = int(fmin);
173 for (int i = 1; i <= nbr; i++) {
174 labels.push_back(std::to_string(v));
175 v += int(step);
176 }
177 ds = labels.size();
178 } else {
179 // b{1.3:6.3:5} => NumericalDiscreteVariable
180 labels.clear();
181 numerical_values.clear();
182 ds = nbr;
183 double v = fmin;
184 numerical_values.push_back(v);
185 for (auto i = 1; i < nbr - 1; i++) {
186 v += step;
187 numerical_values.push_back(v);
188 }
189 numerical_values.push_back(fmax);
190 }
191 } else {
192 labels
193 = split(var_description.substr(posBrack + 1, var_description.size() - posBrack - 2),
194 "|");
195 if (labels.size() < 2) {
196 if (labels.size() == 1
197 && default_domain != "[1]") // 1 is ok if default_domain_size==1
198 GUM_ERROR(InvalidArgument, "Not enough labels in var_description " << var_description)
199 }
200 if (!hasUniqueElts(labels)) {
201 GUM_ERROR(InvalidArgument, "Duplicate labels in var_description " << var_description)
202 }
203 ds = labels.size();
204 }
205 }
206 } else {
207 name = var_description;
208 }
209
210 if (ds == 0) {
211 GUM_ERROR(InvalidArgument, "No value for variable " << var_description << ".")
212 } else if (ds == 1) {
213 if (default_domain != "[1]")
214 GUM_ERROR(InvalidArgument,
215 "Only one value for variable " << var_description << " (2 at least are needed).")
216 }
217
218 if (!labels.empty()) {
219 if (std::all_of(labels.cbegin(), labels.cend(), isInteger)) {
220 for (const auto& label: labels)
221 values.push_back(std::stoi(label));
222 if (values.size() >= 2) {
223 // there can be an enumeration of consecutive integers
224 std::sort(values.begin(), values.end());
225 range_min = values[0];
226 auto v = range_min;
227 bool is_range = true;
228 for (const auto item: values) {
229 if (item != v) { is_range = false; }
230 v += 1;
231 }
232 if (is_range) {
233 values.clear(); // not an IntegerVariable but rather a RangeVariable
234 labels.clear();
235 range_max = v - 1;
236 }
237 }
238 } else if (std::all_of(labels.cbegin(), labels.cend(), isNumerical))
239 for (const auto& label: labels)
240 numerical_values.push_back(std::stod(label));
241 }
242
243 trim(name);
244
245 if (!values.empty()) {
246 return std::make_unique< IntegerVariable >(name, name, values);
247 } else if (!numerical_values.empty()) {
248 if (!std::all_of(numerical_values.cbegin(),
249 numerical_values.cend(),
251 GUM_ERROR(DefaultInLabel, "Infinite value is not allowed for variable " << name)
252 }
253 return std::make_unique< NumericalDiscreteVariable >(name, name, numerical_values);
254 } else if (!labels.empty()) {
255 return std::make_unique< LabelizedVariable >(name, name, labels);
256 } else if (!ticks.empty()) {
257 if (!std::all_of(ticks.cbegin(), ticks.cend(), gum::isfinite< double >)) {
258 GUM_ERROR(DefaultInLabel, "Infinite value is not allowed for variable " << name)
259 }
260 // if last character of name is a +, we remove the character from the name and set empirical
261 // to True
262 if (name.back() == '+') {
263 name.pop_back();
264 trim(name);
265 return std::make_unique< DiscretizedVariable< GUM_SCALAR > >(name, name, ticks, true);
266 } else {
267 return std::make_unique< DiscretizedVariable< GUM_SCALAR > >(name, name, ticks);
268 }
269 } else {
270 return std::make_unique< RangeVariable >(name, name, range_min, range_max);
271 }
272 }
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Definition types.h:74
GUM_SHARED_PUBLIC bool isInteger(std::string_view val)
return true is a string contains an integer value
bool hasUniqueElts(std::vector< T > const &x)
GUM_SHARED_PUBLIC void trim(std::string &s)
trim from both ends (in place)
GUM_SHARED_PUBLIC bool isNumerical(std::string_view val)
return true is a string contains a numerical (double) value
bool isfinite(T arg)

References fastVariable(), GUM_ERROR, isfinite(), isInteger(), isNumerical(), split(), and trim().

Here is the call graph for this function:

◆ func2str()

std::string gum::func2str ( FormulaPart::token_function func)

Definition at line 85 of file formula.cpp.

85 {
86 switch (func) {
88 return "exp";
89 }
91 return "log";
92 }
94 return "ln";
95 }
97 return "pow";
98 }
100 return "sqrt";
101 }
103 return "nil";
104 }
105 default : {
106 GUM_ERROR(OperationNotAllowed, "unknown function")
107 }
108 }
109 }

References gum::FormulaPart::exp, func2str(), GUM_ERROR, gum::FormulaPart::ln, gum::FormulaPart::log, gum::FormulaPart::nil, gum::FormulaPart::pow, and gum::FormulaPart::sqrt.

Referenced by func2str(), and gum::FormulaPart::str().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getMaxModality()

template<GUM_Numeric GUM_SCALAR>
gum::Size gum::getMaxModality ( gum::BayesNet< GUM_SCALAR > & bayesNet)

Definition at line 56 of file MCBayesNetGenerator_tpl.h.

56 {
57 gum::Size maxMod = 0;
58
59 for (auto node: bayesNet.nodes())
60 if (maxMod < bayesNet.variable(node).domainSize())
61 maxMod = bayesNet.variable(node).domainSize();
62
63 return maxMod;
64 }
const DiscreteVariable & variable(std::string_view name) const
Returns a gum::DiscreteVariable given its name in the gum::BayesNet.
const NodeGraphPart & nodes() const final
Returns a named copy of the internal DAG: each node id is assigned the name of the corresponding vari...
virtual Size domainSize() const =0

References gum::DiscreteVariable::domainSize(), getMaxModality(), gum::DAGmodel::nodes(), and gum::BayesNet< GUM_SCALAR >::variable().

Referenced by gum::MCBayesNetGenerator< GUM_SCALAR, ICPTGenerator, ICPTDisturber >::MCBayesNetGenerator(), and getMaxModality().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getMaxNumberOfThreads()

INLINE unsigned int gum::threadsSTL::getMaxNumberOfThreads ( )

Returns the maximum number of threads you should use at any time.

By default, it should be the number of CPU cores available. Note that it is preferable to use function getNumberOfThreads(), which corresponds to the max number of threads the user wants to launch in parallel regions (this is by default equal to getMaxNumberOfThreads(), but the user may wish to change it for some reason).

Returns
Returns the maximum number of threads that should be used at any time.

Definition at line 61 of file threadsSTL_inl.h.

61 {
62 return std::max(1u, std::thread::hardware_concurrency());
63 }

Referenced by gum::Configuration::instance().

Here is the caller graph for this function:

◆ getNumberOfLogicalProcessors()

Get the number of logical processors.

Returns
The number of logical processors.

Definition at line 66 of file threadsSTL_inl.h.

66 {
67 return std::max(1u, std::thread::hardware_concurrency());
68 }

◆ getNumberOfThreads()

GUM_SHARED_PUBLIC unsigned int gum::threadsSTL::getNumberOfThreads ( )

returns the max number of threads used by default when entering the next parallel region

This is the number of threads launched in parallel regions. By default, this number is equal to getMaxNumberOfThreads() but if the user has changed it using method setNumberOfThreads, then this number is what the user required.

Returns
the number of threads used by default the next time we enter into a parallel region

Definition at line 78 of file threadsSTL.cpp.

78{ return _nb_threads_(); }

Referenced by gum::credal::CredalNet< GUM_SCALAR >::_H2Vlrs_().

Here is the caller graph for this function:

◆ isCloseToOne()

template<typename T>
bool gum::isCloseToOne ( T x,
T tol = static_cast< T >(config().epsilonFine()) )

Is |x - 1| <= tol ? By default, tol is the key core.epsilonFine of the configuration.

Definition at line 52 of file math_utils_tpl.h.

52 {
53 return std::abs(x - T(1)) <= tol;
54 }

References isCloseToOne().

Referenced by gum::Tensor< GUM_ELEMENT >::findAll(), gum::credal::LRSWrapper< GUM_SCALAR >::H2V(), isCloseToOne(), gum::credal::CredalNet< GUM_SCALAR >::setCPT(), gum::credal::CredalNet< GUM_SCALAR >::setCPT(), gum::credal::CredalNet< GUM_SCALAR >::setCPTs(), and gum::Tensor< GUM_SCALAR >::variance().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isCloseToZero()

template<typename T>
bool gum::isCloseToZero ( T x,
T tol = static_cast< T >(config().epsilonFine()) )

Is |x| <= tol ? By default, tol is the key core.epsilonFine of the configuration.

Definition at line 47 of file math_utils_tpl.h.

47 {
48 return std::abs(x) <= tol;
49 }

References isCloseToZero().

Referenced by isCloseToZero().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isfinite()

template<typename T>
bool gum::isfinite ( T arg)

Definition at line 57 of file math_utils_tpl.h.

57 {
58 if constexpr (std::numeric_limits< T >::has_infinity) {
59 if constexpr (std::numeric_limits< T >::is_signed) {
60 return arg == arg && arg != std::numeric_limits< T >::infinity()
61 && arg != -std::numeric_limits< T >::infinity(); // neither Nan, infty nor -infty
62 } else {
63 return arg == arg
64 && arg != std::numeric_limits< T >::infinity(); // neither Nan nor inftty
65 }
66 } else {
67 return arg == arg; // not Nan
68 }
69 }

References isfinite().

Referenced by gum::IntegerVariable::IntegerVariable(), gum::NumericalDiscreteVariable::NumericalDiscreteVariable(), gum::NumericalDiscreteVariable::NumericalDiscreteVariable(), fastVariable(), and isfinite().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isOMP()

GUM_SHARED_PUBLIC bool gum::isOMP ( )

indicates whether aGrUM uses openMP or STL threads

Definition at line 66 of file threads.cpp.

66 {
67#ifdef GUM_THREADS_USE_OMP
68 return true;
69#else
70 return false;
71#endif
72 }

References isOMP().

Referenced by isOMP().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ junctionTreeRoots()

GUM_SHARED_PUBLIC NodeSet gum::junctionTreeRoots ( const JunctionTree & jt,
const GraphicalModel & model,
const NodeSet & preferred )

Returns one root for each connected component of a junction tree.

In each connected component, the root is a clique of preferred if the component contains some, otherwise any clique of the component. Among the candidates, the clique with the smallest domain (the product of the domain sizes of its variables) is selected. The domain sizes are compared through their logarithms, so that large cliques cannot overflow.

Complexity: linear in the size of the junction tree (no sort, no recursion).

Parameters
jtthe junction tree
modelthe graphical model whose variables are the nodes of the cliques of jt
preferredthe cliques that should be preferred as roots (e.g. those containing targets)
Returns
the set of roots, exactly one per connected component of jt

Definition at line 56 of file junctionTreeRoots.cpp.

58 {
59 // for each connected component, the best clique so far with its key: (not preferred, log of
60 // its domain size). The lexicographic order puts the preferred cliques first, then the smallest
61 using Key = std::pair< bool, double >;
62
63 const auto components = jt.connectedComponents();
65
66 for (const auto clique: jt.nodes()) {
67 double log_dom_size = 0.0;
68 for (const auto node: jt.clique(clique))
69 log_dom_size += std::log(static_cast< double >(model.variable(node).domainSize()));
70 const Key key{!preferred.contains(clique), log_dom_size};
71
72 const NodeId component = components[clique];
73 if (auto current = best.tryGet(component)) {
74 if (key < current->first) *current = {key, clique};
75 } else {
76 best.insert(component, {key, clique});
77 }
78 }
79
80 NodeSet roots;
81 for (const auto& elt: best)
82 roots.insert(elt.second.second);
83 return roots;
84 }
const NodeSet & clique(const NodeId idClique) const
returns the set of nodes included into a given clique
virtual const DiscreteVariable & variable(NodeId id) const =0
Returns a constant reference over a variable given it's node id.
The class for generic Hash Tables.
Definition hashTable.h:640
value_type & insert(const Key &key, const Val &val)
Adds a new element (actually a copy of this element) into the hash table.
optional_ref< Val > tryGet(const Key &key)
Returns a pointer to the value associated with a given key, or nullptr if the key does not exist.
const NodeGraphPart & nodes() const
return *this as a NodeGraphPart
bool contains(const Key &k) const
Indicates whether a given elements belong to the set.
Definition set_tpl.h:468
NodeProperty< NodeId > connectedComponents() const
returns a property {node:id of weakly connected component}

References gum::CliqueGraph::clique(), gum::UndiGraph::connectedComponents(), gum::Set< Key >::contains(), gum::DiscreteVariable::domainSize(), gum::HashTable< Key, Val >::insert(), gum::Set< Key >::insert(), junctionTreeRoots(), gum::NodeGraphPart::nodes(), gum::HashTable< Key, Val >::tryGet(), and gum::GraphicalModel::variable().

Referenced by junctionTreeRoots().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ log2()

template<GUM_Numeric GUM_SCALAR>
Tensor< GUM_SCALAR > gum::log2 ( const Tensor< GUM_SCALAR > & arg)
inline

References log2().

Referenced by log2().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ LPMaxprojTensor()

template<GUM_Numeric GUM_SCALAR>
INLINE Tensor< GUM_SCALAR > gum::LPMaxprojTensor ( const Tensor< GUM_SCALAR > & t1,
const gum::VariableSet & del_vars )
static

References LPMaxprojTensor().

Referenced by LPMaxprojTensor().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ LPNewmultiTensor()

template<GUM_Numeric GUM_SCALAR>
INLINE Tensor< GUM_SCALAR > gum::LPNewmultiTensor ( const Tensor< GUM_SCALAR > & t1,
const Tensor< GUM_SCALAR > & t2 )
static

References LPNewmultiTensor().

Referenced by LPNewmultiTensor().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ LPNewprojTensor()

template<GUM_Numeric GUM_SCALAR>
INLINE Tensor< GUM_SCALAR > gum::LPNewprojTensor ( const Tensor< GUM_SCALAR > & t1,
const gum::VariableSet & del_vars )
static

References LPNewprojTensor().

Referenced by LPNewprojTensor().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ makeInstantiationFromValues()

template<GUM_Numeric GUM_SCALAR>
Instantiation gum::makeInstantiationFromValues ( const Tensor< GUM_SCALAR > & tensor,
const HashTable< std::string, std::string > & values )
inline

Creates an instance for a tensor based on a HashTable.

Parameters
tensorThe target tensor whose variables define the instantiation’s scope.
valuesMapping from variable name to label that must be fully applicable.
Returns
A gum::Instantiation positioned according to values.
Exceptions
NotFoundIf a variable name in values is not a dimension of tensor.
NotFoundIf a label in values is not in the corresponding variable’s domain.

Definition at line 301 of file causalImpact_tpl.h.

302 {
303 Instantiation I; // start empty (partial instantiation)
304
305 for (const auto& [k, v]: values) {
306 try {
307 const auto& var = tensor.variable(k); // skip if not in tensor
308 const gum::Idx idx = var.index(v); // skip if label unknown
309 I.add(var); // add this dim only
310 I.chgVal(var, idx); // fix its value
311 } catch (const gum::NotFound&) {
312 // variable or label not found: ignore (non-strict)
313 continue;
314 } catch (...) {
315 // any other issue: ignore
316 continue;
317 }
318 }
319 return I;
320 }
Class for assigning/browsing values to tuples of discrete variables.
Instantiation & chgVal(const DiscreteVariable &v, Idx newval)
Assign newval to variable v in the Instantiation.
void add(const DiscreteVariable &v) final
Adds a new variable in the Instantiation.

References gum::Instantiation::add(), gum::Instantiation::chgVal(), and makeInstantiationFromValues().

Referenced by causalImpact(), makeInstantiationFromValues(), and gum::Counterfactual< GUM_ELEMENT >::run().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator*() [1/2]

const value_type & gum::operator* ( )

Returns the value pointed to by the iterator.

Returns
Returns the value pointed to by the iterator.
Exceptions
UndefinedIteratorValueRaised when the iterator does not point to a valid hash table element
Returns
Returns the value pointed to by the iterator.
Exceptions
UndefinedIteratorValueRaised when the iterator does not point to a valid hash table element.

Referenced by operator*(), and operator*().

Here is the caller graph for this function:

◆ operator*() [2/2]

INLINE Formula gum::operator* ( const Formula & a,
const Formula & b )

Definition at line 252 of file formula_inl.h.

252 {
253 return Formula(std::to_string(a.result() * b.result()));
254 }
Formula(short s)
Constructor.
Definition formula.cpp:204
double result() const
Returns the result of this gum::Formula.
Definition formula.cpp:310

References gum::Formula::Formula(), operator*(), and gum::Formula::result().

Here is the call graph for this function:

◆ operator+() [1/2]

INLINE Formula gum::operator+ ( const Formula & a,
const Formula & b )

Definition at line 242 of file formula_inl.h.

242 {
243 return Formula(std::to_string(a.result() + b.result()));
244 }

References gum::Formula::Formula(), operator+(), and gum::Formula::result().

Here is the call graph for this function:

◆ operator+() [2/2]

HashTableIteratorSafe< Key, Val > gum::operator+ ( Size i) const

Returns a new iterator pointing to i elements further in the hashtable.

Parameters
iThe number of increments.
Returns
Returns this gum::HashTableIteratorSafe.

Referenced by operator+(), and operator+().

Here is the caller graph for this function:

◆ operator++()

HashTableIteratorSafe< Key, Val > & gum::operator++ ( )
noexcept

References operator++().

Referenced by operator++().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator+=()

HashTableIteratorSafe< Key, Val > & gum::operator+= ( Size i)
noexcept

Makes the iterator point to i elements further in the hashtable.

Parameters
iThe number of increments.
Returns
Return this gum::HashTableIteratorSafe.

◆ operator-() [1/4]

INLINE Formula gum::operator- ( const Formula & a)

Definition at line 239 of file formula_inl.h.

239{ return Formula(std::to_string(-1 * a.result())); }

References gum::Formula::Formula(), operator-(), and gum::Formula::result().

Here is the call graph for this function:

◆ operator-() [2/4]

INLINE Formula gum::operator- ( const Formula & a,
const Formula & b )

Definition at line 247 of file formula_inl.h.

247 {
248 return Formula(std::to_string(a.result() - b.result()));
249 }

References gum::Formula::Formula(), operator-(), and gum::Formula::result().

Here is the call graph for this function:

◆ operator-() [3/4]

template<typename Val>
ListConstIterator< Val >::difference_type gum::operator- ( const ListConstIterator< Val > & iter1,
const ListConstIterator< Val > & iter2 )

For STL compliance, a distance operator.

Definition at line 348 of file list_tpl.h.

348 {
350
351 for (ListConstIterator< Val > iter3 = iter2; iter1 != iter3; ++iter3, ++res) {}
352
353 return res;
354 }
Unsafe but fast const iterators for Lists.
Definition list.h:1449
std::ptrdiff_t difference_type
Types for STL compliance.
Definition list.h:1459

References operator-().

Referenced by operator-(), operator-(), operator-(), operator-(), and operator-().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator-() [4/4]

template<typename Val>
ListConstIteratorSafe< Val >::difference_type gum::operator- ( const ListConstIteratorSafe< Val > & iter1,
const ListConstIteratorSafe< Val > & iter2 )

For STL compliance, a distance operator.

Definition at line 944 of file list_tpl.h.

945 {
947 ListConstIteratorSafe< Val > iter3{iter2};
948
949 for (; iter1 != iter3; ++iter3, ++res) {}
950
951 return res;
952 }
Safe const iterators for Lists.
Definition list.h:2005
std::ptrdiff_t difference_type
Types for STL compliance.
Definition list.h:2015

References operator-().

Here is the call graph for this function:

◆ operator/()

INLINE Formula gum::operator/ ( const Formula & a,
const Formula & b )

Definition at line 257 of file formula_inl.h.

257 {
258 return Formula(std::to_string(a.result() / b.result()));
259 }

References gum::Formula::Formula(), operator/(), and gum::Formula::result().

Referenced by operator/(), and operator/().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator<<() [1/48]

GUM_SHARED_PUBLIC gum::SetInst & gum::operator<< ( gum::SetInst & inst,
const gum::DiscreteVariable & i )

Adds a variable to inst.

Parameters
instThe SetInst to which a variable is added.
iThe variable to add.
Returns
Returns a reference over inst.
Exceptions
DuplicateElementIf i is already in the SetInst.

References operator<<().

Here is the call graph for this function:

◆ operator<<() [2/48]

template<typename GUM_ELEMENT>
MultiDimImplementation< GUM_ELEMENT > & gum::operator<< ( MultiDimImplementation< GUM_ELEMENT > & array,
const DiscreteVariable & v )

Definition at line 127 of file multiDimImplementation_tpl.h.

149 {
150 array.add(v);
151 return array;
152 }
void add(const DiscreteVariable &v) override
Adds a new var to the variables of the multidimensional matrix.

◆ operator<<() [3/48]

template<typename T1, typename T2>
std::ostream & gum::operator<< ( std::ostream & stream,
const Bijection< T1, T2 > & bijection )

For friendly display of the content of the gum::Bijection.

Parameters
bijectionThe gum::Bijection to display.
Template Parameters
T1The first type of elements in the gum::Bjection.
T2The second type of elements in the gum::Bjection.
Returns
The stream in which the gum::Bijection is displayed.

Definition at line 1083 of file bijection_tpl.h.

1083 {
1084 stream << b.toString();
1085 return stream;
1086 }

References operator<<(), and gum::BijectionImplementation< T1, T2, Gen >::toString().

Here is the call graph for this function:

◆ operator<<() [4/48]

GUM_SHARED_PUBLIC std::ostream & gum::operator<< ( std::ostream & ,
const CliqueGraph &  )

for friendly displaying the content of clique graphs

References operator<<().

Here is the call graph for this function:

◆ operator<<() [5/48]

template<typename T_VAL>
std::ostream & gum::operator<< ( std::ostream & ,
const ContinuousVariable< T_VAL > &  )

for friendly displaying the content of the variable

◆ operator<<() [6/48]

GUM_SHARED_PUBLIC std::ostream & gum::operator<< ( std::ostream & ,
const DiscreteVariable &  )

for friendly displaying the content of the variable

References operator<<().

Here is the call graph for this function:

◆ operator<<() [7/48]

GUM_SHARED_PUBLIC std::ostream & gum::operator<< ( std::ostream & stream,
const EdgeGraphPart & set )

for friendly displaying the content of an edge set

Definition at line 167 of file edgeGraphPart.cpp.

167 {
168 stream << set.toString();
169 return stream;
170 }
virtual std::string toString() const
to friendly display the content of the EdgeGraphPart

References operator<<(), and gum::EdgeGraphPart::toString().

Here is the call graph for this function:

◆ operator<<() [8/48]

template<typename Val, typename Cmp>
std::ostream & gum::operator<< ( std::ostream & stream,
const Heap< Val, Cmp > & heap )

Definition at line 310 of file heap_tpl.h.

310 {
311 stream << heap.toString();
312 return stream;
313 }
std::string toString() const
Definition heap_tpl.h:292

References operator<<(), and gum::Heap< Val, Cmp >::toString().

Here is the call graph for this function:

◆ operator<<() [9/48]

template<typename Key, typename Data>
std::ostream & gum::operator<< ( std::ostream & ,
const IndexedTree< Key, Data > &  )

Necessary for the hashtable operator <<.

References operator<<().

Here is the call graph for this function:

◆ operator<<() [10/48]

GUM_SHARED_PUBLIC std::ostream & gum::operator<< ( std::ostream & aStream,
const Instantiation & i )

Print information of the instantiation in the stream.

Definition at line 273 of file instantiation.cpp.

273 {
274 aStream << i.toString();
275 return aStream;
276 }
std::string toString() const
Give a string version of instantiation.

References operator<<(), and gum::Instantiation::toString().

Here is the call graph for this function:

◆ operator<<() [11/48]

GUM_SHARED_PUBLIC std::ostream & gum::operator<< ( std::ostream & stream,
const NodeGraphPart & set )

for friendly displaying the content of node set

Definition at line 208 of file nodeGraphPart.cpp.

208 {
209 stream << set.toString();
210 return stream;
211 }
virtual std::string toString() const
a function to display the set of nodes

References operator<<(), and gum::NodeGraphPart::toString().

Here is the call graph for this function:

◆ operator<<() [12/48]

template<typename Val, typename Priority, typename Cmp>
std::ostream & gum::operator<< ( std::ostream & stream,
const PriorityQueue< Val, Priority, Cmp > & queue )

Definition at line 1032 of file priorityQueue_tpl.h.

1032 {
1033 stream << queue.toString();
1034 return stream;
1035 }
std::string toString() const
Displays the content of the queue.

References operator<<(), and gum::PriorityQueueImplementation< Val, Priority, Cmp, Gen >::toString().

Here is the call graph for this function:

◆ operator<<() [13/48]

template<typename Key>
std::ostream & gum::operator<< ( std::ostream & stream,
const Set< Key > & set )

A << operator for HashTableList.

Definition at line 716 of file set_tpl.h.

716 {
717 stream << set.toString();
718 return stream;
719 }
std::string toString() const
Prints the content of the set.
Definition set_tpl.h:693

References operator<<(), and gum::Set< Key >::toString().

Here is the call graph for this function:

◆ operator<<() [14/48]

GUM_SHARED_PUBLIC std::ostream & gum::operator<< ( std::ostream & ,
const SetInst &  )

Print information of the SetInst in the stream.

References operator<<().

Here is the call graph for this function:

◆ operator<<() [15/48]

GUM_SHARED_PUBLIC std::ostream & gum::operator<< ( std::ostream & ,
const VariableNodeMap &  )

for friendly displaying the content of clique graphs

References operator<<().

Here is the call graph for this function:

◆ operator<<() [16/48]

INLINE std::ostream & gum::operator<< ( std::ostream & os,
const Formula & f )

Definition at line 265 of file formula_inl.h.

265 {
266 os << f.result();
267 return os;
268 }

References operator<<(), and gum::Formula::result().

Here is the call graph for this function:

◆ operator<<() [17/48]

INLINE std::ostream & gum::operator<< ( std::ostream & os,
const Timer & t )

Definition at line 95 of file timer_inl.h.

95{ return os << t.toString(); }
std::string toString() const
Returns the delta time between now and the last reset() in a human format.
Definition timer.cpp:83

References operator<<(), and gum::Timer::toString().

Here is the call graph for this function:

◆ operator<<() [18/48]

template<GUM_Numeric GUM_SCALAR>
std::ostream & gum::operator<< ( std::ostream & out,
const DecisionTensor< GUM_SCALAR > & array )

Definition at line 217 of file decisionTensor_tpl.h.

217 {
218 out << array.toString();
219 return out;
220 }
virtual std::string toString() const

References operator<<(), and gum::DecisionTensor< GUM_SCALAR >::toString().

Here is the call graph for this function:

◆ operator<<() [19/48]

template<typename GUM_ELEMENT>
std::ostream & gum::operator<< ( std::ostream & out,
const MultiDimContainer< GUM_ELEMENT > & array )

Definition at line 314 of file multiDimContainer_tpl.h.

314 {
315 out << array.toString();
316 return out;
317 }
virtual std::string toString() const
Returns a representation of this MultiDimContainer.

◆ operator<<() [20/48]

template<typename Element>
INLINE std::ostream & gum::operator<< ( std::ostream & out,
const SplayBinaryNode< Element > & e )

Display the node.

Friendly to display.

Definition at line 794 of file splay_tpl.h.

794 {
795 if (e.fg) out << *e.fg << ",";
796
797 out << e.elt;
798
799 if (e.fd) out << "," << *e.fd;
800
801 return out;
802 }
SplayBinaryNode * fg
The left child.
Definition splay.h:214
SplayBinaryNode * fd
The right child.
Definition splay.h:217
Element elt
The content.
Definition splay.h:208

◆ operator<<() [21/48]

template<typename Element>
std::ostream & gum::operator<< ( std::ostream & out,
const SplayBinaryNode< Element > & e )

Display the node.

Friendly to display.

Definition at line 794 of file splay_tpl.h.

794 {
795 if (e.fg) out << *e.fg << ",";
796
797 out << e.elt;
798
799 if (e.fd) out << "," << *e.fd;
800
801 return out;
802 }

◆ operator<<() [22/48]

template<typename Element>
INLINE std::ostream & gum::operator<< ( std::ostream & out,
const SplayTree< Element > & s )

Display the tree.

Friendly to display.

Definition at line 807 of file splay_tpl.h.

807 {
808 out << "|[";
809
810 if (s.root) out << *s.root;
811
812 out << "]|";
813
814 return out;
815 }
SplayBinaryNode< Element > * root
Root of the tree.
Definition splay.h:434

◆ operator<<() [23/48]

template<typename Element>
std::ostream & gum::operator<< ( std::ostream & out,
const SplayTree< Element > & s )

Display the tree.

Friendly to display.

Definition at line 807 of file splay_tpl.h.

807 {
808 out << "|[";
809
810 if (s.root) out << *s.root;
811
812 out << "]|";
813
814 return out;
815 }

◆ operator<<() [24/48]

template<GUM_Numeric GUM_SCALAR>
std::ostream & gum::operator<< ( std::ostream & out,
const Tensor< GUM_SCALAR > & array )

Definition at line 752 of file tensor_tpl.h.

752 {
753 out << array.toString();
754 return out;
755 }

References operator<<().

Here is the call graph for this function:

◆ operator<<() [25/48]

template<GUM_Numeric GUM_SCALAR>
std::ostream & gum::operator<< ( std::ostream & output,
const BayesNet< GUM_SCALAR > & bn )

Prints map's DAG in output using the Graphviz-dot format.

Definition at line 566 of file BayesNet_tpl.h.

566 {
567 output << bn.toString();
568 return output;
569 }

References operator<<().

Here is the call graph for this function:

◆ operator<<() [26/48]

template<GUM_Numeric GUM_SCALAR>
std::ostream & gum::operator<< ( std::ostream & output,
const IBayesNet< GUM_SCALAR > & bn )

Prints map's DAG in output using the Graphviz-dot format.

Definition at line 314 of file IBayesNet_tpl.h.

314 {
315 output << bn.toString();
316 return output;
317 }
std::string toString() const

References operator<<(), and gum::IBayesNet< GUM_SCALAR >::toString().

Here is the call graph for this function:

◆ operator<<() [27/48]

template<GUM_Numeric GUM_SCALAR>
std::ostream & gum::operator<< ( std::ostream & output,
const IMarkovRandomField< GUM_SCALAR > & mn )

Prints map's graph in output using the Graphviz-dot format.

Definition at line 318 of file IMarkovRandomField_tpl.h.

318 {
319 output << bn.toString();
320 return output;
321 }

References operator<<(), and gum::IMarkovRandomField< GUM_SCALAR >::toString().

Here is the call graph for this function:

◆ operator<<() [28/48]

template<GUM_Numeric GUM_SCALAR>
std::ostream & gum::operator<< ( std::ostream & output,
const KTBN< GUM_SCALAR > & kdbn )

Prints the k-DBN using its toString() description.

Definition at line 1263 of file KTBN_tpl.h.

1263 {
1264 output << kdbn.toString();
1265 return output;
1266 }

References operator<<().

Here is the call graph for this function:

◆ operator<<() [29/48]

template<GUM_Numeric GUM_SCALAR>
std::ostream & gum::operator<< ( std::ostream & output,
const MarkovRandomField< GUM_SCALAR > & mn )

Definition at line 331 of file MarkovRandomField_tpl.h.

331 {
332 output << mn.toString();
333 return output;
334 }

References operator<<().

Here is the call graph for this function:

◆ operator<<() [30/48]

GUM_SHARED_PUBLIC std::ostream & gum::operator<< ( std::ostream & s,
const ArcGraphPart & a )

for friendly displaying the content of arc set

Parameters
sthe stream to which we display the content of a
athe ArcGraphPart to be displayed

Definition at line 198 of file arcGraphPart.cpp.

198 {
199 stream << set.toString();
200 return stream;
201 }

References operator<<(), and gum::ArcGraphPart::toString().

Here is the call graph for this function:

◆ operator<<() [31/48]

template<GUM_Numeric GUM_SCALAR>
std::ostream & gum::operator<< ( std::ostream & s,
const MultiDimLogit< GUM_SCALAR > & ag )

For friendly displaying the content of the array.

Definition at line 129 of file multiDimLogit_tpl.h.

129 {
130 return s << ag.toString();
131 }
std::string toString() const override
Returns the real name of the multiDimArray.

References operator<<(), and gum::MultiDimLogit< GUM_SCALAR >::toString().

Here is the call graph for this function:

◆ operator<<() [32/48]

template<GUM_Numeric GUM_SCALAR>
std::ostream & gum::operator<< ( std::ostream & s,
const MultiDimNoisyAND< GUM_SCALAR > & ag )

For friendly displaying the content of the array.

Definition at line 138 of file multiDimNoisyAND_tpl.h.

138 {
139 return s << ag.toString();
140 }
std::string toString() const override
Returns the real name of the multiDimArray.

References operator<<(), and gum::MultiDimNoisyAND< GUM_SCALAR >::toString().

Here is the call graph for this function:

◆ operator<<() [33/48]

template<GUM_Numeric GUM_SCALAR>
std::ostream & gum::operator<< ( std::ostream & s,
const MultiDimNoisyORCompound< GUM_SCALAR > & ag )

For friendly displaying the content of the array.

Definition at line 151 of file multiDimNoisyORCompound_tpl.h.

151 {
152 return s << ag.toString();
153 }
std::string toString() const override
returns the real name of the multiDimArray

References operator<<(), and gum::MultiDimNoisyORCompound< GUM_SCALAR >::toString().

Here is the call graph for this function:

◆ operator<<() [34/48]

template<GUM_Numeric GUM_SCALAR>
std::ostream & gum::operator<< ( std::ostream & s,
const MultiDimNoisyORNet< GUM_SCALAR > & ag )

For friendly displaying the content of the array.

Definition at line 140 of file multiDimNoisyORNet_tpl.h.

140 {
141 return s << ag.toString();
142 }
std::string toString() const final
Returns the real name of the multiDimArray.

References operator<<(), and gum::MultiDimNoisyORNet< GUM_SCALAR >::toString().

Here is the call graph for this function:

◆ operator<<() [35/48]

GUM_SHARED_PUBLIC std::ostream & gum::operator<< ( std::ostream & stream,
const Arc & arc )

to friendly display an arc

References operator<<().

Here is the call graph for this function:

◆ operator<<() [36/48]

◆ operator<<() [37/48]

GUM_SHARED_PUBLIC std::ostream & gum::operator<< ( std::ostream & stream,
const DiGraph & g )

for friendly displaying the content of directed graphs

Definition at line 109 of file diGraph.cpp.

109 {
110 stream << g.toString();
111 return stream;
112 }
std::string toString() const override
to friendly display the content of the graph
Definition diGraph.cpp:87

References operator<<(), and gum::DiGraph::toString().

Here is the call graph for this function:

◆ operator<<() [38/48]

GUM_SHARED_PUBLIC std::ostream & gum::operator<< ( std::ostream & stream,
const Edge & edge )

to friendly display an edge

References operator<<().

Here is the call graph for this function:

◆ operator<<() [39/48]

template<typename Val>
std::ostream & gum::operator<< ( std::ostream & stream,
const List< Val > & list )

an << operator for List

Definition at line 1966 of file list_tpl.h.

1966 {
1967 stream << list.toString();
1968 return stream;
1969 }
std::string toString() const
Converts a list into a string.
Definition list_tpl.h:1828

References operator<<(), and gum::List< Val >::toString().

Here is the call graph for this function:

◆ operator<<() [40/48]

GUM_SHARED_PUBLIC std::ostream & gum::operator<< ( std::ostream & stream,
const MixedGraph & g )

for friendly displaying the content of directed graphs

Definition at line 123 of file mixedGraph.cpp.

123 {
124 stream << g.toString();
125 return stream;
126 }
std::string toString() const override
to friendly display the content of the MixedGraph

References operator<<(), and gum::MixedGraph::toString().

Here is the call graph for this function:

◆ operator<<() [41/48]

template<typename Val, typename Priority, typename Cmp>
std::ostream & gum::operator<< ( std::ostream & stream,
const MultiPriorityQueue< Val, Priority, Cmp > & queue )

Definition at line 603 of file multiPriorityQueue_tpl.h.

604 {
605 stream << queue.toString();
606 return stream;
607 }
std::string toString() const
Displays the content of the queue.

References operator<<(), and gum::MultiPriorityQueue< Val, Priority, Cmp >::toString().

Here is the call graph for this function:

◆ operator<<() [42/48]

GUM_SHARED_PUBLIC std::ostream & gum::operator<< ( std::ostream & stream,
const PAG & g )

Definition at line 259 of file PAG.cpp.

259 {
260 stream << g.toString();
261 return stream;
262 }
std::string toString() const override
approximate conversion for learnDAG/learnPDAG: Tail-Arrowhead → arc; Arrowhead-Arrowhead → two arcs; ...
Definition PAG.cpp:216

References operator<<(), and gum::PAG::toString().

Here is the call graph for this function:

◆ operator<<() [43/48]

template<typename Key>
std::ostream & gum::operator<< ( std::ostream & stream,
const Sequence< Key > & s )

A << operator for displaying the content of the Sequence.

Definition at line 1068 of file sequence_tpl.h.

1068 {
1069 stream << seq.toString();
1070 return stream;
1071 }

References operator<<(), and gum::SequenceImplementation< Key, Gen >::toString().

Here is the call graph for this function:

◆ operator<<() [44/48]

template<typename Key, bool Gen>
std::ostream & gum::operator<< ( std::ostream & stream,
const SequenceImplementation< Key, Gen > & seq )

Definition at line 577 of file sequence_tpl.h.

577 {
578 stream << seq.toString();
579 return stream;
580 }
std::string toString() const
Displays the content of the sequence.

References operator<<(), and gum::SequenceImplementation< Key, Gen >::toString().

Here is the call graph for this function:

◆ operator<<() [45/48]

template<typename Key>
std::ostream & gum::operator<< ( std::ostream & stream,
const SequenceImplementation< Key, true > & seq )

Definition at line 931 of file sequence_tpl.h.

931 {
932 stream << seq.toString();
933 return stream;
934 }

References operator<<(), and gum::SequenceImplementation< Key, Gen >::toString().

Here is the call graph for this function:

◆ operator<<() [46/48]

template<typename Val, typename Priority, typename Cmp>
std::ostream & gum::operator<< ( std::ostream & stream,
const SortedPriorityQueue< Val, Priority, Cmp > & queue )

display the content of a sorted priority queue

Definition at line 1080 of file sortedPriorityQueue_tpl.h.

1081 {
1082 return stream << queue.toString();
1083 }
std::string toString() const
Displays the content of the queue.

References operator<<(), and gum::SortedPriorityQueue< Val, Priority, Cmp >::toString().

Here is the call graph for this function:

◆ operator<<() [47/48]

GUM_SHARED_PUBLIC std::ostream & gum::operator<< ( std::ostream & stream,
const UndiGraph & g )

for friendly displaying the content of undirected graphs

Definition at line 134 of file undiGraph.cpp.

134 {
135 stream << g.toString();
136 return stream;
137 }
std::string toString() const override
to friendly display the content of the graph
Definition undiGraph.cpp:96

References operator<<(), and gum::UndiGraph::toString().

Here is the call graph for this function:

◆ operator<<() [48/48]

INLINE std::ostream & gum::operator<< ( std::ostream & streamy,
const ActionSet & objy )

Definition at line 115 of file actionSet_inl.h.

115 {
116 streamy << objy._actionSeq_->toString();
117 return streamy;
118 }
Sequence< Idx > * _actionSeq_
The very bone of the ActionSet.
Definition actionSet.h:186

◆ operator==()

bool gum::operator== ( const HashTableIteratorSafe< Key, Val > & from) const
noexcept

Checks whether two iterators are pointing toward equal elements.

Parameters
fromThe gum::HashTableIteratorSafe to test for equality.
Returns
Returns true if this and from are equal.

◆ operator>>()

GUM_SHARED_PUBLIC gum::SetInst & gum::operator>> ( gum::SetInst & inst,
const gum::DiscreteVariable & i )

Removes a variable to inst.

Parameters
instThe SetInst to which a variable is removed.
iThe variable to remove.
Returns
Returns a reference over inst.
Exceptions
NotFoundRaised if i is not found in inst.

References operator>>().

Here is the call graph for this function:

◆ partialInstantiation() [1/2]

template<typename GUM_ELEMENT>
MultiDimImplementation< GUM_ELEMENT > * gum::partialInstantiation ( const MultiDimDecorator< GUM_ELEMENT > & table,
const HashTable< const DiscreteVariable *, Idx > & inst_vars )

Instantiate variables in a MultiDimDecorator.

Parameters
tableThe table to instantiate.
inst_varsThe variables instantiation.
Returns
Returns the partial instantiation of table as a new MultiDimImplementation.

References partialInstantiation(), partialInstantiation4MultiDimInit(), and pointerPartialInstantiation4MultiDimInit().

Here is the call graph for this function:

◆ partialInstantiation() [2/2]

template<typename GUM_ELEMENT>
MultiDimImplementation< GUM_ELEMENT > * gum::partialInstantiation ( const MultiDimImplementation< GUM_ELEMENT > & table,
const HashTable< const DiscreteVariable *, Idx > & inst_vars )

Instantiate variables in a MultiDimImplementation.

Parameters
tableThe table to instantiate.
inst_varsThe variables instantiation.
Returns
Returns the partial instantiation of table as a new MultiDimImplementation.

References partialInstantiation().

Referenced by partialInstantiation(), and partialInstantiation().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ partialInstantiation4MultiDimInit()

template<typename GUM_ELEMENT>
void gum::partialInstantiation4MultiDimInit ( )

The function used to register all the instantiation operators on multidimImplementations over non-pointers types.

Definition at line 117 of file partialInstantiation4MultiDim_tpl.h.

117 {
118 // ensure that only one thread will register the projections
119 static std::once_flag first;
120 std::call_once(first, []() {
121 std::string MultiDimArrayString("MultiDimArray");
122 std::string MultiDimDecisionDiagramString("MultiDimDecisionDiagram");
123 std::string BaseNameString("MultiDimImplementation");
124
125 // register base functions for multiDimArrays
127 MultiDimArrayString,
129
130 // register default basename functions
132 BaseNameString,
133 &partialInstantiationMultiDimImplementation);
134 });
135 }
MultiDimArray< GUM_ELEMENT > * partialInstantiationMultiDimArray(const MultiDimArray< GUM_ELEMENT > *table, const HashTable< const DiscreteVariable *, Idx > &inst_vars)
A specialized function for instantiating variables in a multiDimArray.
void registerPartialInstantiation(std::string_view instantiation_func_name, std::string_view type_multidim, typename PartialInstantiationRegister4MultiDim< GUM_ELEMENT >::PartialInstantiationPtr function)
A function to more easily register new instantiation functions in MultiDims.

References partialInstantiation4MultiDimInit(), partialInstantiationMultiDimArray(), and registerPartialInstantiation().

Referenced by gum::PartialInstantiation4MultiDimInitialize< GUM_ELEMENT >::init(), partialInstantiation(), and partialInstantiation4MultiDimInit().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ partialInstantiationMultiDimArray() [1/2]

template<typename GUM_ELEMENT>
MultiDimArray< GUM_ELEMENT > * gum::partialInstantiationMultiDimArray ( const MultiDimArray< GUM_ELEMENT > * table,
const HashTable< const DiscreteVariable *, Idx > & inst_vars )

A specialized function for instantiating variables in a multiDimArray.

Warning
In practice, do not use this function but rather operator/function partialInstantiation on multiDimDecorators. This operator will take care to select this function if it is appropriate for your instantiation.

The function instantiates some variables in a multiDimArray. For instance, if table is a MultiDimArray defined over A,B,C,D and if inst_vars = {<A=a1>,<C=c2>}, then the function returns a table over B,D defined as table (a1,B,c2,D).

Parameters
tableThe table to instantiate.
inst_varsThe variables instantiation.
Returns
Returns the partial instantiation of table as a new MultiDimArray.

References partialInstantiationMultiDimArray().

Referenced by partialInstantiation4MultiDimInit(), partialInstantiationMultiDimArray(), and partialInstantiationMultiDimArray().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ partialInstantiationMultiDimArray() [2/2]

template<typename GUM_ELEMENT>
MultiDimImplementation< GUM_ELEMENT > * gum::partialInstantiationMultiDimArray ( const MultiDimImplementation< GUM_ELEMENT > * table,
const HashTable< const DiscreteVariable *, Idx > & inst_vars )

A specialized function for instantiating variables in a MultiDimImplementation.

Warning
In practice, do not use this function but rather operator/function partialInstantiation on multiDimDecorators. This operator will take care to select this function if it is appropriate for your instantiation.

The function instantiates some variables in a multiDimArray. For instance, if table is a MultiDimArray defined over A,B,C,D and if inst_vars = {<A=a1>,<C=c2>}, then the function returns a table over B,D defined as table (a1,B,c2,D).

Parameters
tableThe table to instantiate.
inst_varsThe variables instantiation.
Returns
Returns the partial instantiation of table as a new MultiDimImplementation.

References partialInstantiationMultiDimArray().

Here is the call graph for this function:

◆ partialInstantiationMultiDimArray4Pointers() [1/2]

template<typename GUM_ELEMENT>
MultiDimArray< GUM_ELEMENT * > * gum::partialInstantiationMultiDimArray4Pointers ( const MultiDimArray< GUM_ELEMENT * > * table,
const HashTable< const DiscreteVariable *, Idx > & inst_vars )

A specialized function for instantiating variables in a MultiDimArray.

Warning
In practice, do not use this function but rather operator/function partialInstantiation on multiDimDecorators. This operator will take care to select this function if it is appropriate for your instantiation.

The function instantiates some variables in a multiDimArray. For instance, if table is a MultiDimArray defined over A,B,C,D and if inst_vars = {<A=a1>,<C=c2>}, then the function returns a table over B,D defined as table (a1,B,c2,D).

Parameters
tableThe table to instantiate.
inst_varsThe variables instantiation.
Returns
Returns the partial instantiation of table as a new MultiDimArray.

References partialInstantiationMultiDimArray4Pointers().

Referenced by partialInstantiationMultiDimArray4Pointers(), partialInstantiationMultiDimArray4Pointers(), and pointerPartialInstantiation4MultiDimInit().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ partialInstantiationMultiDimArray4Pointers() [2/2]

template<typename GUM_ELEMENT>
MultiDimImplementation< GUM_ELEMENT * > * gum::partialInstantiationMultiDimArray4Pointers ( const MultiDimImplementation< GUM_ELEMENT * > * table,
const HashTable< const DiscreteVariable *, Idx > & inst_vars )

A specialized function for instantiating variables in a MultiDimArray.

Warning
In practice, do not use this function but rather operator/function partialInstantiation on multiDimDecorators. This operator will take care to select this function if it is appropriate for your instantiation.

The function instantiates some variables in a multiDimArray. For instance, if table is a MultiDimArray defined over A,B,C,D and if inst_vars = {<A=a1>,<C=c2>}, then the function returns a table over B,D defined as table (a1,B,c2,D).

Parameters
tableThe table to instantiate.
inst_varsThe variables instantiation.
Returns
Returns the partial instantiation of table as a new MultiDimImplementation.

References partialInstantiationMultiDimArray4Pointers().

Here is the call graph for this function:

◆ pointerPartialInstantiation4MultiDimInit()

template<typename GUM_ELEMENT>
void gum::pointerPartialInstantiation4MultiDimInit ( )

The function used to register all the instantiations on multidimImplementations over pointers types.

Definition at line 139 of file partialInstantiation4MultiDim_tpl.h.

139 {
140 // ensure that only one thread will register the projections
141 static std::once_flag first;
142 std::call_once(first, []() {
143 std::string MultiDimArrayString("MultiDimArray");
144 std::string BaseNameString("MultiDimImplementation");
145
146 // register base functions for multiDimArrays
148 MultiDimArrayString,
150
151 // register default basename functions
153 "i",
154 BaseNameString,
155 &partialInstantiationMultiDimImplementation4Pointers);
156 });
157 }
MultiDimArray< GUM_ELEMENT * > * partialInstantiationMultiDimArray4Pointers(const MultiDimArray< GUM_ELEMENT * > *table, const HashTable< const DiscreteVariable *, Idx > &inst_vars)
A specialized function for instantiating variables in a MultiDimArray.

References partialInstantiationMultiDimArray4Pointers(), pointerPartialInstantiation4MultiDimInit(), and registerPartialInstantiation().

Referenced by gum::PartialInstantiation4MultiDimInitialize< GUM_ELEMENT * >::init(), partialInstantiation(), and pointerPartialInstantiation4MultiDimInit().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pointerProjections4MultiDimInit()

template<typename GUM_ELEMENT>
void gum::pointerProjections4MultiDimInit ( )

the function used to register all the projections on multidimImplementations over pointers types.

References pointerProjections4MultiDimInit().

Referenced by pointerProjections4MultiDimInit().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ print_output()

void gum::print_output ( std::vector< FormulaPart > v)

Definition at line 77 of file formula.cpp.

77 {
78 std::cout << "Output: ";
79 for (const auto& elt: v) {
80 std::cout << elt.str() << " ";
81 }
82 std::cout << std::endl;
83 }

References print_output().

Referenced by print_output().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ print_stack()

void gum::print_stack ( std::stack< FormulaPart > s)

Definition at line 61 of file formula.cpp.

61 {
62 std::cout << std::endl;
63 std::list< FormulaPart > l;
64 while (!s.empty()) {
65 l.push_front(s.top());
66 s.pop();
67 }
68
69 std::cout << "Stack: ";
70 for (const auto& elt: l) {
71 std::cout << elt.str() << " ";
72 }
73 std::cout << std::endl;
74 }

References print_stack().

Referenced by print_stack().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ productOfTrees()

template<GUM_Numeric GUM_SCALAR>
std::unique_ptr< ASTtree< GUM_SCALAR > > gum::productOfTrees ( std::vector< std::unique_ptr< ASTtree< GUM_SCALAR > > > && lterms)

Build a product AST from a list of terms.

Consumes the vector of unique_ptrs and returns a single AST representing their Elementwise product (e.g., left-associated chain of ASTmult nodes).

Parameters
ltermslist of term nodes (ownership transferred)
Returns
product AST

Definition at line 633 of file doAST_tpl.h.

633 {
634 if (lterms.empty()) { GUM_ERROR(InvalidArgument, "productOfTrees requires at least one term"); }
635
636 auto it = lterms.begin();
637 auto end = lterms.end();
638
639 // Take the first term as accumulator
640 std::unique_ptr< ASTtree< GUM_SCALAR > > acc = std::move(*it);
641 ++it;
642
643 // Left-associate: (((t1 * t2) * t3) * ...)
644 for (; it != end; ++it) {
645 acc = std::make_unique< ASTmult< GUM_SCALAR > >(std::move(acc), std::move(*it));
646 }
647 return acc;
648 }

References GUM_ERROR, and productOfTrees().

Referenced by gum::DoCalculus< GUM_SCALAR >::getBackDoorTree(), and productOfTrees().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ productOfTrees< double >()

template std::unique_ptr< gum::ASTtree< double > > gum::productOfTrees< double > ( std::vector< std::unique_ptr< ASTtree< double > > > && )
extern

References productOfTrees< double >().

Referenced by productOfTrees< double >().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ProjectFuncMultiDimArray()

template<typename GUM_ELEMENT>
MultiDimArray< GUM_ELEMENT > * gum::ProjectFuncMultiDimArray ( const MultiDimArray< GUM_ELEMENT > * t1,
const MultiDimArray< GUM_ELEMENT > * t2,
const GUM_ELEMENT(* f )(const GUM_ELEMENT &, const GUM_ELEMENT &) )

a specialized function for functionally projecting a multiDimArray

The function produces a tensorial functional combination of t1 and t2, that is, if t1 and t2 are multiDimArrays over variables A,B,C,D and D,B,E respectively, function combine2MultiDimArrays will return a multiDimArray T defined as T[A,B,C,D,E] = f ( t1[A,B,C,D],t2[D,B,E] ) for all A,B,C,D,E.

Returns
function combine2MultiDimArrays allocates on the heap the new T multiDimArray and returns it.

References ProjectFuncMultiDimArray().

Referenced by ProjectFuncMultiDimArray().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ projections4MultiDimInit()

template<typename GUM_ELEMENT>
void gum::projections4MultiDimInit ( )

the function used to register all the projection operators on multidimImplementations over non-pointers types.

References projections4MultiDimInit().

Referenced by projections4MultiDimInit().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ projectMax() [1/2]

template<typename GUM_ELEMENT>
MultiDimImplementation< GUM_ELEMENT > * gum::projectMax ( const MultiDimImplementation< GUM_ELEMENT > & table,
const gum::VariableSet & del_vars )

The function to be used to project a MultiDimImplementation using a Max.

References projectMax().

Here is the call graph for this function:

◆ projectMax() [2/2]

template<typename GUM_ELEMENT>
GUM_ELEMENT gum::projectMax ( const MultiDimImplementation< GUM_ELEMENT > & table,
Instantiation * instantiation = 0 )

the function to be used to project a MultiDimImplementation using a Max

References projectMax().

Referenced by gum::Tensor< GUM_SCALAR >::maxIn(), gum::Tensor< GUM_SCALAR >::maxOut(), projectMax(), and projectMax().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ projectMaxMultiDimFunctionGraph() [1/2]

template<typename GUM_ELEMENT>
MultiDimFunctionGraph< GUM_ELEMENT > * gum::projectMaxMultiDimFunctionGraph ( const MultiDimFunctionGraph< GUM_ELEMENT > * table,
const gum::VariableSet & del_vars )

a specialized function for projecting a multiDimFunctionGraph using a Max operator

The function projects a table over the subset of its variables NOT IN the set of variables del_vars. For instance, if table is a MultiDimFunctionGraph defined over A,B,C,D and if del_vars = {A,C}, then the function returns a table over B,D defined as Max_{A,C} table (A,B,C,D).

Returns
function ProjectMaxMultiDimFunctionGraph allocates on the heap the new T multiDimFunctionGraph and returns it
Warning
In practice, do not use this function but rather operator/function projectMax on MultiDimImplementation. This operator will take care to select this function if it is appropriate for your projection.

References projectMaxMultiDimFunctionGraph().

Referenced by projectMaxMultiDimFunctionGraph(), and projectMaxMultiDimFunctionGraph().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ projectMaxMultiDimFunctionGraph() [2/2]

template<typename GUM_ELEMENT>
MultiDimImplementation< GUM_ELEMENT > * gum::projectMaxMultiDimFunctionGraph ( const MultiDimImplementation< GUM_ELEMENT > * table,
const gum::VariableSet & del_vars )

a specialized function for projecting a multiDimFunctionGraph using a Max operator

The function projects a table over the subset of its variables NOT IN the set of variables del_vars. For instance, if table is a MultiDimFunctionGraph defined over A,B,C,D and if del_vars = {A,C}, then the function returns a table over B,D defined as Max_{A,C} table (A,B,C,D).

Returns
function ProjectMaxMultiDimFunctionGraph allocates on the heap the new T multiDimFunctionGraph and returns it
Warning
In practice, do not use this function but rather operator/function projectMax on MultiDimImplementation. This operator will take care to select this function if it is appropriate for your projection.

References projectMaxMultiDimFunctionGraph().

Here is the call graph for this function:

◆ projectMin() [1/2]

template<typename GUM_ELEMENT>
MultiDimImplementation< GUM_ELEMENT > * gum::projectMin ( const MultiDimImplementation< GUM_ELEMENT > & table,
const gum::VariableSet & del_vars )

The function to be used to project a MultiDimImplementation using a Min.

References projectMin().

Here is the call graph for this function:

◆ projectMin() [2/2]

template<typename GUM_ELEMENT>
GUM_ELEMENT gum::projectMin ( const MultiDimImplementation< GUM_ELEMENT > & table,
Instantiation * instantiation = 0 )

the function to be used to project a MultiDimImplementation using a Min

References projectMin().

Referenced by gum::Tensor< GUM_SCALAR >::minIn(), gum::Tensor< GUM_SCALAR >::minOut(), projectMin(), and projectMin().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ projectMinMultiDimArray() [1/2]

template<typename GUM_ELEMENT>
MultiDimArray< GUM_ELEMENT > * gum::projectMinMultiDimArray ( const MultiDimArray< GUM_ELEMENT > * table,
const gum::VariableSet & del_vars )

a specialized function for projecting a multiDimArray using a Min operator

The function projects a table over the subset of its variables NOT IN the set of variables del_vars. For instance, if table is a MultiDimArray defined over A,B,C,D and if del_vars = {A,C}, then the function returns a table over B,D defined as Min_{A,C} table (A,B,C,D).

Returns
function ProjectMaxMultiDimArrays allocates on the heap the new T multiDimArray and returns it
Warning
In practice, do not use this function but rather operator/function projectMin on MultiDimImplementation. This operator will take care to select this function if it is appropriate for your projection.

References projectMinMultiDimArray().

Here is the call graph for this function:

◆ projectMinMultiDimArray() [2/2]

template<typename GUM_ELEMENT>
MultiDimImplementation< GUM_ELEMENT > * gum::projectMinMultiDimArray ( const MultiDimImplementation< GUM_ELEMENT > * table,
const gum::VariableSet & del_vars )

a specialized function for projecting a multiDimArray using a Min operator

The function projects a table over the subset of its variables NOT IN the set of variables del_vars. For instance, if table is a MultiDimArray defined over A,B,C,D and if del_vars = {A,C}, then the function returns a table over B,D defined as Min_{A,C} table (A,B,C,D).

Returns
function ProjectMaxMultiDimArrays allocates on the heap the new T multiDimArray and returns it
Warning
In practice, do not use this function but rather operator/function projectMin on MultiDimImplementation. This operator will take care to select this function if it is appropriate for your projection.

References projectMinMultiDimArray().

Here is the call graph for this function:

◆ projectMinMultiDimArray4Pointers() [1/2]

template<typename GUM_ELEMENT>
MultiDimArray< GUM_ELEMENT * > * gum::projectMinMultiDimArray4Pointers ( const MultiDimArray< GUM_ELEMENT * > * table,
const gum::VariableSet & del_vars )

a specialized function for projecting a multiDimArray using a Min operator

The function projects a table over the subset of its variables NOT IN the set of variables del_vars. For instance, if table is a MultiDimArray defined over A,B,C,D and if del_vars = {A,C}, then the function returns a table over B,D defined as Min_{A,C} table (A,B,C,D).

Returns
function ProjectMaxMultiDimArrays allocates on the heap the new T multiDimArray and returns it
Warning
In practice, do not use this function but rather operator/function projectMin on MultiDimImplementation. This operator will take care to select this function if it is appropriate for your projection.

References projectMinMultiDimArray4Pointers().

Here is the call graph for this function:

◆ projectMinMultiDimArray4Pointers() [2/2]

template<typename GUM_ELEMENT>
MultiDimImplementation< GUM_ELEMENT * > * gum::projectMinMultiDimArray4Pointers ( const MultiDimImplementation< GUM_ELEMENT * > * table,
const gum::VariableSet & del_vars )

a specialized function for projecting a multiDimArray using a Min operator

The function projects a table over the subset of its variables NOT IN the set of variables del_vars. For instance, if table is a MultiDimArray defined over A,B,C,D and if del_vars = {A,C}, then the function returns a table over B,D defined as Min_{A,C} table (A,B,C,D).

Returns
function ProjectMaxMultiDimArrays allocates on the heap the new T multiDimArray and returns it
Warning
In practice, do not use this function but rather operator/function projectMin on MultiDimImplementation. This operator will take care to select this function if it is appropriate for your projection.

References projectMinMultiDimArray4Pointers().

Here is the call graph for this function:

◆ projectMinMultiDimFunctionGraph() [1/2]

template<typename GUM_ELEMENT>
MultiDimFunctionGraph< GUM_ELEMENT > * gum::projectMinMultiDimFunctionGraph ( const MultiDimFunctionGraph< GUM_ELEMENT > * table,
const gum::VariableSet & del_vars )

a specialized function for projecting a multiDimFunctionGraph using a Min operator

The function projects a table over the subset of its variables NOT IN the set of variables del_vars. For instance, if table is a MultiDimFunctionGraph defined over A,B,C,D and if del_vars = {A,C}, then the function returns a table over B,D defined as Min_{A,C} table (A,B,C,D).

Returns
function ProjectMaxMultiDimFunctionGraphs allocates on the heap the new T multiDimFunctionGraph and returns it
Warning
In practice, do not use this function but rather operator/function projectMin on MultiDimImplementation. This operator will take care to select this function if it is appropriate for your projection.

References projectMinMultiDimFunctionGraph().

Referenced by projectMinMultiDimFunctionGraph(), and projectMinMultiDimFunctionGraph().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ projectMinMultiDimFunctionGraph() [2/2]

template<typename GUM_ELEMENT>
MultiDimImplementation< GUM_ELEMENT > * gum::projectMinMultiDimFunctionGraph ( const MultiDimImplementation< GUM_ELEMENT > * table,
const gum::VariableSet & del_vars )

a specialized function for projecting a multiDimFunctionGraph using a Min operator

The function projects a table over the subset of its variables NOT IN the set of variables del_vars. For instance, if table is a MultiDimFunctionGraph defined over A,B,C,D and if del_vars = {A,C}, then the function returns a table over B,D defined as Min_{A,C} table (A,B,C,D).

Returns
function ProjectMaxMultiDimFunctionGraphs allocates on the heap the new T multiDimFunctionGraph and returns it
Warning
In practice, do not use this function but rather operator/function projectMin on MultiDimImplementation. This operator will take care to select this function if it is appropriate for your projection.

References projectMinMultiDimFunctionGraph().

Here is the call graph for this function:

◆ projectProduct() [1/2]

template<typename GUM_ELEMENT>
MultiDimImplementation< GUM_ELEMENT > * gum::projectProduct ( const MultiDimImplementation< GUM_ELEMENT > & table,
const gum::VariableSet & del_vars )

The function to be used to project a MultiDimImplementation using a Product.

References projectProduct().

Here is the call graph for this function:

◆ projectProduct() [2/2]

template<typename GUM_ELEMENT>
GUM_ELEMENT gum::projectProduct ( const MultiDimImplementation< GUM_ELEMENT > & table,
Instantiation * instantiation = 0 )

the function to be used to project a MultiDimImplementation using a Product

References projectProduct().

Referenced by gum::Tensor< GUM_SCALAR >::prodIn(), gum::Tensor< GUM_SCALAR >::prodOut(), projectProduct(), and projectProduct().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ projectProductMultiDimArray() [1/2]

template<typename GUM_ELEMENT>
MultiDimArray< GUM_ELEMENT > * gum::projectProductMultiDimArray ( const MultiDimArray< GUM_ELEMENT > * table,
const gum::VariableSet & del_vars )

a specialized function for projecting a multiDimArray using products

The function projects a table over the subset of its variables NOT IN the set of variables del_vars. For instance, if table is a MultiDimArray defined over A,B,C,D and if del_vars = {A,C}, then the function returns a table over B,D defined as Prod_{A,C} table (A,B,C,D).

Returns
function ProjectMaxMultiDimArrays allocates on the heap the new T multiDimArray and returns it
Warning
In practice, do not use this function but rather operator/function projectProduct on MultiDimImplementation. This operator will take care to select this function if it is appropriate for your projection.

References projectProductMultiDimArray().

Here is the call graph for this function:

◆ projectProductMultiDimArray() [2/2]

template<typename GUM_ELEMENT>
MultiDimImplementation< GUM_ELEMENT > * gum::projectProductMultiDimArray ( const MultiDimImplementation< GUM_ELEMENT > * table,
const gum::VariableSet & del_vars )

a specialized function for projecting a multiDimArray using products

The function projects a table over the subset of its variables NOT IN the set of variables del_vars. For instance, if table is a MultiDimArray defined over A,B,C,D and if del_vars = {A,C}, then the function returns a table over B,D defined as Prod_{A,C} table (A,B,C,D).

Returns
function ProjectMaxMultiDimArrays allocates on the heap the new T multiDimArray and returns it
Warning
In practice, do not use this function but rather operator/function projectProduct on MultiDimImplementation. This operator will take care to select this function if it is appropriate for your projection.

References projectProductMultiDimArray().

Here is the call graph for this function:

◆ projectProductMultiDimArray4Pointers() [1/2]

template<typename GUM_ELEMENT>
MultiDimArray< GUM_ELEMENT * > * gum::projectProductMultiDimArray4Pointers ( const MultiDimArray< GUM_ELEMENT * > * table,
const gum::VariableSet & del_vars )

a specialized function for projecting a multiDimArray using products

The function projects a table over the subset of its variables NOT IN the set of variables del_vars. For instance, if table is a MultiDimArray defined over A,B,C,D and if del_vars = {A,C}, then the function returns a table over B,D defined as Prod_{A,C} table (A,B,C,D).

Returns
function ProjectMaxMultiDimArrays allocates on the heap the new T multiDimArray and returns it
Warning
In practice, do not use this function but rather operator/function projectProduct on MultiDimImplementation. This operator will take care to select this function if it is appropriate for your projection.

References projectProductMultiDimArray4Pointers().

Here is the call graph for this function:

◆ projectProductMultiDimArray4Pointers() [2/2]

template<typename GUM_ELEMENT>
MultiDimImplementation< GUM_ELEMENT * > * gum::projectProductMultiDimArray4Pointers ( const MultiDimImplementation< GUM_ELEMENT * > * table,
const gum::VariableSet & del_vars )

a specialized function for projecting a multiDimArray using products

The function projects a table over the subset of its variables NOT IN the set of variables del_vars. For instance, if table is a MultiDimArray defined over A,B,C,D and if del_vars = {A,C}, then the function returns a table over B,D defined as Prod_{A,C} table (A,B,C,D).

Returns
function ProjectMaxMultiDimArrays allocates on the heap the new T multiDimArray and returns it
Warning
In practice, do not use this function but rather operator/function projectProduct on MultiDimImplementation. This operator will take care to select this function if it is appropriate for your projection.

References projectProductMultiDimArray4Pointers().

Here is the call graph for this function:

◆ projectProductMultiDimFunctionGraph() [1/2]

template<typename GUM_ELEMENT>
MultiDimFunctionGraph< GUM_ELEMENT > * gum::projectProductMultiDimFunctionGraph ( const MultiDimFunctionGraph< GUM_ELEMENT > * table,
const gum::VariableSet & del_vars )

a specialized function for projecting a multiDimFunctionGraph using products

The function projects a table over the subset of its variables NOT IN the set of variables del_vars. For instance, if table is a MultiDimFunctionGraph defined over A,B,C,D and if del_vars = {A,C}, then the function returns a table over B,D defined as Prod_{A,C} table (A,B,C,D).

Returns
function ProjectMaxMultiDimFunctionGraphs allocates on the heap the new T multiDimFunctionGraph and returns it
Warning
In practice, do not use this function but rather operator/function projectProduct on MultiDimImplementation. This operator will take care to select this function if it is appropriate for your projection.

References projectProductMultiDimFunctionGraph().

Referenced by projectProductMultiDimFunctionGraph(), and projectProductMultiDimFunctionGraph().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ projectProductMultiDimFunctionGraph() [2/2]

template<typename GUM_ELEMENT>
MultiDimImplementation< GUM_ELEMENT > * gum::projectProductMultiDimFunctionGraph ( const MultiDimImplementation< GUM_ELEMENT > * table,
const gum::VariableSet & del_vars )

a specialized function for projecting a multiDimFunctionGraph using products

The function projects a table over the subset of its variables NOT IN the set of variables del_vars. For instance, if table is a MultiDimFunctionGraph defined over A,B,C,D and if del_vars = {A,C}, then the function returns a table over B,D defined as Prod_{A,C} table (A,B,C,D).

Returns
function ProjectMaxMultiDimFunctionGraphs allocates on the heap the new T multiDimFunctionGraph and returns it
Warning
In practice, do not use this function but rather operator/function projectProduct on MultiDimImplementation. This operator will take care to select this function if it is appropriate for your projection.

References projectProductMultiDimFunctionGraph().

Here is the call graph for this function:

◆ projectSum() [1/2]

template<typename GUM_ELEMENT>
MultiDimImplementation< GUM_ELEMENT > * gum::projectSum ( const MultiDimImplementation< GUM_ELEMENT > & table,
const gum::VariableSet & del_vars )

The function to be used to project a MultiDimImplementation using a Sum.

References projectSum().

Here is the call graph for this function:

◆ projectSum() [2/2]

template<typename GUM_ELEMENT>
GUM_ELEMENT gum::projectSum ( const MultiDimImplementation< GUM_ELEMENT > & table,
Instantiation * instantiation = 0 )

the function to be used to project a MultiDimImplementation using a sum

References projectSum().

Referenced by projectSum(), projectSum(), and gum::Tensor< GUM_SCALAR >::sumIn().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ projectSumMultiDimArray() [1/2]

template<typename GUM_ELEMENT>
MultiDimArray< GUM_ELEMENT > * gum::projectSumMultiDimArray ( const MultiDimArray< GUM_ELEMENT > * table,
const gum::VariableSet & del_vars )

a specialized function for projecting a multiDimArray using a summation

The function projects a table over the subset of its variables NOT IN the set of variables del_vars. For instance, if table is a MultiDimArray defined over A,B,C,D and if del_vars = {A,C}, then the function returns a table over B,D defined as Sum_{A,C} table (A,B,C,D).

Returns
function ProjectMaxMultiDimArrays allocates on the heap the new T multiDimArray and returns it
Warning
In practice, do not use this function but rather operator/function projectSum on MultiDimImplementation. This operator will take care to select this function if it is appropriate for your projection.

References projectSumMultiDimArray().

Here is the call graph for this function:

◆ projectSumMultiDimArray() [2/2]

template<typename GUM_ELEMENT>
MultiDimImplementation< GUM_ELEMENT > * gum::projectSumMultiDimArray ( const MultiDimImplementation< GUM_ELEMENT > * table,
const gum::VariableSet & del_vars )

a specialized function for projecting a multiDimArray using a summation

The function projects a table over the subset of its variables NOT IN the set of variables del_vars. For instance, if table is a MultiDimArray defined over A,B,C,D and if del_vars = {A,C}, then the function returns a table over B,D defined as Sum_{A,C} table (A,B,C,D).

Returns
function ProjectMaxMultiDimArrays allocates on the heap the new T multiDimArray and returns it
Warning
In practice, do not use this function but rather operator/function projectSum on MultiDimImplementation. This operator will take care to select this function if it is appropriate for your projection.

References projectSumMultiDimArray().

Here is the call graph for this function:

◆ projectSumMultiDimArray4Pointers() [1/2]

template<typename GUM_ELEMENT>
MultiDimArray< GUM_ELEMENT * > * gum::projectSumMultiDimArray4Pointers ( const MultiDimArray< GUM_ELEMENT * > * table,
const gum::VariableSet & del_vars )

a specialized function for projecting a multiDimArray using a summation

The function projects a table over the subset of its variables NOT IN the set of variables del_vars. For instance, if table is a MultiDimArray defined over A,B,C,D and if del_vars = {A,C}, then the function returns a table over B,D defined as Sum_{A,C} table (A,B,C,D).

Returns
function ProjectMaxMultiDimArrays allocates on the heap the new T multiDimArray and returns it
Warning
In practice, do not use this function but rather operator/function projectSum on MultiDimImplementation. This operator will take care to select this function if it is appropriate for your projection.

References projectSumMultiDimArray4Pointers().

Here is the call graph for this function:

◆ projectSumMultiDimArray4Pointers() [2/2]

template<typename GUM_ELEMENT>
MultiDimImplementation< GUM_ELEMENT * > * gum::projectSumMultiDimArray4Pointers ( const MultiDimImplementation< GUM_ELEMENT * > * table,
const gum::VariableSet & del_vars )

a specialized function for projecting a multiDimArray using a summation

The function projects a table over the subset of its variables NOT IN the set of variables del_vars. For instance, if table is a MultiDimArray defined over A,B,C,D and if del_vars = {A,C}, then the function returns a table over B,D defined as Sum_{A,C} table (A,B,C,D).

Returns
function ProjectMaxMultiDimArrays allocates on the heap the new T multiDimArray and returns it
Warning
In practice, do not use this function but rather operator/function projectSum on MultiDimImplementation. This operator will take care to select this function if it is appropriate for your projection.

References projectSumMultiDimArray4Pointers().

Here is the call graph for this function:

◆ projectSumMultiDimFunctionGraph() [1/2]

template<typename GUM_ELEMENT>
MultiDimFunctionGraph< GUM_ELEMENT > * gum::projectSumMultiDimFunctionGraph ( const MultiDimFunctionGraph< GUM_ELEMENT > * table,
const gum::VariableSet & del_vars )

a specialized function for projecting a multiDimFunctionGraph using a summation

The function projects a table over the subset of its variables NOT IN the set of variables del_vars. For instance, if table is a MultiDimFunctionGraph defined over A,B,C,D and if del_vars = {A,C}, then the function returns a table over B,D defined as Sum_{A,C} table (A,B,C,D).

Returns
function ProjectMaxMultiDimFunctionGraphs allocates on the heap the new T multiDimFunctionGraph and returns it
Warning
In practice, do not use this function but rather operator/function projectSum on MultiDimImplementation. This operator will take care to select this function if it is appropriate for your projection.

References projectSumMultiDimFunctionGraph().

Referenced by projectSumMultiDimFunctionGraph(), and projectSumMultiDimFunctionGraph().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ projectSumMultiDimFunctionGraph() [2/2]

template<typename GUM_ELEMENT>
MultiDimImplementation< GUM_ELEMENT > * gum::projectSumMultiDimFunctionGraph ( const MultiDimImplementation< GUM_ELEMENT > * table,
const gum::VariableSet & del_vars )

a specialized function for projecting a multiDimFunctionGraph using a summation

The function projects a table over the subset of its variables NOT IN the set of variables del_vars. For instance, if table is a MultiDimFunctionGraph defined over A,B,C,D and if del_vars = {A,C}, then the function returns a table over B,D defined as Sum_{A,C} table (A,B,C,D).

Returns
function ProjectMaxMultiDimFunctionGraphs allocates on the heap the new T multiDimFunctionGraph and returns it
Warning
In practice, do not use this function but rather operator/function projectSum on MultiDimImplementation. This operator will take care to select this function if it is appropriate for your projection.

References projectSumMultiDimFunctionGraph().

Here is the call graph for this function:

◆ randomValue()

template<typename GENERATOR>
Idx gum::randomValue ( GENERATOR & generator,
const Size max )

Definition at line 83 of file utils_random_tpl.h.

83 {
84 std::uniform_int_distribution< Idx > uni_int(0, max - 1);
85 return uni_int(generator);
86 }

References randomValue().

Here is the call graph for this function:

◆ rec_hasMixedReallyOrientedPath()

bool gum::rec_hasMixedReallyOrientedPath ( const PDAG & gr,
NodeSet & marked,
NodeId node,
NodeId goal,
bool alreadyOriented )

Definition at line 91 of file PDAG.cpp.

95 {
96 if (node == goal) return alreadyOriented;
97 if (marked.contains(node)) return false;
98 marked.insert(node);
99 for (const auto nod: gr.children(node))
100 if (rec_hasMixedReallyOrientedPath(gr, marked, nod, goal, true)) return true;
101 for (const auto nod: gr.neighbours(node))
102 if (rec_hasMixedReallyOrientedPath(gr, marked, nod, goal, alreadyOriented)) return true;
103 return false;
104 }
NodeSet children(const NodeSet &ids) const
returns the set of nodes which consists in the node and its parents returns the set of children of a ...
const NodeSet & neighbours(NodeId id) const
returns the set of node neighbours to a given node
bool rec_hasMixedReallyOrientedPath(const PDAG &gr, NodeSet &marked, NodeId node, NodeId goal, bool alreadyOriented)
Definition PDAG.cpp:91

References gum::ArcGraphPart::children(), gum::Set< Key >::contains(), gum::Set< Key >::insert(), gum::EdgeGraphPart::neighbours(), and rec_hasMixedReallyOrientedPath().

Referenced by gum::PDAG::hasMixedReallyOrientedPath(), and rec_hasMixedReallyOrientedPath().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ registerOperator()

template<typename GUM_ELEMENT>
void gum::registerOperator ( std::string_view operation_name,
std::string_view type1,
std::string_view type2,
typename OperatorRegister4MultiDim< GUM_ELEMENT >::OperatorPtr function )

A function to more easily register new operators in MultiDims.

References registerOperator().

Referenced by registerOperator().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ registerPartialInstantiation()

template<typename GUM_ELEMENT>
void gum::registerPartialInstantiation ( std::string_view instantiation_func_name,
std::string_view type_multidim,
typename PartialInstantiationRegister4MultiDim< GUM_ELEMENT >::PartialInstantiationPtr function )

A function to more easily register new instantiation functions in MultiDims.

References registerPartialInstantiation().

Referenced by partialInstantiation4MultiDimInit(), pointerPartialInstantiation4MultiDimInit(), and registerPartialInstantiation().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ registerProjection()

template<typename GUM_ELEMENT>
void gum::registerProjection ( std::string_view projection_name,
std::string_view type_multidim,
typename ProjectionRegister4MultiDim< GUM_ELEMENT >::ProjectionPtr function )

A function to more easily register new projection functions in MultiDims.

References registerProjection().

Referenced by registerProjection().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeInfo()

template<class Element>
void gum::removeInfo ( const SplayBinaryNode< Element > * e,
HashTable< Element, SplayBinaryNode< Element > * > & addr )
static

Definition at line 664 of file splay_tpl.h.

665 {
666 GUM_ASSERT(addr.exists(e->getElement()));
667 addr.erase(e->getElement());
668
669 if (e->getFg()) removeInfo(e->getFg(), addr);
670
671 if (e->getFd()) removeInfo(e->getFd(), addr);
672 }
void erase(const Key &key)
Removes a given element from the hash table.
bool exists(const Key &key) const
Checks whether there exists an element with a given key in the hashtable.
const Element & getElement() const
Returns the element in the node.
Definition splay_tpl.h:332
const SplayBinaryNode< Element > * getFd() const
Returns the right child.
Definition splay_tpl.h:352
const SplayBinaryNode< Element > * getFg() const
Returns the left child.
Definition splay_tpl.h:342
static void removeInfo(const SplayBinaryNode< Element > *e, HashTable< Element, SplayBinaryNode< Element > * > &addr)
Definition splay_tpl.h:664

References gum::SplayBinaryNode< Element >::getElement(), gum::SplayBinaryNode< Element >::getFd(), gum::SplayBinaryNode< Element >::getFg(), and removeInfo().

Referenced by removeInfo(), gum::SplayTree< Element >::split(), and gum::SplayTree< Element >::split_by_val().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sq()

template<GUM_Numeric GUM_SCALAR>
Tensor< GUM_SCALAR > gum::sq ( const Tensor< GUM_SCALAR > & arg)
inline

References sq().

Referenced by sq().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SSNewMNmultiTensor()

template<GUM_Numeric GUM_SCALAR>
INLINE Tensor< GUM_SCALAR > gum::SSNewMNmultiTensor ( const Tensor< GUM_SCALAR > & t1,
const Tensor< GUM_SCALAR > & t2 )
static

References SSNewMNmultiTensor().

Referenced by SSNewMNmultiTensor().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SSNewMNprojTensor()

template<GUM_Numeric GUM_SCALAR>
INLINE Tensor< GUM_SCALAR > gum::SSNewMNprojTensor ( const Tensor< GUM_SCALAR > & t1,
const gum::VariableSet & del_vars )
static

References SSNewMNprojTensor().

Referenced by SSNewMNprojTensor().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SSNewmultiTensor()

template<GUM_Numeric GUM_SCALAR>
INLINE Tensor< GUM_SCALAR > gum::SSNewmultiTensor ( const Tensor< GUM_SCALAR > & t1,
const Tensor< GUM_SCALAR > & t2 )
static

References SSNewmultiTensor().

Referenced by SSNewmultiTensor().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SSNewprojTensor()

template<GUM_Numeric GUM_SCALAR>
INLINE Tensor< GUM_SCALAR > gum::SSNewprojTensor ( const Tensor< GUM_SCALAR > & t1,
const gum::VariableSet & del_vars )
static

References SSNewprojTensor().

Referenced by SSNewprojTensor().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ to_string()

INLINE std::string gum::to_string ( const Formula & f)

Definition at line 262 of file formula_inl.h.

262{ return std::to_string(f.result()); }

References gum::Formula::result(), and to_string().

Referenced by gum::Formula::Formula(), gum::Formula::Formula(), gum::Formula::Formula(), gum::Formula::Formula(), gum::Formula::Formula(), gum::Formula::Formula(), gum::Formula::Formula(), gum::Formula::Formula(), gum::Formula::Formula(), gum::Formula::Formula(), and to_string().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ VENewmultiTensor()

template<GUM_Numeric GUM_SCALAR>
INLINE Tensor< GUM_SCALAR > gum::VENewmultiTensor ( const Tensor< GUM_SCALAR > & t1,
const Tensor< GUM_SCALAR > & t2 )
static

References VENewmultiTensor().

Referenced by VENewmultiTensor().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ VENewprojTensor()

template<GUM_Numeric GUM_SCALAR>
INLINE Tensor< GUM_SCALAR > gum::VENewprojTensor ( const Tensor< GUM_SCALAR > & t1,
const gum::VariableSet & del_vars )
static

References VENewprojTensor().

Referenced by VENewprojTensor().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ BayesNet< double >

◆ BayesNetFactory< double >

template class GUM_PUBLIC_BN gum::BayesNetFactory< double >
extern

◆ BayesNetFragment< double >

template class GUM_PUBLIC_BN gum::BayesNetFragment< double >
extern

◆ BIFReader< double >

template class GUM_PUBLIC_BN gum::BIFReader< double >
extern

Definition at line 46 of file BIFReader.cpp.

◆ BIFWriter< double >

template class GUM_PUBLIC_BN gum::BIFWriter< double >
extern

Definition at line 46 of file BIFWriter.cpp.

Referenced by gum::BIFWriter< GUM_SCALAR >::_variablesLabels_().

◆ BIFXMLBNReader< double >

template class GUM_PUBLIC_BN gum::BIFXMLBNReader< double >
extern

Definition at line 52 of file BIFXMLBNReader.cpp.

◆ BIFXMLBNWriter< double >

template class GUM_PUBLIC_BN gum::BIFXMLBNWriter< double >
extern

◆ BNdistance< double >

template class GUM_PUBLIC_BN gum::BNdistance< double >
extern

Definition at line 55 of file BNdistance.cpp.

◆ BNReader< double >

template class GUM_PUBLIC_BN gum::BNReader< double >
extern

Definition at line 51 of file BNReader.cpp.

◆ BNWriter< double >

template class GUM_PUBLIC_BN gum::BNWriter< double >
extern

Definition at line 51 of file BNWriter.cpp.

◆ CausalImpact< double >

template class GUM_PUBLIC_CM gum::CausalImpact< double >
extern

Definition at line 50 of file causalImpact.cpp.

◆ CausalModel< double >

template class GUM_PUBLIC_CM gum::CausalModel< double >
extern

◆ Counterfactual< double >

template class GUM_PUBLIC_CM gum::Counterfactual< double >

Definition at line 47 of file counterfactual.cpp.

◆ DiscretizedVariable< double >

◆ DSLReader< double >

template class GUM_PUBLIC_BN gum::DSLReader< double >
extern

Definition at line 46 of file DSLReader.cpp.

◆ ExactBNdistance< double >

template class GUM_PUBLIC_BN gum::ExactBNdistance< double >
extern

Definition at line 54 of file exactBNdistance.cpp.

◆ GibbsBNdistance< double >

template class GUM_PUBLIC_BN gum::GibbsBNdistance< double >
extern

Definition at line 48 of file GibbsBNdistance.cpp.

◆ GibbsOperator< double >

template class GUM_PUBLIC_BN gum::GibbsOperator< double >
extern

Definition at line 46 of file gibbsOperator.cpp.

◆ GibbsSampling< double >

template class GUM_PUBLIC_BN gum::GibbsSampling< double >
extern

Definition at line 46 of file GibbsSampling.cpp.

◆ GumBNReader< double >

template class GUM_PUBLIC_BN gum::GumBNReader< double >
extern

Definition at line 46 of file GumBNReader.cpp.

◆ GumBNWriter< double >

template class GUM_PUBLIC_BN gum::GumBNWriter< double >
extern

Definition at line 46 of file GumBNWriter.cpp.

◆ GumIDReader< double >

template class GUM_PUBLIC_ID gum::GumIDReader< double >
extern

Definition at line 46 of file GumIDReader.cpp.

◆ GumIDWriter< double >

template class GUM_PUBLIC_ID gum::GumIDWriter< double >
extern

Definition at line 46 of file GumIDWriter.cpp.

◆ GumMRFReader< double >

template class GUM_PUBLIC_MRF gum::GumMRFReader< double >
extern

Definition at line 46 of file GumMRFReader.cpp.

◆ GumMRFWriter< double >

template class GUM_PUBLIC_MRF gum::GumMRFWriter< double >
extern

Definition at line 46 of file GumMRFWriter.cpp.

◆ HashFunc< Set< unsigned long > >

template class GUM_SHARED_PUBLIC gum::HashFunc< Set< unsigned long > >
extern

◆ IBayesNet< double >

template class GUM_PUBLIC_BN gum::IBayesNet< double >
extern

Definition at line 46 of file IBayesNet.cpp.

◆ IMarkovRandomField< double >

template class GUM_PUBLIC_MRF gum::IMarkovRandomField< double >
extern

Definition at line 46 of file IMarkovRandomField.cpp.

◆ ImportanceSampling< double >

template class GUM_PUBLIC_BN gum::ImportanceSampling< double >
extern

Definition at line 46 of file importanceSampling.cpp.

◆ KTBN< double >

template class GUM_PUBLIC_KTBN gum::KTBN< double >
extern

Definition at line 53 of file KTBN.cpp.

◆ KTBNGenerator< double >

template class GUM_PUBLIC_KTBN gum::KTBNGenerator< double >
extern

Definition at line 52 of file KTBNGenerator.cpp.

◆ KTBNInference< double >

template class GUM_PUBLIC_KTBN gum::KTBNInference< double >
extern

Definition at line 52 of file KTBNInference.cpp.

◆ LazyPropagation< double >

template class GUM_PUBLIC_BN gum::LazyPropagation< double >
extern

Definition at line 46 of file lazyPropagation.cpp.

◆ Link< Idx >

◆ LoopySamplingInference< double, GibbsSampling >

template class GUM_PUBLIC_BN gum::LoopySamplingInference< double, GibbsSampling >
extern

◆ LoopySamplingInference< double, ImportanceSampling >

template class GUM_PUBLIC_BN gum::LoopySamplingInference< double, ImportanceSampling >
extern

◆ LoopySamplingInference< double, MonteCarloSampling >

template class GUM_PUBLIC_BN gum::LoopySamplingInference< double, MonteCarloSampling >
extern

◆ LoopySamplingInference< double, WeightedSampling >

template class GUM_PUBLIC_BN gum::LoopySamplingInference< double, WeightedSampling >
extern

◆ LoopySamplingInference< float, GibbsSampling >

template class GUM_PUBLIC_BN gum::LoopySamplingInference< float, GibbsSampling >
extern

◆ LoopySamplingInference< float, ImportanceSampling >

template class GUM_PUBLIC_BN gum::LoopySamplingInference< float, ImportanceSampling >
extern

◆ LoopySamplingInference< float, MonteCarloSampling >

template class GUM_PUBLIC_BN gum::LoopySamplingInference< float, MonteCarloSampling >
extern

◆ LoopySamplingInference< float, WeightedSampling >

template class GUM_PUBLIC_BN gum::LoopySamplingInference< float, WeightedSampling >
extern

◆ MCBNDistance< double >

template class GUM_PUBLIC_BN gum::MCBNDistance< double >
extern

Definition at line 48 of file MCBNDistance.cpp.

◆ MonteCarloSampling< double >

template class GUM_PUBLIC_BN gum::MonteCarloSampling< double >
extern

Definition at line 46 of file MonteCarloSampling.cpp.

◆ MRFReader< double >

template class GUM_PUBLIC_MRF gum::MRFReader< double >
extern

Definition at line 51 of file MRFReader.cpp.

◆ MRFWriter< double >

template class GUM_PUBLIC_MRF gum::MRFWriter< double >
extern

Definition at line 51 of file MRFWriter.cpp.

◆ MultiDimArray< double >

template class GUM_SHARED_PUBLIC gum::MultiDimArray< double >
extern

◆ MultiDimBijArray< double >

template class GUM_SHARED_PUBLIC gum::MultiDimBijArray< double >

Definition at line 56 of file multiDimBijArray.cpp.

◆ MultiDimBucket< double >

template class GUM_SHARED_PUBLIC gum::MultiDimBucket< double >

Definition at line 56 of file multiDimBucket.cpp.

◆ MultiDimFunctionGraph< double >::defaultValue

Definition at line 59 of file multiDimFunctionGraph.cpp.

◆ MultiDimFunctionGraph< float >::defaultValue

template<>
const float gum::MultiDimFunctionGraph< float >::defaultValue = 0.0f

◆ MultiDimICIModel< double >

template class GUM_SHARED_PUBLIC gum::MultiDimICIModel< double >
extern

Definition at line 49 of file multiDimICIModel.cpp.

◆ MultiDimImplementation< double >

template class GUM_SHARED_PUBLIC gum::MultiDimImplementation< double >
extern

Definition at line 52 of file multiDimImplementation.cpp.

◆ MultiDimNoisyORCompound< double >

template class GUM_SHARED_PUBLIC gum::MultiDimNoisyORCompound< double >
extern

Definition at line 49 of file multiDimNoisyORCompound.cpp.

◆ MultiDimNoisyORNet< double >

template class GUM_SHARED_PUBLIC gum::MultiDimNoisyORNet< double >
extern

Definition at line 56 of file multiDimNoisyORNet.cpp.

◆ MultiDimSparse< double >

template class GUM_SHARED_PUBLIC gum::MultiDimSparse< double >

Definition at line 55 of file multiDimSparse.cpp.

◆ MultiDimWithOffset< double >

template class GUM_SHARED_PUBLIC gum::MultiDimWithOffset< double >
extern

Definition at line 53 of file multiDimWithOffset.cpp.

◆ NetReader< double >

template class GUM_PUBLIC_BN gum::NetReader< double >
extern

Definition at line 46 of file netReader.cpp.

◆ NetWriter< double >

template class GUM_PUBLIC_BN gum::NetWriter< double >
extern

Definition at line 46 of file netWriter.cpp.

Referenced by gum::NetWriter< GUM_SCALAR >::_variableCPT_().

◆ O3prmBNWriter< double >

template class GUM_PUBLIC_PRM gum::O3prmBNWriter< double >
extern

Definition at line 51 of file O3prmBNWriter.cpp.

◆ SamplingInference< double >

template class GUM_PUBLIC_BN gum::SamplingInference< double >
extern

Definition at line 46 of file samplingInference.cpp.

◆ ShaferShenoyInference< double >

template class GUM_PUBLIC_BN gum::ShaferShenoyInference< double >
extern

Definition at line 46 of file ShaferShenoyInference.cpp.

◆ ShaferShenoyMRFInference< double >

template class GUM_PUBLIC_MRF gum::ShaferShenoyMRFInference< double >
extern

Definition at line 46 of file ShaferShenoyMRFInference.cpp.

◆ SimpleCPTGenerator< double >

template class GUM_PUBLIC_BN gum::SimpleCPTGenerator< double >
extern

Definition at line 52 of file simpleCPTGenerator.cpp.

◆ Tensor< double >

◆ UAIBNReader< double >

template class GUM_PUBLIC_BN gum::UAIBNReader< double >
extern

Definition at line 46 of file UAIBNReader.cpp.

Referenced by gum::UAIBNReader< GUM_SCALAR >::_addWarning_().

◆ UAIBNWriter< double >

template class GUM_PUBLIC_BN gum::UAIBNWriter< double >
extern

Definition at line 51 of file UAIBNWriter.cpp.

Referenced by gum::UAIBNWriter< GUM_SCALAR >::_cptBloc_().

◆ UAIMRFReader< double >

template class GUM_PUBLIC_MRF gum::UAIMRFReader< double >
extern

Definition at line 46 of file UAIMRFReader.cpp.

Referenced by gum::UAIMRFReader< GUM_SCALAR >::_addWarning_().

◆ UAIMRFWriter< double >

template class GUM_PUBLIC_MRF gum::UAIMRFWriter< double >
extern

Definition at line 51 of file UAIMRFWriter.cpp.

◆ VariableElimination< double >

template class GUM_PUBLIC_BN gum::VariableElimination< double >
extern

◆ VariableLog2ParamComplexityCTable

const double gum::VariableLog2ParamComplexityCTable

◆ VariableLog2ParamComplexityCTableNSize

std::size_t gum::VariableLog2ParamComplexityCTableNSize {std::size_t(1000)}
constexpr

◆ VariableLog2ParamComplexityCTableRSize

std::size_t gum::VariableLog2ParamComplexityCTableRSize {std::size_t(4)}
constexpr

◆ WeightedSampling< double >

template class GUM_PUBLIC_BN gum::WeightedSampling< double >
extern

Definition at line 46 of file weightedSampling.cpp.

◆ XDSLBNReader< double >

template class GUM_PUBLIC_BN gum::XDSLBNReader< double >
extern

Definition at line 52 of file XDSLBNReader.cpp.

◆ XDSLBNWriter< double >

template class GUM_PUBLIC_BN gum::XDSLBNWriter< double >
extern