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/didxset.h"
17   	#include "soplex/spxalloc.h"
18   	
19   	namespace soplex
20   	{
21   	
22   	void DIdxSet::setMax(int newmax)
23   	{
24   	   assert(idx   != 0);
25   	   assert(max() >  0);
26   	
27   	   len = (newmax < size()) ? size() : newmax;
28   	   len = (len < 1) ? 1 : len;
29   	
30   	   assert(len > 0);
31   	
32   	   spx_realloc(idx, len);
33   	}
34   	
35   	DIdxSet::DIdxSet(const IdxSet& old)
36   	   : IdxSet()
37   	{
38   	   len = old.size();
39   	   len = (len < 1) ? 1 : len;
40   	   spx_alloc(idx, len);
41   	
42   	   IdxSet::operator= (old);
43   	}
44   	
45   	DIdxSet::DIdxSet(const DIdxSet& old)
46   	   : IdxSet()
47   	{
48   	   len = old.size();
49   	   len = (len < 1) ? 1 : len;
50   	   spx_alloc(idx, len);
51   	
52   	   IdxSet::operator= (old);
53   	}
54   	
55   	DIdxSet::DIdxSet(int n)
(1) Event write_constant_to_parm_in_call: Called function writes 0 to a dereference of parameter "this". [details]
56   	   : IdxSet()
57   	{
(2) Event cond_true: Condition "n < 1", taking true branch.
58   	   len = (n < 1) ? 1 : n;
59   	   spx_alloc(idx, len);
60   	}
61   	
62   	DIdxSet::~DIdxSet()
63   	{
64   	   if(idx)
65   	      spx_free(idx);
66   	}
67   	} // namespace soplex
68