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
abddc9f7
Commit
abddc9f7
authored
Jul 17, 2013
by
Laurent Belcour
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanning the code and adding test of DCA outputs
parent
61e69c12
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
93 deletions
+17
-93
sources/core/data.h
sources/core/data.h
+0
-27
sources/core/function.h
sources/core/function.h
+0
-60
sources/scripts/unitary.sh
sources/scripts/unitary.sh
+17
-6
No files found.
sources/core/data.h
View file @
abddc9f7
...
...
@@ -19,9 +19,6 @@
class
data
:
public
parametrized
{
public:
// methods
/*
data() : _in_param(params::UNKNOWN_INPUT), _out_param(params::UNKNOWN_OUTPUT) { }
*/
// Load data from a file
virtual
void
load
(
const
std
::
string
&
filename
)
=
0
;
...
...
@@ -72,35 +69,11 @@ class data : public parametrized
// Get the size of the input X domain and output Y domain
virtual
int
dimX
()
const
{
return
_nX
;
}
virtual
int
dimY
()
const
{
return
_nY
;
}
/*
//! \brief provide the parametrization of the function.
//! \note some function type can modify the parametrization to adapt
//! to the data.
virtual params::input parametrization() const
{
return _in_param;
}
//! \brief can set the input parametrization of a non-parametrized
//! function. Throw an exception if it tries to erase a previously
//! defined one.
virtual void setParametrization(params::input new_param)
{
if(_in_param != params::UNKNOWN_INPUT)
throw("A parametrization is already defined");
_in_param = new_param;
}
*/
protected:
// data
// Dimensions of the data
int
_nX
,
_nY
;
/*
// Input and output parametrization
params::input _in_param ;
params::output _out_param ;
*/
}
;
Q_DECLARE_INTERFACE
(
data
,
"Fitter.Data"
)
...
...
sources/core/function.h
View file @
abddc9f7
...
...
@@ -26,10 +26,6 @@ class function : public parametrized
{
public:
// methods
// Constructor
/* function() : _in_param(params::UNKNOWN_INPUT),
_out_param(params::UNKNOWN_OUTPUT) { }
*/
// Overload the function operator
virtual
vec
operator
()(
const
vec
&
x
)
const
=
0
;
virtual
vec
value
(
const
vec
&
x
)
const
=
0
;
...
...
@@ -106,58 +102,6 @@ class function : public parametrized
}
virtual
vec
getMin
()
const
{
return
_min
;
}
virtual
vec
getMax
()
const
{
return
_max
;
}
/*
//! \brief provide the parametrization of the function.
//! \note some function type can modify the parametrization to adapt
//! to the data.
virtual params::input parametrization() const
{
return _in_param;
}
//! \brief provide the output parametrization of the function.
//! \note some function type can modify the parametrization to adapt
//! to the data.
virtual params::output out_parametrization() const
{
return _out_param;
}
//! \brief can set the input parametrization of a non-parametrized
//! function. Throw an exception if it tries to erase a previously
//! defined one.
virtual void setParametrization(params::input new_param)
{
//! \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
{
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
//! function. Throw an exception if it tries to erase a previously
//! defined one.
virtual void setParametrization(params::output new_param)
{
if(_out_param == new_param || _out_param == params::UNKNOWN_OUTPUT)
_out_param = new_param;
else
{
std::cout << "<<ERROR>> A parametrization is already defined" << std::endl;
}
}
*/
protected:
// function
...
...
@@ -227,10 +171,6 @@ class function : public parametrized
// Dimension of the function & domain of definition.
int
_nX
,
_nY
;
vec
_min
,
_max
;
/*
// Input and output parametrization
params::input _in_param ;
params::output _out_param ;*/
};
/*! \brief Non-linear function interface
...
...
sources/scripts/unitary.sh
View file @
abddc9f7
...
...
@@ -12,8 +12,8 @@ if [ $use_relative -eq 1 ]; then
fi
test_generated
=
1
test_kirby
=
0
test_alta
=
0
test_kirby
=
1
test_alta
=
1
test_merl
=
0
#fitter="matlab"
...
...
@@ -23,7 +23,10 @@ test_merl=0
fitter
=
"eigen"
#fitter_args="--min-np 1 --np 100 --min-nq 1 --nq 100"
fitter_args
=
"--np 3 --nq 3"
fitter_args
=
"--np 10 --nq 10"
#Use the DCA optimizer afterwards
use_dca
=
1
mkdir
tests
...
...
@@ -41,12 +44,20 @@ do
echo
"Test number
${
i
}
passed"
./build/brdf2gnuplot
--input
tests/output
${
function_append
}
_
${
i
}
.rational
$function
--data
tests/input_
${
i
}
.gnuplot
--output
tests/output_
${
i
}
.gnuplot
>
/dev/null
#DCA Optimization
./build/data2brdf
--input
tests/input_
${
i
}
.gnuplot
--output
tests/output
${
function_append
}
_
${
i
}
_dca.rational
$function
--fitter
/build/librational_fitter_dca.so
--bootstrap
tests/output
${
function_append
}
_
${
i
}
.rational
>
tests/output
${
function_append
}
_
${
i
}
_dca.out
if
[
$use_dca
-eq
1
]
;
then
./build/data2brdf
--input
tests/input_
${
i
}
.gnuplot
--output
tests/output
${
function_append
}
_
${
i
}
_dca.rational
$function
--fitter
/build/librational_fitter_dca.so
--bootstrap
tests/output
${
function_append
}
_
${
i
}
.rational
>
tests/output
${
function_append
}
_
${
i
}
_dca.out
if
[
$?
-eq
0
]
;
then
./build/brdf2gnuplot
--input
tests/output
${
function_append
}
_
${
i
}
_dca.rational
$function
--data
tests/input_
${
i
}
.gnuplot
--output
tests/output_
${
i
}
_dca.gnuplot
>
/dev/null
if
[
$?
-eq
0
]
;
then
echo
"Optimized using DCA"
./build/brdf2gnuplot
--input
tests/output
${
function_append
}
_
${
i
}
_dca.rational
$function
--data
tests/input_
${
i
}
.gnuplot
--output
tests/output_
${
i
}
_dca.gnuplot
>
/dev/null
fi
fi
else
echo
"Test number
$i
failed"
fi
...
...
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