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-2023 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
33  : m_verbosity(ERROR)
34  , m_streams(0)
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)
55  m_verbosity = base.m_verbosity;
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 = 0;
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
Memory allocation routines.
Exception classes for SoPlex.
std::ostream ** m_streams
array of pointers to internal streams, indexed by verbosity level
Definition: spxout.h:225
Verbosity m_verbosity
verbosity level
Definition: spxout.h:223
virtual ~SPxOut()
destructor
Definition: spxout.cpp:47
SPxOut()
constructor
Definition: spxout.cpp:32
Wrapper for different output streams and verbosity levels.
void spx_alloc(T &p, int n=1)
Allocate memory.
Definition: spxalloc.h:58
Wrapper for several output streams. A verbosity level is used to decide which stream to use and wheth...
Definition: spxout.h:77
Everything should be within this namespace.
SPxOut & operator=(const SPxOut &)
assignment operator
Definition: spxout.cpp:52
void spx_free(T &p)
Release memory.
Definition: spxalloc.h:121