#ifndef GCG_MATRIXGRAPH_H_
#define GCG_MATRIXGRAPH_H_
#include "objscip/objscip.h"
#include "tclique/tclique.h"
#include "weights.h"
#include "pub_decomp.h"
#include "bridge.h"
#include "graph_interface.h"
#include "class_partialdecomp.h"
#include "class_detprobdata.h"
#include <exception>
#include <vector>
#include <string>
namespace gcg {
template <class T>
class MatrixGraph {
public:
std::string name;
protected:
SCIP* scip_;
int nconss;
int nvars;
int dummynodes;
Weights weights;
GraphInterface *graphiface;
int nnonzeroes;
public:
MatrixGraph(
SCIP* scip,
Weights w
);
virtual ~MatrixGraph();
virtual SCIP_RETCODE writeToFile(
int fd,
SCIP_Bool writeweights
)
{
SCIP_CALL(graphiface->writeToFile(fd, writeweights) );
return SCIP_OKAY;
}
virtual SCIP_RETCODE createDecompFromPartition(
DEC_DECOMP** decomp
)
{
return SCIP_ERROR;
}
virtual SCIP_RETCODE createPartialdecFromPartition(
PARTIALDECOMP* oldpartialdec,
PARTIALDECOMP** firstpartialdec,
PARTIALDECOMP** secondpartialdec,
DETPROBDATA* detprobdata
)
{
return SCIP_ERROR;
}
virtual SCIP_RETCODE readPartition(
const char* filename
)
{
SCIP_CALL( graphiface->readPartition(filename) );
return SCIP_OKAY;
}
void setDummynodes(int dummynodes_)
{
dummynodes = dummynodes_;
}
int getDummynodes() const
{
return dummynodes;
}
virtual std::vector<int> getPartition()
{
return graphiface->getPartition();
}
virtual SCIP_RETCODE createFromMatrix(
SCIP_CONS** conss,
SCIP_VAR** vars,
int nconss_,
int nvars_
) { return SCIP_ERROR; }
virtual SCIP_RETCODE createFromPartialMatrix(
DETPROBDATA* detprobdata,
PARTIALDECOMP* partialdec
) { return SCIP_ERROR; }
virtual int getNNonzeroes() const
{
return nnonzeroes;
}
};
}
#endif