3 // Cassowary Incremental Constraint Solver
4 // Original Smalltalk Implementation by Alan Borning
5 // This C++ Implementation by Greg J. Badros, <gjb@cs.washington.edu>
6 // http://www.cs.washington.edu/homes/gjb
7 // (C) 1998, 1999 Greg J. Badros and Alan Borning
8 // See ../LICENSE for legal details regarding this software
10 // ClObjectiveVariable.h
12 #ifndef ClObjectiveVariable_H
13 #define ClObjectiveVariable_H
15 #if defined(HAVE_CONFIG_H) && !defined(CONFIG_H_INCLUDED) && !defined(CONFIG_INLINE_H_INCLUDED)
16 #include <cassowary/config-inline.h>
17 #define CONFIG_INLINE_H_INCLUDED
20 #include "Cassowary.h"
21 #include "ClAbstractVariable.h"
24 class ClSimplexSolver;
26 class ClObjectiveVariable : public ClAbstractVariable {
28 friend class ClTableau;
29 friend class ClSimplexSolver;
31 ClObjectiveVariable(string name = "") :
32 ClAbstractVariable(name)
35 ClObjectiveVariable(long number, char *prefix) :
36 ClAbstractVariable(number,prefix)
40 virtual ostream &PrintOn(ostream &xo) const
42 xo << "[" << Name() << ":obj]";
47 // We don't need to give such variables a Value after solving is complete.
48 virtual bool IsExternal() const
51 // Return true if we can Pivot on this variable.
52 virtual bool IsPivotable() const
55 // Return true if this is a restricted (or slack) variable. Such
56 // variables are constrained to be non-negative and occur only
57 // internally to the simplex solver.
58 virtual bool IsRestricted() const