Documentation
¶
Overview ¶
Package dimacs provides support for reading dimacs cnf files and variants.
Index ¶
- func NewCommentFilter(r io.Reader) io.Reader
- func ReadCnf(r io.Reader, vis CnfVis) error
- func ReadCnfStrict(r io.Reader, vis CnfVis, strict bool) error
- func ReadICnf(r io.Reader, vis ICnfVis) error
- func ReadSolve(r io.Reader, vis SolveVis) error
- type CnfVis
- type CommentFilter
- type ICnfVis
- type SolveVis
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReadCnfStrict ¶
ReadCnfStrict reads a dimacs CNF file with strict (count of vars/clauses in header) specified.
Types ¶
type CnfVis ¶
type CnfVis interface {
// Init is called on a problem line defining number of variables and
// number of clauses. If this is not given and strict enforcement
// of their presence is lacking, then this is called with some defaults.
Init(v, c int)
// Add adds a dimacs literal as an int
Add(m z.Lit)
// Called at end of file.
Eof()
}
Type Vis provides a visitor interface to reading dimacs files.
Anything implementing Vis can read a dimacs file.
type CommentFilter ¶
type CommentFilter struct {
// contains filtered or unexported fields
}
CommentFilter is a wrapper around reader which filters out dimacs comments.
Click to show internal directories.
Click to hide internal directories.