SoPlex
Toggle main menu visibility
Loading...
Searching...
No Matches
src
soplex
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-2026 Zuse Institute Berlin (ZIB) */
7
/* */
8
/* Licensed under the Apache License, Version 2.0 (the "License"); */
9
/* you may not use this file except in compliance with the License. */
10
/* You may obtain a copy of the License at */
11
/* */
12
/* http://www.apache.org/licenses/LICENSE-2.0 */
13
/* */
14
/* Unless required by applicable law or agreed to in writing, software */
15
/* distributed under the License is distributed on an "AS IS" BASIS, */
16
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
17
/* See the License for the specific language governing permissions and */
18
/* limitations under the License. */
19
/* */
20
/* You should have received a copy of the Apache-2.0 license */
21
/* along with SoPlex; see the file LICENSE. If not email to soplex@zib.de. */
22
/* */
23
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
24
25
#include <stdlib.h>
26
#include <assert.h>
27
28
#include "
soplex/spxid.h
"
29
#include "
soplex/exceptions.h
"
30
31
namespace
soplex
32
{
33
SPxColId::SPxColId
(
const
DataKey
& p_key)
34
:
DataKey
(p_key)
35
{
36
info
=
SPxId::COL_ID
;
37
}
38
39
SPxColId::SPxColId
(
const
SPxId
& p_key)
40
:
DataKey
(p_key)
41
{
42
assert(!p_key.
isSPxRowId
());
43
44
info
=
SPxId::COL_ID
;
45
}
46
47
SPxRowId::SPxRowId
(
const
DataKey
& p_key)
48
:
DataKey
(p_key)
49
{
50
info
=
SPxId::ROW_ID
;
51
}
52
53
SPxRowId::SPxRowId
(
const
SPxId
& p_key)
54
:
DataKey
(p_key)
55
{
56
assert(!p_key.
isSPxColId
());
57
58
info
=
SPxId::ROW_ID
;
59
}
60
61
std::ostream&
operator<<
(std::ostream& os,
const
SPxId
&
id
)
62
{
63
switch
(
id
.
type
())
64
{
65
case
SPxId::ROW_ID
:
66
os <<
"row "
;
67
break
;
68
69
case
SPxId::COL_ID
:
70
os <<
"col "
;
71
break
;
72
73
case
SPxId::INVALID
:
74
os <<
"Invalid "
;
75
break
;
76
77
default :
78
throw
SPxInternalCodeException
(
"XSPXID01 This should never happen."
);
79
}
80
81
os <<
id
.idx <<
" ("
<<
id
.info <<
")"
;
82
83
return
os;
84
}
85
86
}
// namespace soplex
soplex::DataKey::info
int info
user information to store values -1, 0, +1
Definition
datakey.h:64
soplex::DataKey::DataKey
DataKey()
Default constructor. Constructs an invalid DataKey.
Definition
datakey.h:74
soplex::SPxColId::SPxColId
SPxColId()
default constructor.
Definition
spxid.h:49
soplex::SPxId
Generic Ids for LP rows or columns.
Definition
spxid.h:95
soplex::SPxId::SPxId
SPxId()
default constructor. Constructs an invalid id.
Definition
spxid.h:116
soplex::SPxId::isSPxColId
bool isSPxColId() const
is id a column id?
Definition
spxid.h:168
soplex::SPxId::ROW_ID
@ ROW_ID
row identifier.
Definition
spxid.h:106
soplex::SPxId::COL_ID
@ COL_ID
column identifier.
Definition
spxid.h:108
soplex::SPxId::INVALID
@ INVALID
invalid id.
Definition
spxid.h:107
soplex::SPxId::isSPxRowId
bool isSPxRowId() const
is id a row id?
Definition
spxid.h:163
soplex::SPxId::type
Type type() const
returns the type of the id.
Definition
spxid.h:148
soplex::SPxInternalCodeException
Exception class for things that should NEVER happen.
Definition
exceptions.h:121
soplex::SPxRowId::SPxRowId
SPxRowId()
default constructor.
Definition
spxid.h:68
exceptions.h
Exception classes for SoPlex.
soplex
Everything should be within this namespace.
soplex::operator<<
std::ostream & operator<<(std::ostream &s, const VectorBase< R > &vec)
Output operator.
Definition
basevectors.h:1110
spxid.h
Row and columns Id's SPxLP.
Generated by
1.17.0