Turbo Constraint Solver
Loading...
Searching...
No Matches
AbstractDomains< Universe, BasicAllocator, PropAllocator, StoreAllocator > Struct Template Reference

#include <common_solving.hpp>

Classes

struct  tag_copy_cons
 
struct  tag_gpu_block_copy
 

Public Types

using universe_type = typename Universe::local_type
 
using LIStore = VStore<universe_type, BasicAllocator>
 
using IStore = VStore<Universe, StoreAllocator>
 
using IPC = PC<IStore, PropAllocator>
 
using ISimplifier = Simplifier<IPC, BasicAllocator>
 
using Split = SplitStrategy<IPC, BasicAllocator>
 
using IST = SearchTree<IPC, Split, BasicAllocator>
 
using IBAB = BAB<IST, LIStore>
 
using basic_allocator_type = BasicAllocator
 
using prop_allocator_type = PropAllocator
 
using store_allocator_type = StoreAllocator
 
using this_type = AbstractDomains<Universe, BasicAllocator, PropAllocator, StoreAllocator>
 
using FormulaPtr = battery::shared_ptr<TFormula<basic_allocator_type>, basic_allocator_type>
 

Public Member Functions

template<class U2 , class BasicAlloc2 , class PropAllocator2 , class StoreAllocator2 >
CUDA AbstractDomains (const tag_gpu_block_copy &, bool enable_sharing, const AbstractDomains< U2, BasicAlloc2, PropAllocator2, StoreAllocator2 > &other, const BasicAllocator &basic_allocator=BasicAllocator(), const PropAllocator &prop_allocator=PropAllocator(), const StoreAllocator &store_allocator=StoreAllocator())
 
template<class U2 , class BasicAlloc2 , class PropAllocator2 , class StoreAllocator2 >
CUDA AbstractDomains (const AbstractDomains< U2, BasicAlloc2, PropAllocator2, StoreAllocator2 > &other, const BasicAllocator &basic_allocator=BasicAllocator(), const PropAllocator &prop_allocator=PropAllocator(), const StoreAllocator &store_allocator=StoreAllocator(), const tag_copy_cons &tag=tag_copy_cons{})
 
CUDA AbstractDomains (const this_type &other, const BasicAllocator &basic_allocator=BasicAllocator(), const PropAllocator &prop_allocator=PropAllocator(), const StoreAllocator &store_allocator=StoreAllocator())
 
template<class Alloc >
CUDA AbstractDomains (const Configuration< Alloc > &config, const BasicAllocator &basic_allocator=BasicAllocator(), const PropAllocator &prop_allocator=PropAllocator(), const StoreAllocator &store_allocator=StoreAllocator())
 
 AbstractDomains (AbstractDomains &&other)=default
 
CUDA void allocate (int num_vars)
 
CUDA void deallocate ()
 
template<class F >
CUDA void typing (F &f) const
 
template<class F >
CUDA bool interpret (const F &f)
 
template<class F >
CUDA bool prepare_simplifier (F &f)
 
template<class F >
void type_and_interpret (F &f)
 
FormulaPtr prepare_solver ()
 
void preprocess ()
 
CUDA bool on_node ()
 
CUDA bool is_printing_intermediate_sol ()
 
CUDA void print_solution ()
 
CUDA void prune ()
 
CUDA bool update_solution_stats ()
 
CUDA bool on_solution_node ()
 
CUDA void on_failed_node ()
 
CUDA void print_final_solution ()
 
CUDA void print_mzn_statistics ()
 
template<class U2 , class BasicAlloc2 , class PropAlloc2 , class StoreAlloc2 >
CUDA void meet (AbstractDomains< U2, BasicAlloc2, PropAlloc2, StoreAlloc2 > &other)
 

Public Attributes

BasicAllocator basic_allocator
 
PropAllocator prop_allocator
 
StoreAllocator store_allocator
 
abstract_ptr< IStorestore
 
abstract_ptr< IPCipc
 
abstract_ptr< ISimplifiersimplifier
 
