COPASI API  4.16.103
Functions
CNormalLcm.cpp File Reference
#include <vector>
#include <set>
#include <cmath>
#include <sstream>
#include "copasi.h"
#include "CNormalSum.h"
#include "CNormalProduct.h"
#include "CNormalItemPower.h"
#include "CNormalLcm.h"
Include dependency graph for CNormalLcm.cpp:

Go to the source code of this file.

Functions

std::ostream & operator<< (std::ostream &os, const CNormalLcm &d)
 

Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const CNormalLcm d 
)

Definition at line 287 of file CNormalLcm.cpp.

References CNormalLcm::mItemPowers, and CNormalLcm::mSums.

288 {
289  if (d.mItemPowers.size() + d.mSums.size() != 0)
290  {
291  bool firstFactor = true;
292  std::set <CNormalItemPower*, compareItemPowers >::const_iterator it;
293  std::set <CNormalItemPower*, compareItemPowers >::const_iterator itEnd = d.mItemPowers.end();
294 
295  for (it = d.mItemPowers.begin(); it != itEnd; ++it)
296  {
297  if (firstFactor == false)
298  {
299  os << " * ";
300  }
301 
302  os << **it;
303  firstFactor = false;
304  }
305 
306  std::vector<CNormalSum*>::const_iterator it2;
307  std::vector<CNormalSum*>::const_iterator it2End = d.mSums.end();
308 
309  for (it2 = d.mSums.begin(); it2 != it2End; ++it2)
310  {
311  if (firstFactor == false)
312  {
313  os << " * ";
314  }
315 
316  os << "(" << **it2 << ")";
317  firstFactor = false;
318  }
319  }
320  else
321  {
322  os << "1.0";
323  }
324 
325  return os;
326 }
std::set< CNormalItemPower *, compareItemPowers > mItemPowers
Definition: CNormalLcm.h:39
std::vector< CNormalSum * > mSums
Definition: CNormalLcm.h:40