70 this->defaults_.setValue(
"interpolation_step", 0.1,
"Sampling rate for the interpolation of the model function ");
71 this->defaults_.setValue(
"intensity_scaling", 1.0,
"Scaling factor used to adjust the model distribution to the intensities of the data");
78 interpolation_(source.interpolation_),
79 interpolation_step_(source.interpolation_step_),
80 scaling_(source.scaling_)
91 if (&source ==
this)
return *
this;
106 return interpolation_.value(pos[0]);
112 return interpolation_.value(coord);
118 return interpolation_;
138 interpolation_.setOffset(offset);
147 for (
Size i = 0; i < interpolation_.getData().size(); ++i)
149 peak.getPosition()[0] = interpolation_.index2key((
KeyType)i);
150 peak.setIntensity((PeakT::IntensityType)interpolation_.getData()[i]);
151 cont.push_back(peak);
174 interpolation_step_ = interpolation_step;
175 this->param_.setValue(
"interpolation_step", interpolation_step_);
181 this->param_.setValue(
"intensity_scaling", scaling_);
192 interpolation_step_ = this->param_.getValue(
"interpolation_step");
193 scaling_ = this->param_.getValue(
"intensity_scaling");
Abstract base class for all D-dimensional models.
Definition: BaseModel.h:51
BaseModel & operator=(const BaseModel &source)
assignment operator
Definition: BaseModel.h:77
std::vector< PeakType > SamplesType
Definition: BaseModel.h:57
void updateMembers_() override
This method is used to update extra member variables at the end of the setParameters() method.
Definition: BaseModel.h:152
Not implemented exception.
Definition: Exception.h:430
Abstract class for 1D-models that are approximated using linear interpolation.
Definition: InterpolationModel.h:56
DPosition< 1 > PositionType
Definition: InterpolationModel.h:60
double KeyType
Definition: InterpolationModel.h:62
double CoordinateType
Definition: InterpolationModel.h:61
void setScalingFactor(CoordinateType scaling)
Definition: InterpolationModel.h:178
InterpolationModel()
Default constructor.
Definition: InterpolationModel.h:66
virtual void setSamples()
set sample/supporting points of interpolation wrt params.
Definition: InterpolationModel.h:162
~InterpolationModel() override=default
destructor
InterpolationModel(const InterpolationModel &source)
copy constructor
Definition: InterpolationModel.h:76
CoordinateType scaling_
Definition: InterpolationModel.h:187
virtual CoordinateType getCenter() const
"center" of the model, particular definition (depends on the derived model)
Definition: InterpolationModel.h:156
IntensityType getIntensity(const PositionType &pos) const override
access model predicted intensity at position pos
Definition: InterpolationModel.h:104
void setInterpolationStep(CoordinateType interpolation_step)
Set the interpolation step for the linear interpolation of the model.
Definition: InterpolationModel.h:172
LinearInterpolation interpolation_
Definition: InterpolationModel.h:185
virtual void setOffset(CoordinateType offset)
set the offset of the model
Definition: InterpolationModel.h:136
CoordinateType interpolation_step_
Definition: InterpolationModel.h:186
const LinearInterpolation & getInterpolation() const
Returns the interpolation class.
Definition: InterpolationModel.h:116
void getSamples(SamplesType &cont) const override
get reasonable set of samples from the model (i.e. for printing)
Definition: InterpolationModel.h:142
IntensityType getIntensity(CoordinateType coord) const
access model predicted intensity at position pos
Definition: InterpolationModel.h:110
void updateMembers_() override
This method is used to update extra member variables at the end of the setParameters() method.
Definition: InterpolationModel.h:189
double IntensityType
Definition: InterpolationModel.h:59
Math::LinearInterpolation< KeyType > LinearInterpolation
Definition: InterpolationModel.h:63
InterpolationModel & operator=(const InterpolationModel &source)
assignment operator
Definition: InterpolationModel.h:89
CoordinateType getScalingFactor() const
get the scaling for the model
Definition: InterpolationModel.h:126
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:48