Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F102702232
main.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, Feb 23, 08:37
Size
1 KB
Mime Type
text/x-c
Expires
Tue, Feb 25, 08:37 (1 d, 18 h)
Engine
blob
Format
Raw Data
Handle
24404206
Attached To
R1695 PCSC - Numerical Integration - Ollitrault Rouaze
main.cpp
View Options
#include "Config.hpp"
#include "testSuite.hpp"
int
main
(
int
argc
,
char
*
argv
[])
{
// // Force test
// string inputString = "Test";
//
// if (inputString == "Test") {
// numIntTests();
// return 0;
// }
// // Recover config file name
string
configFileName
=
""
;
if
(
argv
[
1
]
==
nullptr
)
{
configFileName
=
"defaultConfig.init"
;
}
else
{
string
inputString
=
argv
[
1
];
std
::
cout
<<
inputString
<<
std
::
endl
;
if
(
inputString
==
"Test"
)
{
numIntTests
();
return
0
;
}
else
{
configFileName
=
inputString
;
}
}
// Load the configuration
Config
config
=
Config
(
configFileName
);
// Recover integrator and integrate depending on the case dimensions
double
Ih
;
if
(
config
.
isOneD
())
{
AbstractOneDIntegrator
*
integrator
=
config
.
getIntegrator1D
();
Ih
=
integrator
->
Integral
();
}
else
{
AbstractTwoDIntegrator
*
integrator
=
config
.
getIntegrator2D
();
Ih
=
integrator
->
Integral
();
}
//
std
::
cout
<<
"Integral value : "
<<
Ih
<<
std
::
endl
;
return
0
;
}
Event Timeline
Log In to Comment