carl  24.04
Computer ARithmetic Library
carl::io::DIMACSImporter< Pol > Class Template Reference

Parser for the DIMACS format. More...

#include <DIMACSImporter.h>

Collaboration diagram for carl::io::DIMACSImporter< Pol >:

Public Member Functions

 DIMACSImporter (const std::string &filename)
 Load the given file. More...
 
bool hasNext () const
 Checks if there is another formula to parse. More...
 
Formula< Polnext ()
 Parses and returns the next formula (until the next reset line). More...
 

Private Member Functions

Formula< PolparseLine (const std::string &line) const
 
Formula< PolparseFormula ()
 

Private Attributes

std::ifstream in
 
std::vector< Formula< Pol > > variables
 
std::regex headerRegex
 

Detailed Description

template<typename Pol>
class carl::io::DIMACSImporter< Pol >

Parser for the DIMACS format.

Allows for solving multiple formulas from one file by adding lines that only contain "reset".

Definition at line 20 of file DIMACSImporter.h.

Constructor & Destructor Documentation

◆ DIMACSImporter()

template<typename Pol >
carl::io::DIMACSImporter< Pol >::DIMACSImporter ( const std::string &  filename)
inline

Load the given file.

Definition at line 69 of file DIMACSImporter.h.

Member Function Documentation

◆ hasNext()

template<typename Pol >
bool carl::io::DIMACSImporter< Pol >::hasNext ( ) const
inline

Checks if there is another formula to parse.

Definition at line 75 of file DIMACSImporter.h.

◆ next()

template<typename Pol >
Formula<Pol> carl::io::DIMACSImporter< Pol >::next ( )
inline

Parses and returns the next formula (until the next reset line).

Definition at line 80 of file DIMACSImporter.h.

Here is the call graph for this function:

◆ parseFormula()

template<typename Pol >
Formula<Pol> carl::io::DIMACSImporter< Pol >::parseFormula ( )
inlineprivate

Definition at line 42 of file DIMACSImporter.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parseLine()

template<typename Pol >
Formula<Pol> carl::io::DIMACSImporter< Pol >::parseLine ( const std::string &  line) const
inlineprivate

Definition at line 26 of file DIMACSImporter.h.

Here is the call graph for this function:
Here is the caller graph for this function:

Field Documentation

◆ headerRegex

template<typename Pol >
std::regex carl::io::DIMACSImporter< Pol >::headerRegex
private

Definition at line 24 of file DIMACSImporter.h.

◆ in

template<typename Pol >
std::ifstream carl::io::DIMACSImporter< Pol >::in
private

Definition at line 22 of file DIMACSImporter.h.

◆ variables

template<typename Pol >
std::vector<Formula<Pol> > carl::io::DIMACSImporter< Pol >::variables
private

Definition at line 23 of file DIMACSImporter.h.


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