blob: 664e2d65a487df643bccee57d2d22c54d0c6bdbf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
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
|