Loading...
Searching...
No Matches
cubicsplinemodel.h
Go to the documentation of this file.
// Copyright 2026 Filippo Rusconi
// Inspired by code in OpenMS, by Lars Nilse
#pragma once
/////////////////////// stdlib includes
/////////////////////// Qt includes
#include <QList>
#include <QMap>
/////////////////////// pappsomspp includes
/////////////////////// Local includes
#include "pappsomspp/export-import-config.h"
namespace pappso
{
class PMSPP_LIB_DECL CubicSplineModel
{
public:
CubicSplineModel();
explicit CubicSplineModel(const QList<double> &x_values,
const QList<double> &y_values);
explicit CubicSplineModel(const QMap<double, double> &x_y_values_map);
CubicSplineModel(const CubicSplineModel &other);
CubicSplineModel *clone(const CubicSplineModel &other);
virtual ~CubicSplineModel();
void setup(const QList<double> &x_values, const QList<double> &y_values);
CubicSplineModel &operator=(const CubicSplineModel &other);
const QList<double> &getKnots() const;
double evalSplineAt(double x_value) const;
double derivative(const double x_value) const;
double derivatives(const double x_value, unsigned order) const;
protected:
QString m_name = "prova";
QList<double> m_constCoeffs;
QList<double> m_linearCoeffs;
QList<double> m_quadraticCoeffs;
QList<double> m_cubicCoeffs;
QList<double> m_knots;
};
void spline_bisection(const CubicSplineModel &spline_model,
double const mz_at_left,
double const mz_at_right,
double &center_peak_mz,
double &center_peak_intensity,
double const threshold = 1e-6);
} // namespace pappso
pappso::CubicSplineModel
Definition cubicsplinemodel.h:24
pappso::CubicSplineModel::m_quadraticCoeffs
QList< double > m_quadraticCoeffs
Definition cubicsplinemodel.h:51
pappso::CubicSplineModel::setup
void setup(const QList< double > &x_values, const QList< double > &y_values)
Definition cubicsplinemodel.cpp:89
pappso::CubicSplineModel::CubicSplineModel
CubicSplineModel()
Definition cubicsplinemodel.cpp:24
pappso::CubicSplineModel::m_name
QString m_name
Definition cubicsplinemodel.h:48
pappso::CubicSplineModel::operator=
CubicSplineModel & operator=(const CubicSplineModel &other)
Definition cubicsplinemodel.cpp:147
pappso::CubicSplineModel::m_linearCoeffs
QList< double > m_linearCoeffs
Definition cubicsplinemodel.h:50
pappso::CubicSplineModel::derivatives
double derivatives(const double x_value, unsigned order) const
Definition cubicsplinemodel.cpp:203
pappso::CubicSplineModel::derivative
double derivative(const double x_value) const
Definition cubicsplinemodel.cpp:197
pappso::CubicSplineModel::getKnots
const QList< double > & getKnots() const
Definition cubicsplinemodel.cpp:163
pappso::CubicSplineModel::m_cubicCoeffs
QList< double > m_cubicCoeffs
Definition cubicsplinemodel.h:52
pappso::CubicSplineModel::m_constCoeffs
QList< double > m_constCoeffs
Definition cubicsplinemodel.h:49
pappso::CubicSplineModel::m_knots
QList< double > m_knots
Definition cubicsplinemodel.h:53
pappso::CubicSplineModel::clone
CubicSplineModel * clone(const CubicSplineModel &other)
Definition cubicsplinemodel.cpp:68
pappso::CubicSplineModel::evalSplineAt
double evalSplineAt(double x_value) const
Definition cubicsplinemodel.cpp:169
export-import-config.h
PMSPP_LIB_DECL
#define PMSPP_LIB_DECL
Definition export-import-config.h:14
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition aa.cpp:39
pappso::spline_bisection
void spline_bisection(const CubicSplineModel &spline_model, double const mz_at_left, double const mz_at_right, double &center_peak_mz, double &center_peak_intensity, double const threshold)
Definition cubicsplinemodel.cpp:241