org.sat4j.reader
Class OPBReader2005

java.lang.Object
  extended by org.sat4j.reader.OPBReader2005
All Implemented Interfaces:
java.io.Serializable, Reader

public class OPBReader2005
extends java.lang.Object
implements Reader, java.io.Serializable

"Official" reader for the Pseudo Boolean evaluation 2005.

Author:
leberre, or, mederic baron
See Also:
Serialized Form

Constructor Summary
OPBReader2005(ISolver solver)
           
 
Method Summary
 java.lang.String decode(int[] model)
          Produce a model using the reader format.
 IVec<java.math.BigInteger> getCoeffs()
           
 ObjectiveFunction getObjectiveFunction()
           
 IVecInt getVars()
           
 void parse()
          parses the file and uses the callbacks to send to send the data back to the program
 void parseInstance(java.io.LineNumberReader in)
           
 IProblem parseInstance(java.lang.String filename)
           
 void readInteger(java.lang.StringBuffer s)
          read a integer from file
 java.lang.String readWord()
          read a word from file
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OPBReader2005

public OPBReader2005(ISolver solver)
Method Detail

getVars

public IVecInt getVars()

getCoeffs

public IVec<java.math.BigInteger> getCoeffs()

readWord

public java.lang.String readWord()
                          throws java.io.IOException
read a word from file

Returns:
the word we read
Throws:
java.io.IOException

readInteger

public void readInteger(java.lang.StringBuffer s)
                 throws java.io.IOException
read a integer from file

Parameters:
s - a StringBuffer to store the integer that was read
Throws:
java.io.IOException

parse

public void parse()
           throws java.io.IOException,
                  ParseFormatException,
                  ContradictionException
parses the file and uses the callbacks to send to send the data back to the program

Throws:
java.io.IOException
ParseException
ContradictionException
ParseFormatException

parseInstance

public IProblem parseInstance(java.lang.String filename)
                       throws java.io.FileNotFoundException,
                              ParseFormatException,
                              java.io.IOException,
                              ContradictionException
Specified by:
parseInstance in interface Reader
Throws:
java.io.FileNotFoundException
ParseFormatException
java.io.IOException
ContradictionException

parseInstance

public void parseInstance(java.io.LineNumberReader in)
                   throws ParseFormatException,
                          ContradictionException
Throws:
ParseFormatException
ContradictionException

decode

public java.lang.String decode(int[] model)
Description copied from interface: Reader
Produce a model using the reader format.

Specified by:
decode in interface Reader
Parameters:
model - a model using the Dimacs format.
Returns:
a human readable view of the model.

getObjectiveFunction

public ObjectiveFunction getObjectiveFunction()