diff options
Diffstat (limited to 'libs/cassowary/cassowary/ClObjectiveVariable.h')
-rw-r--r-- | libs/cassowary/cassowary/ClObjectiveVariable.h | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/libs/cassowary/cassowary/ClObjectiveVariable.h b/libs/cassowary/cassowary/ClObjectiveVariable.h new file mode 100644 index 0000000000..664e2d65a4 --- /dev/null +++ b/libs/cassowary/cassowary/ClObjectiveVariable.h @@ -0,0 +1,63 @@ +// $Id$ +// +// Cassowary Incremental Constraint Solver +// Original Smalltalk Implementation by Alan Borning +// This C++ Implementation by Greg J. Badros, <gjb@cs.washington.edu> +// http://www.cs.washington.edu/homes/gjb +// (C) 1998, 1999 Greg J. Badros and Alan Borning +// See ../LICENSE for legal details regarding this software +// +// ClObjectiveVariable.h + +#ifndef ClObjectiveVariable_H +#define ClObjectiveVariable_H + +#if defined(HAVE_CONFIG_H) && !defined(CONFIG_H_INCLUDED) && !defined(CONFIG_INLINE_H_INCLUDED) +#include <cassowary/config-inline.h> +#define CONFIG_INLINE_H_INCLUDED +#endif + +#include "Cassowary.h" +#include "ClAbstractVariable.h" + +class ClTableau; +class ClSimplexSolver; + +class ClObjectiveVariable : public ClAbstractVariable { +protected: + friend class ClTableau; + friend class ClSimplexSolver; + + ClObjectiveVariable(string name = "") : + ClAbstractVariable(name) + { } + + ClObjectiveVariable(long number, char *prefix) : + ClAbstractVariable(number,prefix) + { } + +#ifndef CL_NO_IO + virtual ostream &PrintOn(ostream &xo) const + { + xo << "[" << Name() << ":obj]"; + return xo; + } +#endif + + // We don't need to give such variables a Value after solving is complete. + virtual bool IsExternal() const + { return false; } + + // Return true if we can Pivot on this variable. + virtual bool IsPivotable() const + { return false; } + + // Return true if this is a restricted (or slack) variable. Such + // variables are constrained to be non-negative and occur only + // internally to the simplex solver. + virtual bool IsRestricted() const + { return false; } + +}; + +#endif |