Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
alta
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
5
Issues
5
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
alta
alta
Commits
3ca4a521
Commit
3ca4a521
authored
Jul 17, 2013
by
Laurent Belcour
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Currently working on the input parametrization
parent
f4b15b4c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
7 deletions
+18
-7
sources/core/function.h
sources/core/function.h
+16
-5
sources/core/params.cpp
sources/core/params.cpp
+2
-2
No files found.
sources/core/function.h
View file @
3ca4a521
...
...
@@ -128,11 +128,21 @@ class function
//! defined one.
virtual
void
setParametrization
(
params
::
input
new_param
)
{
if
(
_in_param
==
new_param
||
_in_param
==
params
::
UNKNOWN_INPUT
)
//! \todo Here is something strange happening. The equality between
//! those enums is not correct for UNKNOWN_INPUT
if
(
_in_param
==
new_param
)
{
return
;
}
else
if
(
_in_param
==
params
::
UNKNOWN_INPUT
)
{
_in_param
=
new_param
;
}
else
throw
(
"A parametrization is already defined"
);
{
std
::
cout
<<
"<<ERROR>> a parametrization is already defined: "
<<
params
::
get_name
(
_in_param
)
<<
std
::
endl
;
std
::
cout
<<
"<<ERROR>> trying to change to: "
<<
params
::
get_name
(
new_param
)
<<
std
::
endl
;
}
}
//! \brief can set the output parametrization of a non-parametrized
...
...
@@ -143,8 +153,9 @@ class function
if
(
_out_param
==
new_param
||
_out_param
==
params
::
UNKNOWN_OUTPUT
)
_out_param
=
new_param
;
else
throw
(
"A parametrization is already defined"
);
{
std
::
cout
<<
"<<ERROR>> A parametrization is already defined: "
<<
params
::
get_name
(
_in_param
)
<<
std
::
endl
;
}
}
protected:
// function
...
...
sources/core/params.cpp
View file @
3ca4a521
...
...
@@ -211,7 +211,7 @@ params::input params::parse_input(const std::string& txt)
}
}
std
::
cout
<<
"<<
ERROR>> the input parametrization in unknown
"
<<
std
::
endl
;
std
::
cout
<<
"<<
INFO>> the input parametrization is UNKNOWN_INPUT
"
<<
std
::
endl
;
return
params
::
UNKNOWN_INPUT
;
}
...
...
@@ -223,7 +223,7 @@ std::string params::get_name(const params::input param)
return
it
->
second
.
name
;
}
return
std
::
string
();
return
std
::
string
(
"UNKNOWN_INPUT"
);
}
int
params
::
dimension
(
params
::
input
t
)
...
...
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