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");
77 interpolation_(source.interpolation_),
78 interpolation_step_(source.interpolation_step_),
79 scaling_(source.scaling_)
90 if (&source ==
this)
return *
this;
105 return interpolation_.value(pos[0]);
111 return interpolation_.value(coord);
117 return interpolation_;
137 interpolation_.setOffset(offset);
145 for (
Size i = 0; i < interpolation_.getData().size(); ++i)
147 #pragma clang diagnostic push
148 #pragma clang diagnostic ignored "-Wconversion"
149 peak.setIntensity(interpolation_.getData()[i]);
150 #pragma clang diagnostic pop
151 peak.getPosition()[0] = interpolation_.index2key(i);
152 cont.push_back(peak);
175 interpolation_step_ = interpolation_step;
176 this->param_.setValue(
"interpolation_step", interpolation_step_);
182 this->param_.setValue(
"intensity_scaling", scaling_);
193 interpolation_step_ = this->param_.getValue(
"interpolation_step");
194 scaling_ = this->param_.getValue(
"intensity_scaling");
Abstract base class for all D-dimensional models.
Definition: BaseModel.h:52
std::vector< PeakType > SamplesType
Definition: BaseModel.h:60
virtual BaseModel & operator=(const BaseModel &source)
assignment operator
Definition: BaseModel.h:83
void updateMembers_() override
This method is used to update extra member variables at the end of the setParameters() method.
Definition: BaseModel.h:157
Not implemented exception.
Definition: Exception.h:430
Abstract class for 1D-models that are approximated using linear interpolation.
Definition: InterpolationModel.h:56
Math::LinearInterpolation< double > LinearInterpolation
Definition: InterpolationModel.h:62
DPosition< 1 > PositionType
Definition: InterpolationModel.h:60
double CoordinateType
Definition: InterpolationModel.h:61
void setScalingFactor(CoordinateType scaling)
Definition: InterpolationModel.h:179
InterpolationModel()
Default constructor.
Definition: InterpolationModel.h:65
virtual void setSamples()
set sample/supporting points of interpolation wrt params.
Definition: InterpolationModel.h:163
~InterpolationModel() override=default
destructor
InterpolationModel(const InterpolationModel &source)
copy constructor
Definition: InterpolationModel.h:75
CoordinateType scaling_
Definition: InterpolationModel.h:188
virtual CoordinateType getCenter() const
"center" of the model, particular definition (depends on the derived model)
Definition: InterpolationModel.h:157
IntensityType getIntensity(const PositionType &pos) const override
access model predicted intensity at position pos
Definition: InterpolationModel.h:103
void setInterpolationStep(CoordinateType interpolation_step)
Set the interpolation step for the linear interpolation of the model.
Definition: InterpolationModel.h:173
LinearInterpolation interpolation_
Definition: InterpolationModel.h:186
virtual void setOffset(CoordinateType offset)
set the offset of the model
Definition: InterpolationModel.h:135
CoordinateType interpolation_step_
Definition: InterpolationModel.h:187
const LinearInterpolation & getInterpolation() const
Returns the interpolation class.
Definition: InterpolationModel.h:115
void getSamples(SamplesType &cont) const override
get reasonable set of samples from the model (i.e. for printing)
Definition: InterpolationModel.h:141
IntensityType getIntensity(CoordinateType coord) const
access model predicted intensity at position pos
Definition: InterpolationModel.h:109
void updateMembers_() override
This method is used to update extra member variables at the end of the setParameters() method.
Definition: InterpolationModel.h:190
double IntensityType
Definition: InterpolationModel.h:59
InterpolationModel & operator=(const InterpolationModel &source)
assignment operator
Definition: InterpolationModel.h:88
CoordinateType getScalingFactor() const
get the scaling for the model
Definition: InterpolationModel.h:125
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47