abstract_ptr< Splitsplit
 
abstract_ptr< Spliteps_split
 
abstract_ptr< ISTsearch_tree
 
abstract_ptr< LIStorebest
 
abstract_ptr< IBABbab
 
VarEnv< BasicAllocator > env
 
SolverOutput< BasicAllocator > solver_output
 
Configuration< BasicAllocator > config
 
Statistics stats
 

Detailed Description

template<class Universe, class BasicAllocator, class PropAllocator, class StoreAllocator>
struct AbstractDomains< Universe, BasicAllocator, PropAllocator, StoreAllocator >

This class is parametrized by a universe of discourse, which is the domain of the variables in the store and various allocators:

  • BasicAllocator: default allocator, used to allocate abstract domains, the environment, storing intermediate results, etc.
  • PropAllocator: allocator used for the PC abstract domain, to allocate the propagators.
  • StoreAllocator: allocator used for the store, to allocate the variables.

Normally, you should use the fastest memory for the store, then for the propagators and then for the rest.

Member Typedef Documentation

◆ universe_type

template<class Universe , class BasicAllocator , class PropAllocator , class StoreAllocator >
using AbstractDomains< Universe, BasicAllocator, PropAllocator, StoreAllocator >::universe_type = typename Universe::local_type

◆ LIStore

template<class Universe , class BasicAllocator , class PropAllocator , class StoreAllocator >
using AbstractDomains< Universe, BasicAllocator, PropAllocator, StoreAllocator >::LIStore = VStore<universe_type, BasicAllocator>

Version of the abstract domains with a simple allocator, to represent the best solutions.

◆ IStore

template<class Universe , class BasicAllocator , class PropAllocator , class StoreAllocator >
using AbstractDomains< Universe, BasicAllocator, PropAllocator, StoreAllocator >::IStore = VStore<Universe, StoreAllocator>

◆ IPC

template<class Universe , class BasicAllocator , class PropAllocator , class StoreAllocator >
using AbstractDomains< Universe, BasicAllocator, PropAllocator, StoreAllocator >::IPC = PC<IStore, PropAllocator>

◆ ISimplifier

template<class Universe , class BasicAllocator , class PropAllocator , class StoreAllocator >
using AbstractDomains< Universe, BasicAllocator, PropAllocator, StoreAllocator >::ISimplifier = Simplifier<IPC, BasicAllocator>

◆ Split

template<class Universe , class BasicAllocator , class PropAllocator , class StoreAllocator >
using AbstractDomains< Universe, BasicAllocator, PropAllocator, StoreAllocator >::Split = SplitStrategy<IPC, BasicAllocator>

◆ IST

template<class Universe , class BasicAllocator , class PropAllocator , class StoreAllocator >
using AbstractDomains< Universe, BasicAllocator, PropAllocator, StoreAllocator >::IST = SearchTree<IPC, Split, BasicAllocator>

◆ IBAB

template<class Universe , class BasicAllocator , class PropAllocator , class StoreAllocator >
using AbstractDomains< Universe, BasicAllocator, PropAllocator, StoreAllocator >::IBAB = BAB<IST, LIStore>

◆ basic_allocator_type

template<class Universe , class BasicAllocator , class PropAllocator , class StoreAllocator >
using AbstractDomains< Universe, BasicAllocator, PropAllocator, StoreAllocator >::basic_allocator_type = BasicAllocator

◆ prop_allocator_type

template<class Universe , class BasicAllocator , class PropAllocator , class StoreAllocator >
using AbstractDomains< Universe, BasicAllocator, PropAllocator, StoreAllocator >::prop_allocator_type = PropAllocator

◆ store_allocator_type

template<class Universe , class BasicAllocator , class PropAllocator , class StoreAllocator >
using AbstractDomains< Universe, BasicAllocator, PropAllocator, StoreAllocator >::store_allocator_type = StoreAllocator

◆ this_type

