Skip to content

A Least-Squares interpolation Algorithm to Produce Polynomials of any Degree

License

Notifications You must be signed in to change notification settings

ggkogkou/least-squares

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Least Squares

License

Least Squares is a numerical method implementation for polynomial approximation. This library provides a convenient way to perform polynomial approximation using the least squares method.

Features

  • Read data from a file
  • Perform least squares approximation for a given degree polynomial
  • Print the polynomial coefficients

Installation

To use the Least Squares library, follow these steps:

  1. Clone the repository:

    git clone https://github.com/username/least-squares.git
  2. Build the project:

    cd least-squares
    make

Usage

To use the Least Squares library in your C++ project, follow these steps:

  1. Create an instance of the LeastSquares class, providing the name of the data file:

    #include "LeastSquares.hpp"
    
    int main() {
        least_squares::LeastSquares ls("data.txt");
    
        // Perform least squares approximation for a polynomial of degree 3
        ls.least_squares_implementation(3);
    
        // Print the polynomial coefficients
        ls.printf_polynomial();
    
        return 0;
    }
  2. Compile and run the program:

    g++ main.cpp -o app
    ./app

Contributing

Contributions are welcome! If you find any issues or have suggestions for improvement, please open an issue or submit a pull request.

License

This project is licensed under the GPL-3.0 License.

About

A Least-Squares interpolation Algorithm to Produce Polynomials of any Degree

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published