Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
alta
alta
Commits
8ff740a5
Commit
8ff740a5
authored
Aug 20, 2013
by
Laurent Belcour
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some documentation
parent
86826df4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
81 additions
and
72 deletions
+81
-72
sources/core/plugins_manager.cpp
sources/core/plugins_manager.cpp
+38
-0
sources/core/plugins_manager.h
sources/core/plugins_manager.h
+43
-72
No files found.
sources/core/plugins_manager.cpp
View file @
8ff740a5
...
...
@@ -332,6 +332,44 @@ fitter* plugins_manager::get_fitter(const std::string& n)
}
#endif
}
void
plugins_manager
::
check_compatibility
(
data
*&
d
,
function
*&
f
,
const
arguments
&
args
)
{
if
(
d
->
parametrization
()
==
params
::
UNKNOWN_INPUT
)
{
std
::
cout
<<
"<<WARNING>> unknown parametrization for data"
<<
std
::
endl
;
}
if
(
f
->
parametrization
()
==
params
::
UNKNOWN_INPUT
)
{
std
::
cout
<<
"<<DEBUG>> function will take the parametrization of the data"
<<
std
::
endl
;
f
->
setParametrization
(
d
->
parametrization
());
}
else
if
(
d
->
parametrization
()
!=
f
->
parametrization
())
{
std
::
cout
<<
"<<INFO>> has to change the parametrization of the input data"
<<
std
::
endl
;
data_params
*
dd
=
new
data_params
(
d
,
f
->
parametrization
());
d
=
dd
;
}
else
{
std
::
cout
<<
"<<DEBUG>> no change was made to the parametrization"
<<
std
::
endl
;
}
if
(
f
->
dimY
()
!=
d
->
dimY
())
{
std
::
cout
<<
"<<WARNING>> the data and the function have different Y dimensions"
<<
std
::
endl
;
}
/*
// Check is the data has to be clusterized
if(args.is_defined("cluster-dim"))
{
clustering* cluster = new clustering(d, args);
d = cluster;
}
*/
}
// \todo implement the Darwin (MACOS) version.
#ifdef WIN32
...
...
sources/core/plugins_manager.h
View file @
8ff740a5
...
...
@@ -15,9 +15,6 @@
* talk to each others through coordinates transforms.
*
* \details
*
* \todo Should we put this class as a singleton ? I am tempted by it so that
* each plugin can access some informations.
*/
class
plugins_manager
{
...
...
@@ -26,78 +23,52 @@ class plugins_manager
//! \brief Create the object, parse the argument and load all the plugins
plugins_manager
(
const
arguments
&
args
)
;
//! \brief Get instances of the function, the data and the fitter. Select
//! the first in the map,
#ifdef USING_STATIC
static
#endif
function
*
get_function
()
;
#ifdef USING_STATIC
static
#endif
data
*
get_data
()
;
#ifdef USING_STATIC
static
#endif
fitter
*
get_fitter
()
;
#ifdef USING_STATIC
static
#endif
function
*
get_function
()
;
#ifdef USING_STATIC
static
#endif
data
*
get_data
()
;
#ifdef USING_STATIC
static
#endif
fitter
*
get_fitter
()
;
//! \brief get an instance of the function that is defined in the plugin with
//! filename n. Return null if no one exist.
#ifdef USING_STATIC
static
#endif
function
*
get_function
(
const
std
::
string
&
n
)
;
//! \brief get an instance of the data that is defined in the plugin with
//! filename n. Return null if no one exist.
#ifdef USING_STATIC
static
#endif
data
*
get_data
(
const
std
::
string
&
n
)
;
//! \brief Get instances of the function, the data and the fitter, select one
//! based on the name. Return null if no one exist.
#ifdef USING_STATIC
static
#endif
function
*
get_function
(
const
std
::
string
&
n
)
;
#ifdef USING_STATIC
static
#endif
data
*
get_data
(
const
std
::
string
&
n
)
;
#ifdef USING_STATIC
static
#endif
fitter
*
get_fitter
(
const
std
::
string
&
n
)
;
//! \brief check if a data object and a function object are compatibles.
//! this has to be done before fitting to ensure that the
//! parametrizations spaces are the same.
//! \todo specify an output parametrization for the function ?
static
void
check_compatibility
(
data
*&
d
,
function
*&
f
,
const
arguments
&
args
)
{
if
(
d
->
parametrization
()
==
params
::
UNKNOWN_INPUT
)
{
std
::
cout
<<
"<<WARNING>> unknown parametrization for data"
<<
std
::
endl
;
}
if
(
f
->
parametrization
()
==
params
::
UNKNOWN_INPUT
)
{
std
::
cout
<<
"<<DEBUG>> function will take the parametrization of the data"
<<
std
::
endl
;
f
->
setParametrization
(
d
->
parametrization
());
}
else
if
(
d
->
parametrization
()
!=
f
->
parametrization
())
{
std
::
cout
<<
"<<INFO>> has to change the parametrization of the input data"
<<
std
::
endl
;
data_params
*
dd
=
new
data_params
(
d
,
f
->
parametrization
());
d
=
dd
;
}
else
{
std
::
cout
<<
"<<DEBUG>> no change was made to the parametrization"
<<
std
::
endl
;
}
if
(
f
->
dimY
()
!=
d
->
dimY
())
{
std
::
cout
<<
"<<WARNING>> the data and the function have different Y dimensions"
<<
std
::
endl
;
}
/*
// Check is the data has to be clusterized
if(args.is_defined("cluster-dim"))
{
clustering* cluster = new clustering(d, args);
d = cluster;
}
*/
}
//! \brief get an instance of the fitter that is defined in the plugin with
//! filename n. Return null if no one exist.
#ifdef USING_STATIC
static
#endif
fitter
*
get_fitter
(
const
std
::
string
&
n
)
;
//! \brief check if a data object and a function object are compatibles.
//! this has to be done before fitting to ensure that the
//! parametrizations spaces are the same.
//! \todo specify an output parametrization for the function ?
static
void
check_compatibility
(
data
*&
d
,
function
*&
f
,
const
arguments
&
args
)
;
//! \brief Provide a measure of how much memory there is on the system.
//! \details It permits to know is one can allocate more memory for a fitting
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment