libpappsomspp
Library for mass spectrometry
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
 

Private Attributes

double m_value
 

Detailed Description

Definition at line 56 of file filterresample.h.

Constructor & Destructor Documentation

◆ FilterResampleKeepSmaller() [1/2]

FilterResampleKeepSmaller::FilterResampleKeepSmaller ( double  x_value)

Definition at line 34 of file filterresample.cpp.

35  : m_value(x_value)
36 {
37 }

◆ FilterResampleKeepSmaller() [2/2]

FilterResampleKeepSmaller::FilterResampleKeepSmaller ( const FilterResampleKeepSmaller other)

Definition at line 39 of file filterresample.cpp.

42 {
43 }

◆ ~FilterResampleKeepSmaller()

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

Definition at line 82 of file filterresample.h.

82 : public FilterInterface

Member Function Documentation

◆ filter()

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

Implements pappso::FilterInterface.

Definition at line 47 of file filterresample.cpp.

48 {
49  auto begin_it =
50  findFirstEqualOrGreaterX(spectrum.begin(), spectrum.end(), m_value);
51  spectrum.erase(begin_it, spectrum.end());
52  return spectrum;
53 }

References pappso::findFirstEqualOrGreaterX(), and m_value.

Member Data Documentation

◆ m_value

double pappso::FilterResampleKeepSmaller::m_value
private

Definition at line 77 of file filterresample.h.

Referenced by filter().


The documentation for this class was generated from the following files:
pappso::FilterResampleKeepSmaller::FilterResampleKeepSmaller
FilterResampleKeepSmaller(double x_value)
Definition: filterresample.cpp:34
pappso::FilterResampleKeepSmaller::m_value
double m_value
Definition: filterresample.h:77
pappso::findFirstEqualOrGreaterX
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:31