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-2022 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 "soplex/spxout.h"
17 #include "soplex/exceptions.h"
18 #include "soplex/spxalloc.h"
19 
20 namespace soplex
21 {
22 /// constructor
24  : m_verbosity(ERROR)
25  , m_streams(0)
26 {
28  m_streams = new(m_streams) std::ostream*[INFO3 + 1];
29  m_streams[ ERROR ] = m_streams[ WARNING ] = &std::cerr;
30 
31  for(int i = DEBUG; i <= INFO3; ++i)
32  m_streams[ i ] = &std::cout;
33 }
34 
35 //---------------------------------------------------
36 
37 // destructor
39 {
41 }
42 
44 {
45  m_verbosity = base.m_verbosity;
46 
47  for(int i = DEBUG; i <= INFO3; ++i)
48  m_streams[ i ] = base.m_streams[ i ];
49 
50  return *this;
51 }
52 
54 {
56  m_streams = 0;
58  m_streams = new(m_streams) std::ostream*[INFO3 + 1];
60 
61  for(int i = DEBUG; i <= INFO3; ++i)
62  m_streams[ i ] = rhs.m_streams[ i ];
63 }
64 
65 } // namespace soplex
Memory allocation routines.
Exception classes for SoPlex.
std::ostream ** m_streams
array of pointers to internal streams, indexed by verbosity level
Definition: spxout.h:191
Verbosity m_verbosity
verbosity level
Definition: spxout.h:189
virtual ~SPxOut()
destructor
Definition: spxout.cpp:38
SPxOut()
constructor
Definition: spxout.cpp:23
Wrapper for different output streams and verbosity levels.
void spx_alloc(T &p, int n=1)
Allocate memory.
Definition: spxalloc.h:49
Wrapper for several output streams. A verbosity level is used to decide which stream to use and wheth...
Definition: spxout.h:63
Everything should be within this namespace.
SPxOut & operator=(const SPxOut &)
assignment operator
Definition: spxout.cpp:43
void spx_free(T &p)
Release memory.
Definition: spxalloc.h:111