示例#1
0
// Print appends the formula in DIMACS format to the given io.Writer.
func (p *Pigosat) Print(w io.Writer) error {
	defer p.ready(true)()
	return cFileWriterWrapper(w, func(cfile *C.FILE) error {
		// void picosat_print (PicoSAT *, FILE *);
		_, err := C.picosat_print(p.p, cfile)
		return err
	})
}
示例#2
0
文件: pigosat.go 项目: sacado/pigosat
// Print appends the CNF in DIMACS format to the given file.
func (p *Pigosat) Print(file *os.File) error {
	defer p.ready(true)()
	cfile, err := cfdopen(file, "a")
	if err != nil {
		return err
	}
	// void picosat_print (PicoSAT *, FILE *);
	_, err = C.picosat_print(p.p, cfile)
	return err
}