ADS
Algorithms and Data Structures
Loading...
Searching...
No Matches
MonteCarlo.h
Go to the documentation of this file.
1/*--------------------------------------------------------------------------*/
2/*--------------------------- File MonteCarlo.h ----------------------------*/
3/*--------------------------------------------------------------------------*/
51/*--------------------------------------------------------------------------*/
52/*----------------------------- DEFINITIONS --------------------------------*/
53/*--------------------------------------------------------------------------*/
54
55#ifndef __ADS_MonteCarlo
56 #define __ADS_MonteCarlo
57/* self-identification: #endif constant */
58
59/*--------------------------------------------------------------------------*/
60/*------------------------------ INCLUDES ----------------------------------*/
61/*--------------------------------------------------------------------------*/
62
63#include "ADS/Contract.h"
64
65#include <algorithm>
66#include <cstddef>
67#include <limits>
68#include <random>
69#include <vector>
70
71/*--------------------------------------------------------------------------*/
72/*--------------------------- NAMESPACE ------------------------------------*/
73/*--------------------------------------------------------------------------*/
74
75namespace ADS
76{
77
96template< class F , class R >
97bool zeroPolynomial( F && p , std::size_t n , long d , int K , R & rng );
98
117template< class T , class R >
118bool freivalds( const std::vector< std::vector< T > > & A ,
119 const std::vector< std::vector< T > > & B ,
120 const std::vector< std::vector< T > > & C , int K , R & rng );
121
135template< class F , class R >
136bool halfSatisfiable( F && f , std::size_t n , int K , R & rng );
137
138/*--------------------------------------------------------------------------*/
139
140} // end( namespace ADS )
141
142/*--------------------------------------------------------------------------*/
143/*-------------------------- IMPLEMENTATION --------------------------------*/
144/*--------------------------------------------------------------------------*/
145
146#include "ADS/algorithm/impl/MonteCarlo.tpp"
147
148/*--------------------------------------------------------------------------*/
149
150#endif /* MonteCarlo.h included */
151
152/*--------------------------------------------------------------------------*/
153/*------------------------- End File MonteCarlo.h --------------------------*/
154/*--------------------------------------------------------------------------*/
The contracts of ADS: the preconditions, the postconditions and the invariants of the operations,...
bool halfSatisfiable(F &&f, std::size_t n, int K, R &rng)
whether the formula of variables is true on more than half of the assignments, from random ones
bool freivalds(const std::vector< std::vector< T > > &A, const std::vector< std::vector< T > > &B, const std::vector< std::vector< T > > &C, int K, R &rng)
whether , by runs of
bool zeroPolynomial(F &&p, std::size_t n, long d, int K, R &rng)
whether , of variables and total degree , is identically 0, by random points
Definition ADT.h:96