Jpp
18.0.1-rc.2
the software that should make you happy
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
examples
JMath
JPolynome.cc
Go to the documentation of this file.
1
#include <string>
2
#include <iostream>
3
#include <iomanip>
4
5
#include "
JMath/JPolynome.hh
"
6
7
#include "
Jeep/JParser.hh
"
8
#include "
Jeep/JMessage.hh
"
9
10
11
/**
12
* \file
13
*
14
* Example program to test polynome.
15
* \author mdejong
16
*/
17
int
main
(
int
argc,
char
**argv)
18
{
19
using namespace
std;
20
using namespace
JPP;
21
22
JPolynome
f1
;
23
double
precision;
24
int
debug
;
25
26
try
{
27
28
JParser<>
zap(
"Example program to test polynome."
);
29
30
zap[
'P'
] =
make_field
(
f1
);
31
zap[
'e'
] =
make_field
(precision) = numeric_limits<double>::min();
32
zap[
'd'
] =
make_field
(
debug
) = 3;
33
34
zap(argc, argv);
35
}
36
catch
(
const
exception &error) {
37
FATAL
(error.what() << endl);
38
}
39
40
ASSERT
(!
f1
.empty());
41
42
DEBUG
(
"polynome: "
<<
f1
<< endl);
43
DEBUG
(
"derivative: "
<<
f1
.
getDerivative
() << endl);
44
DEBUG
(
"integral: "
<<
f1
.
getIntegral
() << endl);
45
DEBUG
(
"polynome: "
<<
f1
.
getDerivative
().getIntegral() << endl);
46
DEBUG
(
"polynome: "
<<
f1
.
getIntegral
().getDerivative() << endl);
47
48
ASSERT
(
f1
.
equals
(
f1
.
getIntegral
().getDerivative(), precision));
49
50
return
0;
51
}
JPARSER::JParser
Utility class to parse command line options.
Definition:
JParser.hh:1514
main
int main(int argc, char *argv[])
Definition:
Main.cc:15
GAUSS_LEGENDRE::f1
const JPolynome f1(1.0, 2.0, 3.0)
Function.
JPolynome.hh
ASSERT
#define ASSERT(A,...)
Assert macro.
Definition:
JMessage.hh:90
JMATH::JPolynome::getDerivative
double getDerivative(const double x) const
Derivative value.
Definition:
JPolynome.hh:252
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition:
JParser.hh:1989
JMessage.hh
General purpose messaging.
JMATH::JPolynome::getIntegral
double getIntegral(const double x) const
Integral value.
Definition:
JPolynome.hh:276
FATAL
#define FATAL(A)
Definition:
JMessage.hh:67
JParser.hh
Utility class to parse command line options.
debug
int debug
debug level
Definition:
archive-put-wiki-detectors.sh:92
DEBUG
#define DEBUG(A)
Message macros.
Definition:
JMessage.hh:62
JMATH::JPolynome_t::equals
bool equals(const JPolynome_t &P, const double eps=std::numeric_limits< double >::min()) const
Equality.
Definition:
JPolynome.hh:47
Generated by
1.8.5