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

Last change on this file since 2297 was 2297, checked in by sam, 10 years ago

base: implement UNUSED() macro and put it here and there.

  • Property svn:keywords set to Id
File size: 836 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://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) { return exp(x); }
25real g(real const &x) { return exp(x); }
26
27int main(int argc, char **argv)
28{
29    UNUSED(argc, 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.