source: trunk/test/math/remez.cpp @ 2467

Last change on this file since 2467 was 2467, checked in by sam, 9 years ago

lolremez: minor refactor.

  • Property svn:keywords set to Id
File size: 845 bytes
Line 
1//
2// Lol Engine - Sample math program: Chebyshev polynomials
3//
4// Copyright: (c) 2005-2013 Sam Hocevar <sam@hocevar.net>
5//   This program is free software; you can redistribute it and/or
6//   modify it under the terms of the Do What The Fuck You Want To
7//   Public License, Version 2, as published by Sam Hocevar. See
8//   http://www.wtfpl.net/ for more details.
9//
10
11#if defined HAVE_CONFIG_H
12#   include "config.h"
13#endif
14
15#include "core.h"
16
17#include <lol/math/real.h>
18#include <lol/math/remez.h>
19
20using lol::real;
21using lol::RemezSolver;
22
23/* See the tutorial at http://lol.zoy.org/wiki/doc/maths/remez */
24real f(real const &x)
25{
26    return exp(x);
27}
28
29real g(real const &x)
30{
31    return exp(x);
32}
33
34int main(int argc, char **argv)
35{
36    UNUSED(argc, argv);
37
38    RemezSolver<4, real> solver;
39    solver.Run(-1, 1, f, g, 40);
40    return 0;
41}
42
Note: See TracBrowser for help on using the repository browser.