template<class Universe , class BasicAllocator , class PropAllocator , class StoreAllocator >
using AbstractDomains< Universe, BasicAllocator, PropAllocator, StoreAllocator >::this_type = AbstractDomains<Universe, BasicAllocator, PropAllocator, StoreAllocator>

◆ FormulaPtr

template<class Universe , class BasicAllocator , class PropAllocator , class StoreAllocator >
using AbstractDomains< Universe, BasicAllocator, PropAllocator, StoreAllocator >::FormulaPtr = battery::shared_ptr<TFormula<basic_allocator_type>, basic_allocator_type>

Constructor & Destructor Documentation

◆ AbstractDomains() [1/5]

template<class Universe , class BasicAllocator , class PropAllocator , class StoreAllocator >
template<class U2 , class BasicAlloc2 , class PropAllocator2 , class StoreAllocator2 >
CUDA AbstractDomains< Universe, BasicAllocator, PropAllocator, StoreAllocator >::AbstractDomains ( const tag_gpu_block_copy & ,
bool enable_sharing,
const AbstractDomains< U2, BasicAlloc2, PropAllocator2, StoreAllocator2 > & other,
const BasicAllocator & basic_allocator = BasicAllocator(),
const PropAllocator & prop_allocator = PropAllocator(),
const StoreAllocator & store_allocator = StoreAllocator() )
inline

We copy other in a new element, and ignore every variable not used in a GPU block. This is because copying everything in each block is very slow.

NOTE: It is not the allocation itself that is slow, I think it calling many copy constructors for atomic variables (note that in simplifier we have an atomic memory if the underlying domain has one).

◆ AbstractDomains() [2/5]

template<class Universe , class BasicAllocator , class PropAllocator , class StoreAllocator >
template<class U2 , class BasicAlloc2 , class PropAllocator2 , class StoreAllocator2 >
CUDA AbstractDomains< Universe, BasicAllocator, PropAllocator, StoreAllocator >::AbstractDomains ( const AbstractDomains< U2, BasicAlloc2, PropAllocator2, StoreAllocator2 > & other,
const BasicAllocator & basic_allocator = BasicAllocator(),
const PropAllocator & prop_allocator = PropAllocator(),
const StoreAllocator & store_allocator = StoreAllocator(),
const tag_copy_cons & tag = tag_copy_cons{} )
inline

◆ AbstractDomains() [3/5]

template<class Universe , class BasicAllocator , class PropAllocator , class StoreAllocator >
CUDA AbstractDomains< Universe, BasicAllocator, PropAllocator, StoreAllocator >::AbstractDomains ( const this_type & other,
const BasicAllocator & basic_allocator = BasicAllocator(),
const PropAllocator & prop_allocator = PropAllocator(),
const StoreAllocator & store_allocator = StoreAllocator() )
inline

◆ AbstractDomains() [4/5]

template<class Universe , class BasicAllocator , class PropAllocator , class StoreAllocator >
template<class Alloc >
CUDA AbstractDomains< Universe, BasicAllocator, PropAllocator, StoreAllocator >::AbstractDomains ( const Configuration< Alloc > & config,
const BasicAllocator & basic_allocator = BasicAllocator(),
const PropAllocator & prop_allocator = PropAllocator(),
const StoreAllocator & store_allocator = StoreAllocator() )
inline

◆ AbstractDomains() [5/5]

template<class Universe , class BasicAllocator , class PropAllocator , class StoreAllocator >
AbstractDomains< Universe, BasicAllocator, PropAllocator, StoreAllocator >::AbstractDomains ( AbstractDomains< Universe, BasicAllocator, PropAllocator, StoreAllocator > && other)
default

Member Function Documentation

◆ allocate()

template<class Universe , class BasicAllocator , class PropAllocator , class StoreAllocator >
CUDA void AbstractDomains< Universe, BasicAllocator, PropAllocator, StoreAllocator >::allocate ( int num_vars)
inline

◆ deallocate()

