ip.h 717 Bytes
/*
 * Copyright (C) 2012 Kengo Sato
 *
 * This file comes from DAFS.
 *
 */

#ifndef __INC_IP_H__
#define __INC_IP_H__

class IPimpl;

class IP
{
public:
  typedef enum {MIN, MAX} DirType;
  typedef enum {FR, LO, UP, DB, FX} BoundType;

public:
  IP();
  IP(DirType dir, int n_th);
  ~IP();
  int make_variable(double coef);
  int make_variable_r(double coef);
  int make_variable(double coef, int lo, int hi);
  int make_constraint(BoundType bnd, double l, double u);
  void add_constraint(int row, int col, double val);
  void chg_constraint(int row, BoundType bnd, double l, double u);
  void update();
  int solve();
  double get_value(int col);// const;
  double get_obj();

private:
  IPimpl* impl_;
};

#endif