yat/regression/Multivariate.cc

Code
Comments
Other
Rev Date Author Line
3614 06 Feb 17 peter 1 // $Id$
3614 06 Feb 17 peter 2
3614 06 Feb 17 peter 3 /*
4207 26 Aug 22 peter 4   Copyright (C) 2017, 2022 Peter Johansson
3614 06 Feb 17 peter 5
3614 06 Feb 17 peter 6   This file is part of the yat library, http://dev.thep.lu.se/yat
3614 06 Feb 17 peter 7
3614 06 Feb 17 peter 8   The yat library is free software; you can redistribute it and/or
3614 06 Feb 17 peter 9   modify it under the terms of the GNU General Public License as
3614 06 Feb 17 peter 10   published by the Free Software Foundation; either version 3 of the
3614 06 Feb 17 peter 11   License, or (at your option) any later version.
3614 06 Feb 17 peter 12
3614 06 Feb 17 peter 13   The yat library is distributed in the hope that it will be useful,
3614 06 Feb 17 peter 14   but WITHOUT ANY WARRANTY; without even the implied warranty of
3614 06 Feb 17 peter 15   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
3614 06 Feb 17 peter 16   General Public License for more details.
3614 06 Feb 17 peter 17
3614 06 Feb 17 peter 18   You should have received a copy of the GNU General Public License
3614 06 Feb 17 peter 19   along with yat. If not, see <http://www.gnu.org/licenses/>.
3614 06 Feb 17 peter 20 */
3614 06 Feb 17 peter 21
3614 06 Feb 17 peter 22 #include <config.h>
3614 06 Feb 17 peter 23
3614 06 Feb 17 peter 24 #include "Multivariate.h"
3614 06 Feb 17 peter 25
4130 20 Jan 22 peter 26 #include "yat/utility/Matrix.h"
4130 20 Jan 22 peter 27 #include "yat/utility/MatrixBase.h"
4130 20 Jan 22 peter 28 #include "yat/utility/VectorBase.h"
4130 20 Jan 22 peter 29
3614 06 Feb 17 peter 30 namespace theplu {
3614 06 Feb 17 peter 31 namespace yat {
3614 06 Feb 17 peter 32 namespace regression {
3614 06 Feb 17 peter 33
3614 06 Feb 17 peter 34   Multivariate::~Multivariate(void)
3614 06 Feb 17 peter 35   {
3614 06 Feb 17 peter 36   }
3614 06 Feb 17 peter 37
4130 20 Jan 22 peter 38
4130 20 Jan 22 peter 39   void Multivariate::fit2(const utility::MatrixBase& X,
4130 20 Jan 22 peter 40                           const utility::VectorBase& y)
4130 20 Jan 22 peter 41   {
4130 20 Jan 22 peter 42     const utility::Matrix* M =
4130 20 Jan 22 peter 43       dynamic_cast<const utility::Matrix*>(&X);
4130 20 Jan 22 peter 44     if (M)
4130 20 Jan 22 peter 45       fit(*M, y);
4130 20 Jan 22 peter 46     else {
4130 20 Jan 22 peter 47       utility::Matrix X2(X);
4130 20 Jan 22 peter 48       fit2(X2, y);
4130 20 Jan 22 peter 49     }
4130 20 Jan 22 peter 50   }
4130 20 Jan 22 peter 51
3614 06 Feb 17 peter 52 }}} // of namespaces regression, yat, and theplu