COPASI API  4.16.103
Functions
CZeroSet.cpp File Reference
#include "copasi.h"
#include "CZeroSet.h"
#include "CStepMatrixColumn.h"
Include dependency graph for CZeroSet.cpp:

Go to the source code of this file.

Functions

std::ostream & operator<< (std::ostream &os, const CZeroSet &set)
 

Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const CZeroSet set 
)

Definition at line 114 of file CZeroSet.cpp.

References CVectorCore< CType >::array(), CZeroSet::mBitSet, CZeroSet::mIgnoredBits, CZeroSet::mNumberSetBits, and CVectorCore< CType >::size().

115 {
116  const size_t * pIt = set.mBitSet.array();
117  const size_t * pEnd = pIt + set.mBitSet.size();
118 
119  size_t CurrentBit = 0;
120  size_t LastBit = set.mBitSet.size() * CHAR_BIT * sizeof(size_t) - set.mIgnoredBits;
121 
122  os << ' ';
123 
124  for (; pIt != pEnd; ++pIt)
125  {
126  for (size_t i = 0;
127  i < CHAR_BIT * sizeof(size_t) && CurrentBit < LastBit;
128  ++i, ++CurrentBit)
129  {
130  if ((*pIt >> i) & 1)
131  {
132  os << 1;
133  }
134  else
135  {
136  os << 0;
137  }
138  }
139 
140  os << ' ';
141  }
142 
143  os << " " << set.mNumberSetBits << std::endl;
144 
145  return os;
146 }
size_t mIgnoredBits
Definition: CZeroSet.h:174
size_t mNumberSetBits
Definition: CZeroSet.h:176
size_t size() const
Definition: CVector.h:100
CType * array()
Definition: CVector.h:139
CVector< size_t > mBitSet
Definition: CZeroSet.h:172