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
b69e6120
Commit
b69e6120
authored
Apr 18, 2013
by
Laurent Belcour
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding implementation of the phong non-linear function
parent
bda19515
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
0 deletions
+36
-0
sources/plugins/nonlinear_function_phong/function.cpp
sources/plugins/nonlinear_function_phong/function.cpp
+22
-0
sources/plugins/nonlinear_function_phong/function.h
sources/plugins/nonlinear_function_phong/function.h
+14
-0
No files found.
sources/plugins/nonlinear_function_phong/function.cpp
View file @
b69e6120
...
...
@@ -31,32 +31,54 @@ vec phong_function::value(const vec& x) const
//! Load function specific files
void
phong_function
::
load
(
const
std
::
string
&
filename
)
{
std
::
cerr
<<
"Not implemented "
<<
__FILE__
<<
":"
<<
__LINE__
<<
std
::
endl
;
throw
;
}
//! Save the current function to a specific file type
void
phong_function
::
save
(
const
std
::
string
&
filename
,
const
arguments
&
args
)
const
{
std
::
cerr
<<
"Not implemented "
<<
__FILE__
<<
":"
<<
__LINE__
<<
std
::
endl
;
throw
;
}
//! Number of parameters to this non-linear function
int
phong_function
::
nbParameters
()
const
{
return
3
*
dimY
();
}
//! Get the vector of parameters for the function
vec
phong_function
::
parameters
()
const
{
vec
res
(
3
*
dimY
());
for
(
int
i
=
0
;
i
<
dimY
();
++
i
)
{
res
[
i
]
=
_kd
[
i
];
res
[
i
+
dimY
()]
=
_ks
[
i
];
res
[
i
+
2
*
dimY
()]
=
_N
[
i
];
}
return
res
;
}
//! Update the vector of parameters for the function
void
phong_function
::
setParameters
(
const
vec
&
p
)
{
for
(
int
i
=
0
;
i
<
dimY
();
++
i
)
{
_kd
[
i
]
=
p
[
i
];
_ks
[
i
]
=
p
[
i
+
dimY
()];
_N
[
i
]
=
p
[
i
+
2
*
dimY
()];
}
}
//! Obtain the derivatives of the function with respect to the
//! parameters.
vec
phong_function
::
parametersJacobian
(
const
vec
&
x
)
const
{
std
::
cerr
<<
"Not implemented "
<<
__FILE__
<<
":"
<<
__LINE__
<<
std
::
endl
;
throw
;
}
Q_EXPORT_PLUGIN2
(
phong_function
,
phong_function
)
sources/plugins/nonlinear_function_phong/function.h
View file @
b69e6120
...
...
@@ -64,7 +64,21 @@ class phong_function : public nonlinear_function, public QObject
{
return
params
::
COS_TH
;
}
virtual
void
setParametrization
(
params
::
input
new_param
)
{
std
::
cerr
<<
"Cannot change the ouput parametrization "
<<
__FILE__
<<
":"
<<
__LINE__
<<
std
::
endl
;
throw
;
}
void
setDimY
(
int
nY
)
{
_nY
=
nY
;
// Update the length of the vectors
_kd
.
resize
(
_nY
)
;
_ks
.
resize
(
_nY
)
;
_N
.
resize
(
_nY
)
;
}
private:
// data
...
...
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