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

Last change on this file since 1309 was 1127, checked in by sam, 8 years ago

math: significant performance improvements in the Remez solver.

  • Property svn:keywords set to Id
File size: 878 bytes
Line 
1//
2// Lol Engine - Sample math program: Chebyshev polynomials
3//
4// Copyright: (c) 2005-2011 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://sam.zoy.org/projects/COPYING.WTFPL for more details.
9//
10
11#if defined HAVE_CONFIG_H
12#   include "config.h"
13#endif
14
15#if USE_SDL && defined __APPLE__
16#   include <SDL_main.h>
17#endif
18
19#include "lol/math/real.h"
20#include "lol/math/remez.h"
21
22using lol::real;
23using lol::RemezSolver;
24
25/* See the tutorial at http://lol.zoy.org/wiki/doc/maths/remez */
26real f(real const &x) { return exp(x); }
27real g(real const &x) { return exp(x); }
28
29int main(int argc, char **argv)
30{
31    RemezSolver<4, real> solver;
32    solver.Run(-1, 1, f, g, 40);
33    return 0;
34}
35
Note: See TracBrowser for help on using the repository browser.