Toggle navigation
SCIP Optimization Suite
SCIP
SoPlex
ZIMPL
UG
GCG
Documentation
SoPlex 6.0.3
SoPlex 5.0.2
SoPlex 4.0.2
SoPlex 3.1.0
SoPlex 3.0.1
SoPlex 2.2.1
SoPlex
Sequential object-oriented simPlex
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
soplex-repo
src
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-2015 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
{
24
SPxColId::SPxColId
(
const
DataKey
& p_key)
25
:
DataKey
(p_key)
26
{
27
info
=
SPxId::COL_ID
;
28
}
29
30
SPxColId::SPxColId
(
const
SPxId
& p_key)
31
:
DataKey
(p_key)
32
{
33
assert(!p_key.
isSPxRowId
());
34
35
info
=
SPxId::COL_ID
;
36
}
37
38
SPxRowId::SPxRowId
(
const
DataKey
& p_key)
39
:
DataKey
(p_key)
40
{
41
info
=
SPxId::ROW_ID
;
42
}
43
44
SPxRowId::SPxRowId
(
const
SPxId
& p_key)
45
:
DataKey
(p_key)
46
{
47
assert(!p_key.
isSPxColId
());
48
49
info
=
SPxId::ROW_ID
;
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