Scippy

SoPlex

Sequential object-oriented simPlex

spxid.cpp
Go to the documentation of this file.
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2 /* */
3 /* This file is part of the class library */
4 /* SoPlex --- the Sequential object-oriented simPlex. */
5 /* */
6 /* Copyright (C) 1996-2016 Konrad-Zuse-Zentrum */
7 /* fuer Informationstechnik Berlin */
8 /* */
9 /* SoPlex is distributed under the terms of the ZIB Academic Licence. */
10 /* */
11 /* You should have received a copy of the ZIB Academic License */
12 /* along with SoPlex; see the file COPYING. If not email to soplex@zib.de. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 #include <stdlib.h>
17 #include <assert.h>
18 
19 #include "spxid.h"
20 #include "exceptions.h"
21 
22 namespace soplex
23 {
25  : DataKey(p_key)
26 {
28 }
29 
30 SPxColId::SPxColId(const SPxId& p_key)
31  : DataKey(p_key)
32 {
33  assert(!p_key.isSPxRowId());
34 
36 }
37 
39  : DataKey(p_key)
40 {
42 }
43 
44 SPxRowId::SPxRowId(const SPxId& p_key)
45  : DataKey(p_key)
46 {
47  assert(!p_key.isSPxColId());
48 
50 }
51 
52 std::ostream& operator<<(std::ostream& os, const SPxId& id)
53 {
54  switch(id.type())
55  {
56  case SPxId::ROW_ID:
57  os << "row ";
58  break;
59  case SPxId::COL_ID :
60  os << "col ";
61  break;
62  case SPxId::INVALID :
63  os << "Invalid ";
64  break;
65  default :
66  throw SPxInternalCodeException("XSPXID01 This should never happen.");
67  }
68  os << id.idx << " (" << id.info << ")";
69 
70  return os;
71 }
72 
73 } // namespace soplex
bool isSPxRowId() const
is id a row id?
Definition: spxid.h:160
Exception class for things that should NEVER happen.This class is derived from the SoPlex exception b...
Definition: exceptions.h:109
bool isSPxColId() const
is id a column id?
Definition: spxid.h:165
Exception classes for SoPlex.
SPxRowId()
default constructor.
Definition: spxid.h:59
invalid id.
Definition: spxid.h:98
SPxColId()
default constructor.
Definition: spxid.h:40
Entry identifier class for items of a DataSet.Every item in a DataSet is assigned a DataKey by which ...
Definition: datakey.h:46
Generic Ids for LP rows or columns.Both SPxColIds and SPxRowIds may be treated uniformly as SPxIds: ...
Definition: spxid.h:85
Row and columns Id&#39;s SPxLP.
std::ostream & operator<<(std::ostream &s, const VectorBase< R > &vec)
Output operator.
Definition: basevectors.h:1087
int info
user information to store values -1, 0, +1
Definition: datakey.h:55
row identifier.
Definition: spxid.h:97
column identifier.
Definition: spxid.h:99
Everything should be within this namespace.