TooN Algorithm Library - tag
0.2
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
er258
projects
tag
src
polynomial.h
Go to the documentation of this file.
1
#ifndef POLYNOMIAL_H
2
#define POLYNOMIAL_H
3
#include <vector>
4
#include <TooN/TooN.h>
5
6
std::vector<double>
find_roots
(
const
TooN::Vector<11>& v);
7
8
9
template
<
int
N>
double
polyval
(
const
TooN::Vector<N>& v,
double
x)
10
{
11
//Polynomials are stored with the coefficient of zero in the first
12
double
val=0;
13
for
(
int
i=v.size()-1; i > 0; i--)
14
{
15
val += v[i];
16
val *= x;
17
}
18
19
val += v[0];
20
return
val;
21
}
22
23
#endif
Generated on Tue Aug 13 2013 14:11:40 for TooN Algorithm Library - tag by
1.8.3.1