libpappsomspp
Library for mass spectrometry
Loading...
Searching...
No Matches
pappso::FilterResampleKeepSmaller Class Reference

#include <filterresample.h>

Inheritance diagram for pappso::FilterResampleKeepSmaller:
pappso::FilterInterface

Public Member Functions

 FilterResampleKeepSmaller (double x_value)
 FilterResampleKeepSmaller (const FilterResampleKeepSmaller &other)
virtual ~FilterResampleKeepSmaller ()
Tracefilter (Trace &trace) const override
Public Member Functions inherited from pappso::FilterInterface
virtual ~FilterInterface ()

Private Attributes

double m_value

Detailed Description

Definition at line 41 of file filterresample.h.

Constructor & Destructor Documentation

◆ FilterResampleKeepSmaller() [1/2]

pappso::FilterResampleKeepSmaller::FilterResampleKeepSmaller ( double x_value)

Definition at line 36 of file filterresample.cpp.

36 : m_value(x_value)
37{
38}

References m_value.

Referenced by FilterResampleKeepSmaller().

◆ FilterResampleKeepSmaller() [2/2]

pappso::FilterResampleKeepSmaller::FilterResampleKeepSmaller ( const FilterResampleKeepSmaller & other)

Definition at line 40 of file filterresample.cpp.

41 : FilterResampleKeepSmaller(other.m_value)
42{
43}

References FilterResampleKeepSmaller(), and m_value.

◆ ~FilterResampleKeepSmaller()

virtual pappso::FilterResampleKeepSmaller::~FilterResampleKeepSmaller ( )
inlinevirtual

Definition at line 49 of file filterresample.h.

49{};

Member Function Documentation

◆ filter()

Trace & pappso::FilterResampleKeepSmaller::filter ( Trace & trace) const
overridevirtual

Implements pappso::FilterInterface.

Definition at line 47 of file filterresample.cpp.

48{
49 auto begin_it = findFirstEqualOrGreaterX(spectrum.begin(), spectrum.end(), m_value);
50 spectrum.erase(begin_it, spectrum.end());
51 return spectrum;
52}
std::vector< DataPoint >::iterator findFirstEqualOrGreaterX(std::vector< DataPoint >::iterator begin, std::vector< DataPoint >::iterator end, const double &value)
find the first element in which X is equal or greater than the value searched important : it implies ...
Definition trace.cpp:65

References pappso::findFirstEqualOrGreaterX(), and m_value.

Member Data Documentation

◆ m_value

double pappso::FilterResampleKeepSmaller::m_value
private

Definition at line 44 of file filterresample.h.

Referenced by FilterResampleKeepSmaller(), FilterResampleKeepSmaller(), and filter().


The documentation for this class was generated from the following files: