https://mooseframework.inl.gov
Loading...
Searching...
No Matches
PolynomialFit.h
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
10#pragma once
11
12#include "LeastSquaresFitBase.h"
13
20{
21public:
22 /* Constructor, Takes two vectors of points for which to apply the fit. One should be of the
23 * independent variable while the other should be of the dependent variable. These values should
24 * correspond to one and other in the same position. The third parameter is the requested
25 * polynomial order and the forth parameter tells the class whether or not it should truncate
26 * the order if there are not enough points for which to apply the polynomial fit.
27 */
28 PolynomialFit(const std::vector<Real> & x,
29 const std::vector<Real> & y,
30 unsigned int order,
31 bool truncate_order = false);
32
33 virtual Real sample(Real x) override;
34
35protected:
36 virtual void fillMatrix() override;
38 unsigned int _order;
42 static int _file_number;
43};
Base class for linear least squares fit method.
Least squares polynomial fit.
bool _truncate_order
Flag to implement a truncated polynomial.
static int _file_number
File number.
unsigned int _order
Order of the polynomial.
virtual Real sample(Real x) override
This function will take an independent variable input and will return the dependent variable based on...
virtual void fillMatrix() override
Helper function that creates the matrix necessary for the least squares algorithm.