OKlibrary  0.2.1.6
OKlib::InputOutput::CLSAdaptorRandomShuffle< Int, String, RandomGenerator, OutputCLSAdaptor > Class Template Reference

Adaptor which sorts the clause-list given to it. More...

List of all members.

Public Types

typedef Int int_type
typedef String string_type
typedef OutputCLSAdaptor output_cls_adaptor_type
typedef RawDimacsCLSAdaptor stored_cls_adaptor_type
typedef
stored_cls_adaptor_type::clause_type 
stored_clause_type
typedef RandomGenerator base_generator_type

Public Member Functions

 CLSAdaptorRandomShuffle (base_generator_type &rand_gen, output_cls_adaptor_type &cls_adaptor_arg)
void comment (const string_type &s)
void n (const int_type pn)
void c (const int_type pc)
void finish ()
void tautological_clause (const int_type t)
template<class ForwardRange >
void clause (const ForwardRange &r, const int_type t)

Detailed Description

template<typename Int = int, class String = std::string, class RandomGenerator = boost::mt19937, class OutputCLSAdaptor = OKlib::InputOutput::CLSAdaptorDIMACSOutput<>>
class OKlib::InputOutput::CLSAdaptorRandomShuffle< Int, String, RandomGenerator, OutputCLSAdaptor >

Adaptor which sorts the clause-list given to it.

Given a random number generator, applies a random permutation to the given clause-list using the random number generator as input to std::random_shuffle. The result clause-list is output to the given clause-adaptor.

The random permutation used is determined by using the given random number generator and this is then used as the random number generator input for the C++ std::random_shuffle on the clause-list (in the order it is given in the input).

Note that as the input must all be read before it can be shuffled, there may be a large delay between the input of a clause into this adaptor and it's output to the output adaptor.

Definition at line 97 of file RandomShuffleDimacs.cpp.


Member Typedef Documentation

template<typename Int = int, class String = std::string, class RandomGenerator = boost::mt19937, class OutputCLSAdaptor = OKlib::InputOutput::CLSAdaptorDIMACSOutput<>>
typedef RandomGenerator OKlib::InputOutput::CLSAdaptorRandomShuffle< Int, String, RandomGenerator, OutputCLSAdaptor >::base_generator_type

Definition at line 106 of file RandomShuffleDimacs.cpp.

template<typename Int = int, class String = std::string, class RandomGenerator = boost::mt19937, class OutputCLSAdaptor = OKlib::InputOutput::CLSAdaptorDIMACSOutput<>>
typedef Int OKlib::InputOutput::CLSAdaptorRandomShuffle< Int, String, RandomGenerator, OutputCLSAdaptor >::int_type

Definition at line 101 of file RandomShuffleDimacs.cpp.

template<typename Int = int, class String = std::string, class RandomGenerator = boost::mt19937, class OutputCLSAdaptor = OKlib::InputOutput::CLSAdaptorDIMACSOutput<>>
typedef OutputCLSAdaptor OKlib::InputOutput::CLSAdaptorRandomShuffle< Int, String, RandomGenerator, OutputCLSAdaptor >::output_cls_adaptor_type

Definition at line 103 of file RandomShuffleDimacs.cpp.

template<typename Int = int, class String = std::string, class RandomGenerator = boost::mt19937, class OutputCLSAdaptor = OKlib::InputOutput::CLSAdaptorDIMACSOutput<>>
typedef stored_cls_adaptor_type::clause_type OKlib::InputOutput::CLSAdaptorRandomShuffle< Int, String, RandomGenerator, OutputCLSAdaptor >::stored_clause_type

Definition at line 105 of file RandomShuffleDimacs.cpp.

template<typename Int = int, class String = std::string, class RandomGenerator = boost::mt19937, class OutputCLSAdaptor = OKlib::InputOutput::CLSAdaptorDIMACSOutput<>>
typedef RawDimacsCLSAdaptor OKlib::InputOutput::CLSAdaptorRandomShuffle< Int, String, RandomGenerator, OutputCLSAdaptor >::stored_cls_adaptor_type

Definition at line 104 of file RandomShuffleDimacs.cpp.

template<typename Int = int, class String = std::string, class RandomGenerator = boost::mt19937, class OutputCLSAdaptor = OKlib::InputOutput::CLSAdaptorDIMACSOutput<>>
typedef String OKlib::InputOutput::CLSAdaptorRandomShuffle< Int, String, RandomGenerator, OutputCLSAdaptor >::string_type

Definition at line 102 of file RandomShuffleDimacs.cpp.


Constructor & Destructor Documentation

template<typename Int = int, class String = std::string, class RandomGenerator = boost::mt19937, class OutputCLSAdaptor = OKlib::InputOutput::CLSAdaptorDIMACSOutput<>>
OKlib::InputOutput::CLSAdaptorRandomShuffle< Int, String, RandomGenerator, OutputCLSAdaptor >::CLSAdaptorRandomShuffle ( base_generator_type rand_gen,
output_cls_adaptor_type cls_adaptor_arg 
) [inline]

Definition at line 110 of file RandomShuffleDimacs.cpp.


Member Function Documentation

template<typename Int = int, class String = std::string, class RandomGenerator = boost::mt19937, class OutputCLSAdaptor = OKlib::InputOutput::CLSAdaptorDIMACSOutput<>>
void OKlib::InputOutput::CLSAdaptorRandomShuffle< Int, String, RandomGenerator, OutputCLSAdaptor >::c ( const int_type  pc) [inline]
template<typename Int = int, class String = std::string, class RandomGenerator = boost::mt19937, class OutputCLSAdaptor = OKlib::InputOutput::CLSAdaptorDIMACSOutput<>>
template<class ForwardRange >
void OKlib::InputOutput::CLSAdaptorRandomShuffle< Int, String, RandomGenerator, OutputCLSAdaptor >::clause ( const ForwardRange &  r,
const int_type  t 
) [inline]
template<typename Int = int, class String = std::string, class RandomGenerator = boost::mt19937, class OutputCLSAdaptor = OKlib::InputOutput::CLSAdaptorDIMACSOutput<>>
void OKlib::InputOutput::CLSAdaptorRandomShuffle< Int, String, RandomGenerator, OutputCLSAdaptor >::comment ( const string_type s) [inline]

Definition at line 115 of file RandomShuffleDimacs.cpp.

template<typename Int = int, class String = std::string, class RandomGenerator = boost::mt19937, class OutputCLSAdaptor = OKlib::InputOutput::CLSAdaptorDIMACSOutput<>>
void OKlib::InputOutput::CLSAdaptorRandomShuffle< Int, String, RandomGenerator, OutputCLSAdaptor >::finish ( ) [inline]
template<typename Int = int, class String = std::string, class RandomGenerator = boost::mt19937, class OutputCLSAdaptor = OKlib::InputOutput::CLSAdaptorDIMACSOutput<>>
void OKlib::InputOutput::CLSAdaptorRandomShuffle< Int, String, RandomGenerator, OutputCLSAdaptor >::n ( const int_type  pn) [inline]
template<typename Int = int, class String = std::string, class RandomGenerator = boost::mt19937, class OutputCLSAdaptor = OKlib::InputOutput::CLSAdaptorDIMACSOutput<>>
void OKlib::InputOutput::CLSAdaptorRandomShuffle< Int, String, RandomGenerator, OutputCLSAdaptor >::tautological_clause ( const int_type  t) [inline]

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