ADS
Algorithms and Data Structures
Toggle main menu visibility
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
75
namespace
ADS
76
{
77
96
template
<
class
F ,
class
R >
97
bool
zeroPolynomial
( F && p , std::size_t n ,
long
d ,
int
K , R & rng );
98
117
template
<
class
T ,
class
R >
118
bool
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
135
template
<
class
F ,
class
R >
136
bool
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
/*--------------------------------------------------------------------------*/
Contract.h
The contracts of ADS: the preconditions, the postconditions and the invariants of the operations,...
ADS::halfSatisfiable
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
ADS::freivalds
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
ADS::zeroPolynomial
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
ADS
Definition
ADT.h:96
ADS
algorithm
MonteCarlo.h
Generated by
1.17.0