Changes between Version 9 and Version 10 of LibrariesUnderConstruction


Ignore:
Timestamp:
Jan 3, 2009, 9:07:00 PM (14 years ago)
Author:
viboes
Comment:

Adding ContraintsProgramming

Legend:

Unmodified
Added
Removed
Modified
  • LibrariesUnderConstruction

    v9 v10  
    316316
    317317---------------------------------------------------------------------------------------------------
    318 == !Accummulators.Ext ==
     318== Accummulators.Ext ==
    319319 * '''Suggested by:''' Vicente J. Botet Escriba 
    320320 * '''Description:''' Adding sliding, dependable and cyclic accumulators to Boost.Accumulators.
     
    376376}}}
    377377
     378---------------------------------------------------------------------------------------------------
     379== !ContraintsProgramming ==
     380 * '''Suggested by:''' Vicente J. Botet Escriba 
     381 * '''Description:''' Constraint programming is a programming paradigm where relations between variables are stated in the form of constraints. Constraints differ from the common primitives of imperative programming languages in that they do not specify a step or sequence of steps to execute, but rather the properties of a solution to be found. This makes Constraint Programming a form of declarative programming.
     382 
     383{{{
     384#!cpp
     385typedef bounded<int, closed<1>, closed<2> > domain;
     386problem_solver<domain, domain> p;
     387p.add_constraint(_1 + _2 == 3);
     388for {problem::iterator it = p.solutions(); it != p.end(); ++it) {
     389    domain a, b;
     390    tie(a,b) = *it;
     391    std::cout << "[" << a << ", " << b << "]" << std::endl;
     392}
     393}}}
    378394
    379395---------------------------------------------------------------------------------------------------
     
    494510---------------------------------------------------------------------------------------------------
    495511== Miscellaneous ==
     512 * [#!ContraintsProgramming ContraintsProgramming]
    496513 * [#Boost.Dataflow Dataflow]
    497514 * [#Boost.Fsm Fsm]