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
 
- Public Member Functions inherited from pappso::FilterInterface
virtual ~FilterInterface ()
 

Private Attributes

double m_value
 

Detailed Description

Definition at line 39 of file filterresample.h.

Constructor & Destructor Documentation

◆ FilterResampleKeepSmaller() [1/2]

pappso::FilterResampleKeepSmaller::FilterResampleKeepSmaller ( double  x_value)

Definition at line 36 of file filterresample.cpp.

37  : m_value(x_value)
38 {
39 }

◆ FilterResampleKeepSmaller() [2/2]

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

Definition at line 41 of file filterresample.cpp.

43  : FilterResampleKeepSmaller(other.m_value)
44 {
45 }

◆ ~FilterResampleKeepSmaller()

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

Definition at line 47 of file filterresample.h.

47 {};

Member Function Documentation

◆ filter()

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

Implements pappso::FilterInterface.

Definition at line 49 of file filterresample.cpp.

50 {
51  auto begin_it =
52  findFirstEqualOrGreaterX(spectrum.begin(), spectrum.end(), m_value);
53  spectrum.erase(begin_it, spectrum.end());
54  return spectrum;
55 }
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:69

References pappso::findFirstEqualOrGreaterX(), and m_value.

Member Data Documentation

◆ m_value

double pappso::FilterResampleKeepSmaller::m_value
private

Definition at line 42 of file filterresample.h.

Referenced by filter().


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