| 1 | /* |
| 2 | * coot-utils/coot-least-squares.hh |
| 3 | * |
| 4 | * Copyright 2015 by Medical Research Council |
| 5 | * Author: Paul Emsley |
| 6 | * |
| 7 | * This file is part of Coot |
| 8 | * |
| 9 | * This program is free software; you can redistribute it and/or modify |
| 10 | * it under the terms of the GNU Lesser General Public License as published |
| 11 | * by the Free Software Foundation; either version 3 of the License, or (at |
| 12 | * your option) any later version. |
| 13 | * |
| 14 | * This program is distributed in the hope that it will be useful, but |
| 15 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 17 | * Lesser General Public License for more details. |
| 18 | * |
| 19 | * You should have received a copies of the GNU General Public License and |
| 20 | * the GNU Lesser General Public License along with this program; if not, |
| 21 | * write to the Free Software Foundation, Inc., 51 Franklin Street, |
| 22 | * Fifth Floor, Boston, MA, 02110-1301, USA. |
| 23 | * See http://www.gnu.org/licenses/ |
| 24 | * |
| 25 | */ |
| 26 | |
| 27 | #include <vector> |
| 28 | |
| 29 | namespace cootcxx . . $ coot/ { |
| 30 | |
| 31 | class least_squares_fitcxx . . $ coot/least_squares_fit# { |
| 32 | double a_cxx . . $ coot/least_squares_fit#a_.; |
| 33 | double b_cxx . . $ coot/least_squares_fit#b_.; |
| 34 | public: |
| 35 | least_squares_fitcxx . . $ coot/least_squares_fit#least_squares_fit(49f6e7a06ebc5aa8).() {} |
| 36 | explicit least_squares_fitcxx . . $ coot/least_squares_fit#least_squares_fit(2ee61ec016502146).(const stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::paircxx . . $ std/pair#<double, double> > &data); |
| 37 | double mcxx . . $ coot/least_squares_fit#m(21b6c25e127938e2).() const { return b_cxx . . $ coot/least_squares_fit#b_.; } |
| 38 | double ccxx . . $ coot/least_squares_fit#c(21b6c25e127938e2).() const { return a_cxx . . $ coot/least_squares_fit#a_.; } |
| 39 | double atcxx . . $ coot/least_squares_fit#at(1a1efae989ef6c0).(const double &x) const { return mcxx . . $ coot/least_squares_fit#m(21b6c25e127938e2).() * x + ccxx . . $ coot/least_squares_fit#c(21b6c25e127938e2).(); } |
| 40 | }; |
| 41 | |
| 42 | } |