MEPP2 Project
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
Variables
Typedefs
a
c
e
f
h
i
m
p
r
s
t
v
Enumerations
Enumerator
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
y
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
k
m
n
o
p
q
r
s
t
v
w
Enumerations
Enumerator
Related Functions
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
Functions
a
b
c
d
e
f
g
h
i
l
m
n
p
r
s
t
u
w
x
Variables
c
d
e
f
i
l
m
n
o
p
r
s
t
v
Typedefs
a
c
e
f
g
h
i
k
l
m
n
o
p
r
t
v
w
Enumerations
Enumerator
Macros
_
a
b
c
h
i
m
n
o
p
s
t
u
v
w
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
FEVV
Filters
Generic
Manifold
JustNoticeableDistortion
models
genericparametricmodel.h
Go to the documentation of this file.
1
// Copyright (c) 2012-2019 University of Lyon and CNRS (France).
2
// All rights reserved.
3
//
4
// This file is part of MEPP2; you can redistribute it and/or modify
5
// it under the terms of the GNU Lesser General Public License as
6
// published by the Free Software Foundation; either version 3 of
7
// the License, or (at your option) any later version.
8
//
9
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
10
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
11
#pragma once
12
13
#include <vector>
14
#include <Eigen/Core>
15
16
template
<
typename
TParam,
typename
TIn =
double
,
typename
TOut =
double
>
17
class
GenericParametricModel
18
{
19
20
//-----------------------------------------------------------------------------------
21
22
public
:
23
typedef
TParam
ParameterType
;
24
typedef
TIn
InputType
;
25
typedef
TOut
OutputType
;
26
27
//-----------------------------------------------------------------------------------
28
29
public
:
30
GenericParametricModel
()
31
{
32
// default_params();
33
}
34
35
GenericParametricModel
(
const
ParameterType
&
param
) :
m_param
(
param
) {}
36
37
virtual
~GenericParametricModel
() {}
38
39
//-----------------------------------------------------------------------------------
40
41
public
:
42
void
setParameters
(
const
ParameterType
&
param
) {
m_param
=
param
; }
43
44
const
ParameterType
&
param
()
const
{
return
m_param
; }
// read only
45
ParameterType
&
param
() {
return
m_param
; }
46
47
//-----------------------------------------------------------------------------------
48
49
public
:
50
virtual
void
compute
(
const
InputType
&in,
OutputType
&out)
const
= 0;
51
52
//-----------------------------------------------------------------------------------
53
54
public
:
55
OutputType
compute
(
const
InputType
&in)
const
56
{
57
OutputType
out;
58
compute
(in, out);
59
60
return
out;
61
}
62
63
void
compute
(
const
std::vector< InputType > &in,
64
std::vector< OutputType > &out)
const
65
{
66
out.clear();
67
68
for
(
const
InputType
i : in)
69
out.push_back(
compute
(i));
70
}
71
72
OutputType
operator()
(
const
InputType
&in)
const
{
return
compute
(in); }
73
74
void
operator()
(
const
InputType
&in,
OutputType
&out)
const
75
{
76
out =
compute
(in);
77
}
78
79
//-----------------------------------------------------------------------------------
80
81
protected
:
83
virtual
void
default_params
() = 0;
84
85
//-----------------------------------------------------------------------------------
86
87
protected
:
88
ParameterType
m_param
;
89
};
GenericParametricModel::GenericParametricModel
GenericParametricModel(const ParameterType ¶m)
Definition:
genericparametricmodel.h:35
GenericParametricModel::compute
OutputType compute(const InputType &in) const
Definition:
genericparametricmodel.h:55
GenericParametricModel::InputType
TIn InputType
Definition:
genericparametricmodel.h:24
GenericParametricModel::ParameterType
TParam ParameterType
Definition:
genericparametricmodel.h:23
GenericParametricModel::default_params
virtual void default_params()=0
sets default values to m_params
GenericParametricModel::param
const ParameterType & param() const
Definition:
genericparametricmodel.h:44
GenericParametricModel::GenericParametricModel
GenericParametricModel()
Definition:
genericparametricmodel.h:30
GenericParametricModel::compute
virtual void compute(const InputType &in, OutputType &out) const =0
GenericParametricModel::operator()
void operator()(const InputType &in, OutputType &out) const
Definition:
genericparametricmodel.h:74
GenericParametricModel::~GenericParametricModel
virtual ~GenericParametricModel()
Definition:
genericparametricmodel.h:37
GenericParametricModel::param
ParameterType & param()
Definition:
genericparametricmodel.h:45
GenericParametricModel::m_param
ParameterType m_param
Definition:
genericparametricmodel.h:88
GenericParametricModel::operator()
OutputType operator()(const InputType &in) const
Definition:
genericparametricmodel.h:72
GenericParametricModel::compute
void compute(const std::vector< InputType > &in, std::vector< OutputType > &out) const
Definition:
genericparametricmodel.h:63
GenericParametricModel
Definition:
genericparametricmodel.h:18
GenericParametricModel::OutputType
TOut OutputType
Definition:
genericparametricmodel.h:25
GenericParametricModel::setParameters
void setParameters(const ParameterType ¶m)
Definition:
genericparametricmodel.h:42
Generated by
1.8.20