mirror of
https://github.com/VictorEijkhout/TheArtOfHPC_vol3_cppf08programming.git
synced 2026-01-24 22:44:48 +09:00
30 lines
705 B
C++
30 lines
705 B
C++
/****************************************************************
|
|
****
|
|
**** This file belongs with the course
|
|
**** Introduction to Scientific Programming in C++/Fortran2003
|
|
**** copyright 2017-2023 Victor Eijkhout eijkhout@tacc.utexas.edu
|
|
****
|
|
**** readpoly.cxx : enter polynomials coefficients
|
|
****
|
|
****************************************************************/
|
|
|
|
#include <iostream>
|
|
using std::cin;
|
|
using std::cout;
|
|
|
|
#include "poly.hpp"
|
|
|
|
int main() {
|
|
|
|
polynomial poly;
|
|
|
|
double f100 = poly.evaluate_at(100);
|
|
double f0 = poly.evaluate_at(0.);
|
|
double fm100 = poly.evaluate_at(-100);
|
|
|
|
cout << "Values at -100: " << fm100 << ", 0: " << f0 << ", +100: " << f100 << '\n';
|
|
|
|
return 0;
|
|
}
|
|
|