PSD.cc File Reference
#include "PSD.h"

Functions

bool operator< (const DistributionElements &l, const DistributionElements &r)
 
bool operator< (const DistributionElements &l, const Mdouble prob)
 
Mdouble operator== (DistributionElements l, const Mdouble r)
 
std::istream & operator>> (std::istream &is, DistributionElements &p)
 
std::ostream & operator<< (std::ostream &os, DistributionElements &p)
 

Function Documentation

◆ operator<() [1/2]

bool operator< ( const DistributionElements l,
const DistributionElements r 
)

Required to use std::lower_bound for finding when the probability is higher than a certain value.

Returns
TRUE if probability from a vector of type DistributionElements is higher than a certain value from a vector of type DistributionElements and FALSE in the opposite case.
1265 {
1266  return l.probability < r.probability;
1267 }
Mdouble probability
Definition: DistributionElements.h:16
r
Definition: UniformPSDSelfTest.py:20

◆ operator<() [2/2]

bool operator< ( const DistributionElements l,
const Mdouble  prob 
)

required to use std::lower_bound for finding when the probability provided as a double is higher than a certain value.

Returns
TRUE if probability as double is higher than a certain value from a DistributionElements vector and FALSE in the opposite case.
1276 {
1277  return l.probability < prob;
1278 }

◆ operator<<()

std::ostream& operator<< ( std::ostream &  os,
DistributionElements p 
)

Writes to output stream. This function is used for restart files.

Returns
a reference to an output stream.
1305 {
1306  os << p.internalVariable << ' ' << p.probability << ' ';
1307  return os;
1308 }
float * p
Definition: Tutorial_Map_using.cpp:9

◆ operator==()

Mdouble operator== ( DistributionElements  l,
const Mdouble  r 
)

Required to use std::distance to find the index of the PSD size class in which a particle has to be inserted

Returns
A double which determines the size class (radius) a particle will be inserted to.
1285 {
1286  return l.internalVariable == r;
1287 }
Mdouble internalVariable
Definition: DistributionElements.h:15

◆ operator>>()

std::istream& operator>> ( std::istream &  is,
DistributionElements p 
)

reads from input stream. This function is used for restart files.

Returns
a reference to an input stream.
1294 {
1295  is >> p.internalVariable;
1296  is >> p.probability;
1297  return is;
1298 }