69 this->defaults_.setValue(
"interpolation_step", 0.1,
"Sampling rate for the interpolation of the model function ");
70 this->defaults_.setValue(
"intensity_scaling", 1.0,
"Scaling factor used to adjust the model distribution to the intensities of the data");
76 interpolation_(source.interpolation_),
77 interpolation_step_(source.interpolation_step_),
78 scaling_(source.scaling_)
90 if (&source ==
this)
return *
this;
103 return interpolation_.value(pos[0]);
109 return interpolation_.value(coord);
115 return interpolation_;
135 interpolation_.setOffset(offset);
143 for (
Size i = 0; i < interpolation_.getData().size(); ++i)
145 #pragma clang diagnostic push 146 #pragma clang diagnostic ignored "-Wconversion" 147 peak.setIntensity(interpolation_.getData()[i]);
148 #pragma clang diagnostic pop 149 peak.getPosition()[0] = interpolation_.index2key(i);
150 cont.push_back(peak);
173 interpolation_step_ = interpolation_step;
174 this->param_.setValue(
"interpolation_step", interpolation_step_);
180 this->param_.setValue(
"intensity_scaling", scaling_);
191 interpolation_step_ = this->param_.getValue(
"interpolation_step");
192 scaling_ = this->param_.getValue(
"intensity_scaling");
const LinearInterpolation & getInterpolation() const
Returns the interpolation class.
Definition: InterpolationModel.h:113
Math::LinearInterpolation< double > LinearInterpolation
Definition: InterpolationModel.h:62
void updateMembers_() override
This method is used to update extra member variables at the end of the setParameters() method...
Definition: InterpolationModel.h:188
void getSamples(SamplesType &cont) const override
get reasonable set of samples from the model (i.e. for printing)
Definition: InterpolationModel.h:139
~InterpolationModel() override
destructor
Definition: InterpolationModel.h:83
double CoordinateType
Definition: InterpolationModel.h:61
InterpolationModel(const InterpolationModel &source)
copy constructor
Definition: InterpolationModel.h:74
DPosition< 1 > PositionType
Definition: InterpolationModel.h:60
CoordinateType getScalingFactor() const
get the scaling for the model
Definition: InterpolationModel.h:123
virtual CoordinateType getCenter() const
"center" of the model, particular definition (depends on the derived model)
Definition: InterpolationModel.h:155
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
LinearInterpolation interpolation_
Definition: InterpolationModel.h:184
double IntensityType
Definition: InterpolationModel.h:59
Abstract class for 1D-models that are approximated using linear interpolation.
Definition: InterpolationModel.h:54
CoordinateType scaling_
Definition: InterpolationModel.h:186
void setInterpolationStep(CoordinateType interpolation_step)
Set the interpolation step for the linear interpolation of the model.
Definition: InterpolationModel.h:171
InterpolationModel()
Default constructor.
Definition: InterpolationModel.h:65
virtual void setSamples()
set sample/supporting points of interpolation wrt params.
Definition: InterpolationModel.h:161
void setScalingFactor(CoordinateType scaling)
Definition: InterpolationModel.h:177
IntensityType getIntensity(const PositionType &pos) const override
access model predicted intensity at position pos
Definition: InterpolationModel.h:101
virtual InterpolationModel & operator=(const InterpolationModel &source)
assignment operator
Definition: InterpolationModel.h:88
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
virtual void setOffset(CoordinateType offset)
set the offset of the model
Definition: InterpolationModel.h:133
CoordinateType interpolation_step_
Definition: InterpolationModel.h:185
void updateMembers_() override
This method is used to update extra member variables at the end of the setParameters() method...
Definition: BaseModel.h:157
Abstract base class for all D-dimensional models.
Definition: BaseModel.h:50
std::vector< PeakType > SamplesType
Definition: BaseModel.h:60
virtual BaseModel & operator=(const BaseModel &source)
assignment operator
Definition: BaseModel.h:83
IntensityType getIntensity(CoordinateType coord) const
access model predicted intensity at position pos
Definition: InterpolationModel.h:107
Not implemented exception.
Definition: Exception.h:436