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-2019 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 "soplex/spxid.h"
20 #include "soplex/exceptions.h"
21 
22 namespace soplex
23 {
25  : DataKey(p_key)
26 {
28 }
29 
31  : DataKey(p_key)
32 {
33  assert(!p_key.isSPxRowId());
34 
36 }
37 
39  : DataKey(p_key)
40 {
42 }
43 
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 
60  case SPxId::COL_ID :
61  os << "col ";
62  break;
63 
64  case SPxId::INVALID :
65  os << "Invalid ";
66  break;
67 
68  default :
69  throw SPxInternalCodeException("XSPXID01 This should never happen.");
70  }
71 
72  os << id.idx << " (" << id.info << ")";
73 
74  return os;
75 }
76 
77 } // namespace soplex
Exception class for things that should NEVER happen.This class is derived from the SoPlex exception b...
Definition: exceptions.h:109
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:1136
bool isSPxColId() const
is id a column id?
Definition: spxid.h:166
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.
bool isSPxRowId() const
is id a row id?
Definition: spxid.h:161