SoPlex
Toggle main menu visibility
Loading...
Searching...
No Matches
src
soplex
spxout.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 "
soplex/spxout.h
"
26
#include "
soplex/exceptions.h
"
27
#include "
soplex/spxalloc.h
"
28
29
namespace
soplex
30
{
31
/// constructor
32
SPxOut::SPxOut
()
33
:
m_verbosity
(
VERB_ERROR
)
34
,
m_streams
(nullptr)
35
{
36
spx_alloc
(
m_streams
,
VERB_INFO3
+ 1);
37
m_streams
=
new
(
m_streams
) std::ostream*[
VERB_INFO3
+ 1];
38
m_streams
[
VERB_ERROR
] =
m_streams
[
VERB_WARNING
] = &std::cerr;
39
40
for
(
int
i =
VERB_DEBUG
; i <=
VERB_INFO3
; ++i)
41
m_streams
[ i ] = &std::cout;
42
}
43
44
//---------------------------------------------------
45
46
// destructor
47
SPxOut::~SPxOut
()
48
{
49
spx_free
(
m_streams
);
50
}
51
52
SPxOut
&
SPxOut::operator=
(
const
SPxOut
& base)
53
{
54
if
(
this
!= &base)
55
m_verbosity
= base.
m_verbosity
;
56
57
for
(
int
i =
VERB_DEBUG
; i <=
VERB_INFO3
; ++i)
58
m_streams
[ i ] = base.
m_streams
[ i ];
59
60
return
*
this
;
61
}
62
63
SPxOut::SPxOut
(
const
SPxOut
& rhs)
64
{
65
m_verbosity
= rhs.
m_verbosity
;
66
m_streams
=
nullptr
;
67
spx_alloc
(
m_streams
,
VERB_INFO3
+ 1);
68
m_streams
=
new
(
m_streams
) std::ostream*[
VERB_INFO3
+ 1];
69
m_streams
[
VERB_ERROR
] =
m_streams
[
VERB_WARNING
] = rhs.
m_streams
[
VERB_ERROR
];
70
71
for
(
int
i =
VERB_DEBUG
; i <=
VERB_INFO3
; ++i)
72
m_streams
[ i ] = rhs.
m_streams
[ i ];
73
}
74
75
}
// namespace soplex
soplex::SPxOut::m_streams
std::ostream ** m_streams
array of pointers to internal streams, indexed by verbosity level
Definition
spxout.h:225
soplex::SPxOut::operator=
SPxOut & operator=(const SPxOut &)
assignment operator
Definition
spxout.cpp:52
soplex::SPxOut::VERB_DEBUG
@ VERB_DEBUG
Definition
spxout.h:93
soplex::SPxOut::VERB_INFO3
@ VERB_INFO3
Definition
spxout.h:96
soplex::SPxOut::VERB_ERROR
@ VERB_ERROR
Definition
spxout.h:91
soplex::SPxOut::VERB_WARNING
@ VERB_WARNING
Definition
spxout.h:92
soplex::SPxOut::SPxOut
SPxOut()
constructor
Definition
spxout.cpp:32
soplex::SPxOut::~SPxOut
virtual ~SPxOut()
destructor
Definition
spxout.cpp:47
soplex::SPxOut::m_verbosity
Verbosity m_verbosity
verbosity level
Definition
spxout.h:223
exceptions.h
Exception classes for SoPlex.
soplex
Everything should be within this namespace.
soplex::spx_alloc
void spx_alloc(T &p, size_t n=1)
Allocate memory.
Definition
spxalloc.h:58
soplex::spx_free
void spx_free(T &p)
Release memory.
Definition
spxalloc.h:118
spxalloc.h
Memory allocation routines.
spxout.h
Wrapper for different output streams and verbosity levels.
Generated by
1.17.0