2 Copyright 2005, 2006 Computer Vision Lab,
3 Ecole Polytechnique Federale de Lausanne (EPFL), Switzerland.
4 Modified by Damian Stewart <damian@frey.co.nz> 2009-2010;
5 modifications Copyright 2009, 2010 Damian Stewart <damian@frey.co.nz>.
7 Distributed under the terms of the GNU General Public License v3.
9 This file is part of The Artvertiser.
11 The Artvertiser is free software: you can redistribute it and/or modify
12 it under the terms of the GNU General Public License as published by
13 the Free Software Foundation, either version 3 of the License, or
14 (at your option) any later version.
16 The Artvertiser is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License for more details.
21 You should have received a copy of the GNU Lesser General Public License
22 along with The Artvertiser. If not, see <http://www.gnu.org/licenses/>.
25 #ifndef ROBUST_ESTIMATORS_H
26 #define ROBUST_ESTIMATORS_H
33 double rho_tukey_without_sqrt(const double x2
, const double c
);
34 double rho_tukey_without_sqrt_derivative(const double x2
, const double c
);
36 double rho_huber_without_sqrt(const double x2
, const double c
);
37 double rho_huber_without_sqrt_derivative(const double x2
, const double c
);
40 inline double rho_tukey_without_sqrt(const double x2
, const double c
)
48 double t
= 1. - x2
/ c2
;
50 return c2
/ 6 * (1. - t
* t
* t
);
54 inline double rho_tukey_without_sqrt_derivative(const double x2
, const double c
)
62 double t
= 1. - x2
/ c2
;
68 inline double rho_huber_without_sqrt(const double x2
, const double c
)
75 return 2 * c
* sqrt(x2
) - c2
;
78 inline double rho_huber_without_sqrt_derivative(const double x2
, const double c
)
89 #endif // ROBUST_ESTIMATORS_H