Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-xt
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ag-ohlberger
dune-community
dune-xt
Commits
7c0c4b97
Commit
7c0c4b97
authored
9 years ago
by
Tobias Leibner
Browse files
Options
Downloads
Patches
Plain Diff
[functions] rename linear to affine
parent
e24c5815
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dune/stuff/functions/affine.hh
+22
-22
22 additions, 22 deletions
dune/stuff/functions/affine.hh
with
22 additions
and
22 deletions
dune/stuff/functions/
l
ine
ar
.hh
→
dune/stuff/functions/
aff
ine.hh
+
22
−
22
View file @
7c0c4b97
...
...
@@ -5,8 +5,8 @@
//
// Contributors: Tobias Leibner
#ifndef DUNE_STUFF_FUNCTIONS_
L
INE
AR
_HH
#define DUNE_STUFF_FUNCTIONS_
L
INE
AR
_HH
#ifndef DUNE_STUFF_FUNCTIONS_
AFF
INE_HH
#define DUNE_STUFF_FUNCTIONS_
AFF
INE_HH
#include
<memory>
...
...
@@ -21,9 +21,9 @@ namespace Functions {
template
<
class
EntityImp
,
class
DomainFieldImp
,
size_t
domainDim
,
class
RangeFieldImp
,
size_t
rangeDim
,
size_t
rangeDimCols
=
1
>
class
L
ine
ar
class
Aff
ine
{
L
ine
ar
()
Aff
ine
()
{
static_assert
(
AlwaysFalse
<
EntityImp
>::
value
,
"Not available for rangeDimCols > 1!"
);
}
...
...
@@ -31,11 +31,11 @@ class Linear
template
<
class
EntityImp
,
class
DomainFieldImp
,
size_t
domainDim
,
class
RangeFieldImp
,
size_t
rangeDim
>
class
L
ine
ar
<
EntityImp
,
DomainFieldImp
,
domainDim
,
RangeFieldImp
,
rangeDim
,
1
>
class
Aff
ine
<
EntityImp
,
DomainFieldImp
,
domainDim
,
RangeFieldImp
,
rangeDim
,
1
>
:
public
GlobalFunctionInterface
<
EntityImp
,
DomainFieldImp
,
domainDim
,
RangeFieldImp
,
rangeDim
,
1
>
{
typedef
GlobalFunctionInterface
<
EntityImp
,
DomainFieldImp
,
domainDim
,
RangeFieldImp
,
rangeDim
,
1
>
BaseType
;
typedef
L
ine
ar
<
EntityImp
,
DomainFieldImp
,
domainDim
,
RangeFieldImp
,
rangeDim
,
1
>
ThisType
;
typedef
Aff
ine
<
EntityImp
,
DomainFieldImp
,
domainDim
,
RangeFieldImp
,
rangeDim
,
1
>
ThisType
;
public:
typedef
typename
BaseType
::
DomainType
DomainType
;
...
...
@@ -49,14 +49,14 @@ public:
static
std
::
string
static_id
()
{
return
BaseType
::
static_id
()
+
".
l
ine
ar
"
;
return
BaseType
::
static_id
()
+
".
aff
ine"
;
}
static
Common
::
Configuration
default_config
(
const
std
::
string
sub_name
=
""
)
{
Common
::
Configuration
config
;
config
[
"
matrix"
]
=
internal
::
Get
<
RangeFieldImp
,
rangeDim
,
domainDim
>::
value_str
();
config
[
"
vector"
]
=
internal
::
Get
<
RangeFieldImp
,
rangeDim
,
1
>::
value_str
();
config
[
"
A"
]
=
internal
::
Get
<
RangeFieldImp
,
rangeDim
,
domainDim
>::
value_str
();
config
[
"
b"
]
=
internal
::
Get
<
RangeFieldImp
,
rangeDim
,
1
>::
value_str
();
config
[
"name"
]
=
static_id
();
if
(
sub_name
.
empty
())
return
config
;
...
...
@@ -73,23 +73,23 @@ public:
// get correct config
const
Common
::
Configuration
cfg
=
config
.
has_sub
(
sub_name
)
?
config
.
sub
(
sub_name
)
:
config
;
const
Common
::
Configuration
default_cfg
=
default_config
();
return
Common
::
make_unique
<
ThisType
>
(
cfg
.
get
(
"
matrix
"
,
default_cfg
.
get
<
MatrixType
>
(
"
matrix
"
)),
cfg
.
get
(
"
vector
"
,
default_cfg
.
get
<
RangeType
>
(
"
vector
"
)),
return
Common
::
make_unique
<
ThisType
>
(
cfg
.
get
(
"
A
"
,
default_cfg
.
get
<
MatrixType
>
(
"
A
"
)),
cfg
.
get
(
"
b
"
,
default_cfg
.
get
<
RangeType
>
(
"
b
"
)),
cfg
.
get
(
"name"
,
default_cfg
.
get
<
std
::
string
>
(
"name"
)));
}
// ... create(...)
explicit
L
ine
ar
(
const
MatrixType
&
matrix
,
const
RangeType
&
vector
,
const
std
::
string
name_in
=
static_id
())
:
matrix
_
(
matrix
)
,
vector
_
(
vector
)
explicit
Aff
ine
(
const
MatrixType
&
matrix
,
const
RangeType
&
vector
,
const
std
::
string
name_in
=
static_id
())
:
A
_
(
matrix
)
,
b
_
(
vector
)
,
name_
(
name_in
)
{
}
L
ine
ar
(
const
ThisType
&
other
)
=
default
;
Aff
ine
(
const
ThisType
&
other
)
=
default
;
virtual
std
::
string
type
()
const
override
final
{
return
BaseType
::
static_id
()
+
".
l
ine
ar
"
;
return
BaseType
::
static_id
()
+
".
aff
ine"
;
}
virtual
size_t
order
()
const
override
final
...
...
@@ -99,14 +99,14 @@ public:
virtual
void
evaluate
(
const
DomainType
&
x
,
RangeType
&
ret
)
const
override
final
{
matrix
_
.
mv
(
x
,
ret
);
ret
+=
vector
_
;
A
_
.
mv
(
x
,
ret
);
ret
+=
b
_
;
return
ret
;
}
virtual
void
jacobian
(
const
DomainType
&
/*x*/
,
JacobianRangeType
&
ret
)
const
override
final
{
ret
=
matrix
_
;
ret
=
A
_
;
}
virtual
std
::
string
name
()
const
override
final
...
...
@@ -115,8 +115,8 @@ public:
}
private
:
const
MatrixType
matrix
_
;
const
RangeType
vector
_
;
const
MatrixType
A
_
;
const
RangeType
b
_
;
const
std
::
string
name_
;
};
...
...
@@ -125,4 +125,4 @@ private:
}
// namespace Stuff
}
// namespace Dune
#endif // DUNE_STUFF_FUNCTIONS_
L
INE
AR
_HH
#endif // DUNE_STUFF_FUNCTIONS_
AFF
INE_HH
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment