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-2024 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
31namespace soplex
32{
34 : DataKey(p_key)
35{
37}
38
40 : DataKey(p_key)
41{
42 assert(!p_key.isSPxRowId());
43
45}
46
48 : DataKey(p_key)
49{
51}
52
54 : DataKey(p_key)
55{
56 assert(!p_key.isSPxColId());
57
59}
60
61std::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
Entry identifier class for items of a DataSet.
Definition: datakey.h:56
int info
user information to store values -1, 0, +1
Definition: datakey.h:64
SPxColId()
default constructor.
Definition: spxid.h:49
Generic Ids for LP rows or columns.
Definition: spxid.h:95
bool isSPxColId() const
is id a column id?
Definition: spxid.h:168
@ ROW_ID
row identifier.
Definition: spxid.h:106
@ COL_ID
column identifier.
Definition: spxid.h:108
@ INVALID
invalid id.
Definition: spxid.h:107
bool isSPxRowId() const
is id a row id?
Definition: spxid.h:163
Exception class for things that should NEVER happen.
Definition: exceptions.h:119
SPxRowId()
default constructor.
Definition: spxid.h:68
Exception classes for SoPlex.
Everything should be within this namespace.
std::ostream & operator<<(std::ostream &s, const VectorBase< R > &vec)
Output operator.
Definition: basevectors.h:1143
Row and columns Id's SPxLP.