template<class Universe , class BasicAllocator , class PropAllocator , class StoreAllocator >
CUDA void AbstractDomains< Universe, BasicAllocator, PropAllocator, StoreAllocator >::deallocate ( )
inline

◆ typing()

template<class Universe , class BasicAllocator , class PropAllocator , class StoreAllocator >
template<class F >
CUDA void AbstractDomains< Universe, BasicAllocator, PropAllocator, StoreAllocator >::typing ( F & f) const
inline

◆ interpret()

template<class Universe , class BasicAllocator , class PropAllocator , class StoreAllocator >
template<class F >
CUDA bool AbstractDomains< Universe, BasicAllocator, PropAllocator, StoreAllocator >::interpret ( const F & f)
inline

◆ prepare_simplifier()

template<class Universe , class BasicAllocator , class PropAllocator , class StoreAllocator >
template<class F >
CUDA bool AbstractDomains< Universe, BasicAllocator, PropAllocator, StoreAllocator >::prepare_simplifier ( F & f)
inline

◆ type_and_interpret()

template<class Universe , class BasicAllocator , class PropAllocator , class StoreAllocator >
template<class F >
void AbstractDomains< Universe, BasicAllocator, PropAllocator, StoreAllocator >::type_and_interpret ( F & f)
inline

◆ prepare_solver()

template<class Universe , class BasicAllocator , class PropAllocator , class StoreAllocator >
FormulaPtr AbstractDomains< Universe, BasicAllocator, PropAllocator, StoreAllocator >::prepare_solver ( )
inline

◆ preprocess()

template<class Universe , class BasicAllocator , class PropAllocator , class StoreAllocator >
void AbstractDomains< Universe, BasicAllocator, PropAllocator, StoreAllocator >::preprocess ( )
inline

◆ on_node()

template<class Universe , class BasicAllocator , class PropAllocator , class StoreAllocator >
CUDA bool AbstractDomains< Universe, BasicAllocator, PropAllocator, StoreAllocator >::on_node ( )
inline

◆ is_printing_intermediate_sol()

template<class Universe , class BasicAllocator , class PropAllocator , class StoreAllocator >
CUDA bool AbstractDomains< Universe, BasicAllocator, PropAllocator, StoreAllocator >::is_printing_intermediate_sol ( )
inline

◆ print_solution()

template<class Universe , class BasicAllocator , class PropAllocator , class StoreAllocator >
CUDA void AbstractDomains< Universe, BasicAllocator, PropAllocator, StoreAllocator >::print_solution ( )
inline

◆ prune()

template<class Universe , class BasicAllocator , class PropAllocator , class StoreAllocator >
CUDA void AbstractDomains< Universe, BasicAllocator, PropAllocator, StoreAllocator >::prune ( )
inline

◆ update_solution_stats()

template<class Universe , class BasicAllocator , class PropAllocator , class StoreAllocator >
CUDA bool AbstractDomains< Universe, BasicAllocator, PropAllocator, StoreAllocator >::update_solution_stats ( )
inline

Return true if the search state must be pruned.

◆ on_solution_node()

template<class Universe , class BasicAllocator , class PropAllocator , class StoreAllocator >
CUDA bool AbstractDomains< Universe, BasicAllocator, PropAllocator, StoreAllocator >::on_solution_node ( )
inline

◆ on_failed_node()

template<class Universe , class BasicAllocator , class PropAllocator , class StoreAllocator >
CUDA void AbstractDomains< Universe, BasicAllocator, PropAllocator, StoreAllocator >::on_failed_node ( )
inline

◆ print_final_solution()

template<class Universe , class BasicAllocator , class PropAllocator , class StoreAllocator >
CUDA void AbstractDomains< Universe, BasicAllocator, PropAllocator, StoreAllocator >::print_final_solution ( )
inline

◆ print_mzn_statistics()

template<class Universe , class BasicAllocator , class PropAllocator , class StoreAllocator >
CUDA void AbstractDomains< Universe, BasicAllocator, PropAllocator, StoreAllocator >::print_mzn_statistics ( )
inline

◆ meet()

