44 this->defaults_.setValue(
"interpolation_step", 0.1,
"Sampling rate for the interpolation of the model function ");
45 this->defaults_.setValue(
"intensity_scaling", 1.0,
"Scaling factor used to adjust the model distribution to the intensities of the data");
52 interpolation_(source.interpolation_),
53 interpolation_step_(source.interpolation_step_),
54 scaling_(source.scaling_)
65 if (&source ==
this)
return *
this;
80 return interpolation_.value(pos[0]);
86 return interpolation_.value(coord);
92 return interpolation_;
112 interpolation_.setOffset(offset);
121 for (
Size i = 0; i < interpolation_.getData().size(); ++i)
123 peak.getPosition()[0] = interpolation_.index2key((
KeyType)i);
124 peak.setIntensity((PeakT::IntensityType)interpolation_.getData()[i]);
125 cont.push_back(peak);
148 interpolation_step_ = interpolation_step;
149 this->param_.setValue(
"interpolation_step", interpolation_step_);
155 this->param_.setValue(
"intensity_scaling", scaling_);
166 interpolation_step_ = this->param_.getValue(
"interpolation_step");
167 scaling_ = this->param_.getValue(
"intensity_scaling");
Abstract base class for 1-dimensional models.
Definition: BaseModel.h:22
BaseModel & operator=(const BaseModel &source)
assignment operator
Definition: BaseModel.h:48
double CoordinateType
Definition: BaseModel.h:25
std::vector< PeakType > SamplesType
Definition: BaseModel.h:28
void updateMembers_() override
This method is used to update extra member variables at the end of the setParameters() method.
Definition: BaseModel.h:120
double IntensityType
Definition: BaseModel.h:24
DPeak< 1 >::Type PeakType
Definition: BaseModel.h:27
Not implemented exception.
Definition: Exception.h:399
Abstract class for 1D-models that are approximated using linear interpolation.
Definition: InterpolationModel.h:30
DPosition< 1 > PositionType
Definition: InterpolationModel.h:34
double KeyType
Definition: InterpolationModel.h:36
double CoordinateType
Definition: InterpolationModel.h:35
void setScalingFactor(CoordinateType scaling)
Definition: InterpolationModel.h:152
InterpolationModel()
Default constructor.
Definition: InterpolationModel.h:40
virtual void setSamples()
set sample/supporting points of interpolation wrt params.
Definition: InterpolationModel.h:136
~InterpolationModel() override=default
destructor
InterpolationModel(const InterpolationModel &source)
copy constructor
Definition: InterpolationModel.h:50
CoordinateType scaling_
Definition: InterpolationModel.h:161
virtual CoordinateType getCenter() const
"center" of the model, particular definition (depends on the derived model)
Definition: InterpolationModel.h:130
IntensityType getIntensity(const PositionType &pos) const override
access model predicted intensity at position pos
Definition: InterpolationModel.h:78
void setInterpolationStep(CoordinateType interpolation_step)
Set the interpolation step for the linear interpolation of the model.
Definition: InterpolationModel.h:146
LinearInterpolation interpolation_
Definition: InterpolationModel.h:159
virtual void setOffset(CoordinateType offset)
set the offset of the model
Definition: InterpolationModel.h:110
CoordinateType interpolation_step_
Definition: InterpolationModel.h:160
const LinearInterpolation & getInterpolation() const
Returns the interpolation class.
Definition: InterpolationModel.h:90
void getSamples(SamplesType &cont) const override
get reasonable set of samples from the model (i.e. for printing)
Definition: InterpolationModel.h:116
IntensityType getIntensity(CoordinateType coord) const
access model predicted intensity at position pos
Definition: InterpolationModel.h:84
void updateMembers_() override
This method is used to update extra member variables at the end of the setParameters() method.
Definition: InterpolationModel.h:163
double IntensityType
Definition: InterpolationModel.h:33
Math::LinearInterpolation< KeyType > LinearInterpolation
Definition: InterpolationModel.h:37
InterpolationModel & operator=(const InterpolationModel &source)
assignment operator
Definition: InterpolationModel.h:63
CoordinateType getScalingFactor() const
get the scaling for the model
Definition: InterpolationModel.h:100
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:97
Main OpenMS namespace.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19