ProteoWizard
MagnitudeLorentzian.hpp
Go to the documentation of this file.
1//
2// $Id$
3//
4//
5// Original author: Darren Kessner <darren@proteowizard.org>
6//
7// Copyright 2006 Louis Warschaw Prostate Cancer Center
8// Cedars Sinai Medical Center, Los Angeles, California 90048
9//
10// Licensed under the Apache License, Version 2.0 (the "License");
11// you may not use this file except in compliance with the License.
12// You may obtain a copy of the License at
13//
14// http://www.apache.org/licenses/LICENSE-2.0
15//
16// Unless required by applicable law or agreed to in writing, software
17// distributed under the License is distributed on an "AS IS" BASIS,
18// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19// See the License for the specific language governing permissions and
20// limitations under the License.
21//
22
23
24#ifndef _MAGNITUDELORENTZIAN_HPP_
25#define _MAGNITUDELORENTZIAN_HPP_
26
27
29#include <vector>
30
31
32namespace pwiz {
33namespace frequency {
34
35
37{
38 public:
39
40 // m(x) == 1/sqrt(ax^2 + bx + c)
41 // == alpha/sqrt(1/tau^2 + [2pi(x-center)]^2)
42
43 MagnitudeLorentzian(double a, double b, double c);
44 MagnitudeLorentzian(std::vector<double> a);
45 MagnitudeLorentzian(const std::vector< std::pair<double,double> >& samples);
46
47 double leastSquaresError() const;
48
49 std::vector<double>& coefficients();
50 const std::vector<double>& coefficients() const;
51
52 double operator()(double x) const;
53 double center() const;
54 double tau() const;
55 double alpha() const;
56
57 private:
58 std::vector<double> a_;
60};
61
62
63} // namespace frequency
64} // namespace pwiz
65
66
67#endif // _MAGNITUDELORENTZIAN_HPP_
#define PWIZ_API_DECL
Definition Export.hpp:32
KernelTraitsBase< Kernel >::space_type::abscissa_type x
std::vector< double > & coefficients()
MagnitudeLorentzian(std::vector< double > a)
double operator()(double x) const
MagnitudeLorentzian(double a, double b, double c)
const std::vector< double > & coefficients() const
MagnitudeLorentzian(const std::vector< std::pair< double, double > > &samples)