template<class Universe , class BasicAllocator , class PropAllocator , class StoreAllocator >
template<class U2 , class BasicAlloc2 , class PropAlloc2 , class StoreAlloc2 >
CUDA void AbstractDomains< Universe, BasicAllocator, PropAllocator, StoreAllocator >::meet ( AbstractDomains< U2, BasicAlloc2, PropAlloc2, StoreAlloc2 > & other)
inline

Extract in this the content of other.

Member Data Documentation

◆ basic_allocator

template<class Universe , class BasicAllocator , class PropAllocator , class StoreAllocator >
BasicAllocator AbstractDomains< Universe, BasicAllocator, PropAllocator, StoreAllocator >::basic_allocator

◆ prop_allocator

template<class Universe , class BasicAllocator , class PropAllocator , class StoreAllocator >
PropAllocator AbstractDomains< Universe, BasicAllocator, PropAllocator, StoreAllocator >::prop_allocator

◆ store_allocator

template<class Universe , class BasicAllocator , class PropAllocator , class StoreAllocator >
StoreAllocator AbstractDomains< Universe, BasicAllocator, PropAllocator, StoreAllocator >::store_allocator

◆ store

template<class Universe , class BasicAllocator , class PropAllocator , class StoreAllocator >
abstract_ptr<IStore> AbstractDomains< Universe, BasicAllocator, PropAllocator, StoreAllocator >::store

◆ ipc

template<class Universe , class BasicAllocator , class PropAllocator , class StoreAllocator >
abstract_ptr<IPC> AbstractDomains< Universe, BasicAllocator, PropAllocator, StoreAllocator >::ipc

◆ simplifier

template<class Universe , class BasicAllocator , class PropAllocator , class StoreAllocator >
abstract_ptr<ISimplifier> AbstractDomains< Universe, BasicAllocator, PropAllocator, StoreAllocator >::simplifier

◆ split

template<class Universe , class BasicAllocator , class PropAllocator , class StoreAllocator >
abstract_ptr<Split> AbstractDomains< Universe, BasicAllocator, PropAllocator, StoreAllocator >::split

◆ eps_split

template<class Universe , class BasicAllocator , class PropAllocator , class StoreAllocator >
abstract_ptr<Split> AbstractDomains< Universe, BasicAllocator, PropAllocator, StoreAllocator >::eps_split

◆ search_tree

template<class Universe , class BasicAllocator , class PropAllocator , class StoreAllocator >
abstract_ptr<IST> AbstractDomains< Universe, BasicAllocator, PropAllocator, StoreAllocator >::search_tree

◆ best

template<class Universe , class BasicAllocator , class PropAllocator , class StoreAllocator >
abstract_ptr<LIStore> AbstractDomains< Universe, BasicAllocator, PropAllocator, StoreAllocator >::best

◆ bab

template<class Universe , class BasicAllocator , class PropAllocator , class StoreAllocator >
abstract_ptr<IBAB> AbstractDomains< Universe, BasicAllocator, PropAllocator, StoreAllocator >::bab

◆ env

template<class Universe , class BasicAllocator , class PropAllocator , class StoreAllocator >
VarEnv<BasicAllocator> AbstractDomains< Universe, BasicAllocator, PropAllocator, StoreAllocator >::env

◆ solver_output

template<class Universe , class BasicAllocator , class PropAllocator , class StoreAllocator >
SolverOutput<BasicAllocator> AbstractDomains< Universe, BasicAllocator, PropAllocator, StoreAllocator >::solver_output

◆ config

template<class Universe , class BasicAllocator , class PropAllocator , class StoreAllocator >
Configuration<BasicAllocator> AbstractDomains< Universe, BasicAllocator, PropAllocator, StoreAllocator >::config

◆ stats

template<class Universe , class BasicAllocator , class PropAllocator , class StoreAllocator >
Statistics AbstractDomains< Universe, BasicAllocator, PropAllocator, StoreAllocator >::stats

The documentation for this struct was generated from the following file: