Initial revision
[ardour.git] / libs / cassowary / cassowary / ClObjectiveVariable.h
1 // $Id$
2 //
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
9 //
10 // ClObjectiveVariable.h
11
12 #ifndef ClObjectiveVariable_H
13 #define ClObjectiveVariable_H
14
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
18 #endif
19
20 #include "Cassowary.h"
21 #include "ClAbstractVariable.h"
22
23 class ClTableau;
24 class ClSimplexSolver;
25
26 class ClObjectiveVariable : public ClAbstractVariable {
27 protected:
28   friend class ClTableau;
29   friend class ClSimplexSolver;
30
31   ClObjectiveVariable(string name = "") :
32     ClAbstractVariable(name)
33     { }
34
35   ClObjectiveVariable(long number, char *prefix) :
36     ClAbstractVariable(number,prefix)
37     { }
38
39 #ifndef CL_NO_IO
40   virtual ostream &PrintOn(ostream &xo) const
41   {  
42     xo << "[" << Name() << ":obj]";
43     return xo;
44   }
45 #endif
46
47   // We don't need to give such variables a Value after solving is complete.
48   virtual bool IsExternal() const 
49     { return false; }
50
51   // Return true if we can Pivot on this variable.
52   virtual bool IsPivotable() const 
53     { return false; }
54
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 
59     { return false; }
60
61 };
62
63 #endif