A simple container of DataPoint instances.
More...
#include <trace.h>
A simple container of DataPoint instances.
Definition at line 125 of file trace.h.
◆ Trace() [1/7]
◆ Trace() [2/7]
Definition at line 359 of file trace.cpp.
362 reserve(dataPoints.size());
364 for(
auto &dataPoint : dataPoints)
366 push_back(DataPoint(dataPoint));
369 std::sort(begin(), end(), [](
const DataPoint &
a,
const DataPoint &
b) {
References pappso::a, and pappso::b.
◆ Trace() [3/7]
| pappso::Trace::Trace |
( |
const std::vector< DataPoint > & |
dataPoints | ) |
|
Definition at line 375 of file trace.cpp.
376 : std::vector<DataPoint>(dataPoints)
◆ Trace() [4/7]
| pappso::Trace::Trace |
( |
const std::vector< DataPoint > && |
dataPoints | ) |
|
Definition at line 381 of file trace.cpp.
382 : std::vector<DataPoint>(std::move(dataPoints))
◆ Trace() [5/7]
| pappso::Trace::Trace |
( |
const MapTrace & |
map_trace | ) |
|
|
explicit |
Definition at line 388 of file trace.cpp.
390 for(
auto &&item : map_trace)
391 push_back(DataPoint(item.first, item.second));
◆ Trace() [6/7]
| pappso::Trace::Trace |
( |
const Trace & |
other | ) |
|
Definition at line 394 of file trace.cpp.
394 : std::vector<DataPoint>(other)
◆ Trace() [7/7]
| pappso::Trace::Trace |
( |
const Trace && |
other | ) |
|
Definition at line 399 of file trace.cpp.
399 : std::vector<DataPoint>(std::move(other))
◆ ~Trace()
| pappso::Trace::~Trace |
( |
| ) |
|
|
virtual |
◆ containsX()
Definition at line 607 of file trace.cpp.
609 auto iterator = std::find_if(
610 begin(), end(), [value, precision_p](
const DataPoint &data_point) {
615 if(data_point.x >= (value - delta) && data_point.x <= (value + delta))
622 return (data_point.x == value);
626 if(iterator != end())
References pappso::DataPoint::x.
◆ dataPointCstIteratorxWithX()
| std::vector< DataPoint >::const_iterator pappso::Trace::dataPointCstIteratorxWithX |
( |
pappso_double |
value | ) |
const |
|
protected |
◆ dataPointIndexWithX()
| std::size_t pappso::Trace::dataPointIndexWithX |
( |
pappso_double |
value | ) |
const |
|
protected |
Return a reference to the DataPoint instance that has its y member equal to value.
Definition at line 594 of file trace.cpp.
596 std::vector<DataPoint>::const_iterator iterator =
599 if(iterator != end())
600 return std::distance(begin(), iterator);
602 return std::numeric_limits<std::size_t>::max();
References dataPointCstIteratorxWithX().
◆ dataPointIteratorxWithX()
Definition at line 570 of file trace.cpp.
573 std::find_if(begin(), end(), [value](
const DataPoint &dataPoint) {
574 return (dataPoint.x == value);
References pappso::DataPoint::x.
◆ filter()
◆ initialize() [1/3]
Definition at line 441 of file trace.cpp.
449 for(
auto &&item : map)
451 push_back(DataPoint(item.first, item.second));
◆ initialize() [2/3]
Definition at line 413 of file trace.cpp.
417 if(xVector.size() != yVector.size())
419 "Fatal error at %s@%d -- %s(). "
420 "xVector and yVector must have the same size."
429 resize(xVector.size());
431 for(std::size_t iter = 0; iter < xVector.size(); ++iter)
433 push_back(DataPoint(xVector.at(iter), yVector.at(iter)));
◆ initialize() [3/3]
| size_t pappso::Trace::initialize |
( |
const Trace & |
other | ) |
|
◆ makeTraceCstSPtr()
Definition at line 492 of file trace.cpp.
494 return std::make_shared<const Trace>(*
this);
◆ makeTraceSPtr()
| TraceSPtr pappso::Trace::makeTraceSPtr |
( |
| ) |
const |
Definition at line 485 of file trace.cpp.
487 return std::make_shared<Trace>(*
this);
◆ maxY() [1/2]
◆ maxY() [2/2]
| pappso_double pappso::Trace::maxY |
( |
double |
mzStart, |
|
|
double |
mzEnd |
|
) |
| const |
◆ maxYDataPoint()
| const DataPoint & pappso::Trace::maxYDataPoint |
( |
| ) |
const |
◆ minY()
◆ minYDataPoint()
| const DataPoint & pappso::Trace::minYDataPoint |
( |
| ) |
const |
Definition at line 640 of file trace.cpp.
642 auto dataPoint = std::min_element(
643 begin(), end(), [](
const DataPoint &
a,
const DataPoint &
b) {
647 if(dataPoint == end())
649 throw ExceptionOutOfRange(
650 QObject::tr(
"unable to get min peak intensity on spectrum size %1")
References pappso::a, and pappso::b.
Referenced by minY(), and pappso::MassSpectrum::tic().
◆ operator=() [1/2]
| Trace & pappso::Trace::operator= |
( |
const Trace & |
x | ) |
|
|
virtual |
Definition at line 468 of file trace.cpp.
470 assign(other.begin(), other.end());
◆ operator=() [2/2]
Definition at line 477 of file trace.cpp.
479 vector<DataPoint>::operator=(std::move(other));
◆ sortX()
| void pappso::Trace::sortX |
( |
| ) |
|
◆ sumY() [1/2]
◆ sumY() [2/2]
| pappso_double pappso::Trace::sumY |
( |
double |
mzStart, |
|
|
double |
mzEnd |
|
) |
| const |
◆ toMap()
Definition at line 523 of file trace.cpp.
525 std::map<pappso_double, pappso_double> map;
527 std::pair<std::map<pappso_double, pappso_double>::iterator,
bool> ret;
529 for(
auto &&dataPoint : *
this)
532 std::pair<pappso_double, pappso_double>(dataPoint.x, dataPoint.y));
534 if(ret.second ==
false)
536 qDebug() << __FILE__ <<
"@" << __LINE__ << __FUNCTION__ <<
"()"
537 <<
"It is odd that the Trace contains multiple same keys.";
540 ret.first->second += dataPoint.y;
◆ toString()
| QString pappso::Trace::toString |
( |
| ) |
const |
Definition at line 790 of file trace.cpp.
795 for(
auto &&dataPoint : *
this)
797 text.append(QString(
"%1 %2\n")
798 .arg(dataPoint.x, 0,
'f', 10)
799 .arg(dataPoint.y, 0,
'f', 10));
◆ unique()
| void pappso::Trace::unique |
( |
| ) |
|
◆ xToVector()
◆ xValues()
◆ yToVector()
◆ yValues()
◆ MassSpectrumCombinerInterface
| friend class MassSpectrumCombinerInterface |
|
friend |
◆ TraceCombiner
◆ TraceMinusCombiner
◆ TracePlusCombiner
The documentation for this class was generated from the following files: