Scippy

SoPlex

Sequential object-oriented simPlex

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-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 "soplex/spxout.h"
26#include "soplex/exceptions.h"
27#include "soplex/spxalloc.h"
28
29namespace soplex
30{
31/// constructor
33 : m_verbosity(ERROR)
34 , m_streams(nullptr)
35{
37 m_streams = new(m_streams) std::ostream*[INFO3 + 1];
38 m_streams[ ERROR ] = m_streams[ WARNING ] = &std::cerr;
39
40 for(int i = DEBUG; i <= INFO3; ++i)
41 m_streams[ i ] = &std::cout;
42}
43
44//---------------------------------------------------
45
46// destructor
48{
50}
51
53{
54 if(this != &base)
56
57 for(int i = DEBUG; i <= INFO3; ++i)
58 m_streams[ i ] = base.m_streams[ i ];
59
60 return *this;
61}
62
64{
66 m_streams = nullptr;
68 m_streams = new(m_streams) std::ostream*[INFO3 + 1];
70
71 for(int i = DEBUG; i <= INFO3; ++i)
72 m_streams[ i ] = rhs.m_streams[ i ];
73}
74
75} // namespace soplex
Wrapper for several output streams. A verbosity level is used to decide which stream to use and wheth...
Definition: spxout.h:78
std::ostream ** m_streams
array of pointers to internal streams, indexed by verbosity level
Definition: spxout.h:225
SPxOut & operator=(const SPxOut &)
assignment operator
Definition: spxout.cpp:52
SPxOut()
constructor
Definition: spxout.cpp:32
virtual ~SPxOut()
destructor
Definition: spxout.cpp:47
Verbosity m_verbosity
verbosity level
Definition: spxout.h:223
Exception classes for SoPlex.
Everything should be within this namespace.
void spx_free(T &p)
Release memory.
Definition: spxalloc.h:121
void spx_alloc(T &p, int n=1)
Allocate memory.
Definition: spxalloc.h:58
Memory allocation routines.
Wrapper for different output streams and verbosity levels.