Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-gfe
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Sander, Oliver
dune-gfe
Commits
ed01ad24
Commit
ed01ad24
authored
15 years ago
by
Oliver Sander
Committed by
sander@PCPOOL.MI.FU-BERLIN.DE
15 years ago
Browse files
Options
Downloads
Patches
Plain Diff
make the target space a template parameter
[[Imported from SVN: r4046]]
parent
bc319072
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/geodesicdifference.hh
+7
-34
7 additions, 34 deletions
src/geodesicdifference.hh
with
7 additions
and
34 deletions
src/geodesicdifference.hh
+
7
−
34
View file @
ed01ad24
#ifndef
ROD
_DIFFERENCE_HH
#ifndef
GEODESIC
_DIFFERENCE_HH
#define
ROD
_DIFFERENCE_HH
#define
GEODESIC
_DIFFERENCE_HH
#include
"rigidbodymotion.hh"
template
<
class
TargetSpace
>
Dune
::
BlockVector
<
typename
TargetSpace
::
TangentVector
>
computeGeodesicDifference
(
const
std
::
vector
<
TargetSpace
>&
a
,
Dune
::
BlockVector
<
Dune
::
FieldVector
<
double
,
6
>
>
computeGeodesicDifference
(
const
std
::
vector
<
RigidBodyMotion
<
3
>
>&
a
,
const
std
::
vector
<
TargetSpace
>&
b
)
const
std
::
vector
<
RigidBodyMotion
<
3
>
>&
b
)
{
if
(
a
.
size
()
!=
b
.
size
())
DUNE_THROW
(
Dune
::
Exception
,
"a and b have to have the same length!"
);
Dune
::
BlockVector
<
Dune
::
FieldVector
<
double
,
6
>
>
result
(
a
.
size
());
for
(
size_t
i
=
0
;
i
<
result
.
size
();
i
++
)
{
// Subtract centerline position
for
(
int
j
=
0
;
j
<
3
;
j
++
)
result
[
i
][
j
]
=
a
[
i
].
r
[
j
]
-
b
[
i
].
r
[
j
];
// Subtract orientations on the tangent space of 'a'
Dune
::
FieldVector
<
double
,
3
>
v
=
Rotation
<
3
,
double
>::
difference
(
a
[
i
].
q
,
b
[
i
].
q
);
// Compute difference on T_a SO(3)
for
(
int
j
=
0
;
j
<
3
;
j
++
)
result
[
i
][
j
+
3
]
=
v
[
j
];
}
return
result
;
}
Dune
::
BlockVector
<
Dune
::
FieldVector
<
double
,
3
>
>
computeGeodesicDifference
(
const
std
::
vector
<
Rotation
<
3
,
double
>
>&
a
,
const
std
::
vector
<
Rotation
<
3
,
double
>
>&
b
)
{
{
if
(
a
.
size
()
!=
b
.
size
())
if
(
a
.
size
()
!=
b
.
size
())
DUNE_THROW
(
Dune
::
Exception
,
"a and b have to have the same length!"
);
DUNE_THROW
(
Dune
::
Exception
,
"a and b have to have the same length!"
);
Dune
::
BlockVector
<
Dune
::
FieldVector
<
double
,
3
>
>
result
(
a
.
size
());
Dune
::
BlockVector
<
typename
TargetSpace
::
TangentVector
>
result
(
a
.
size
());
for
(
size_t
i
=
0
;
i
<
result
.
size
();
i
++
)
{
for
(
size_t
i
=
0
;
i
<
result
.
size
();
i
++
)
{
// Subtract orientations on the tangent space of 'a'
// Subtract orientations on the tangent space of 'a'
result
[
i
]
=
Rotation
<
3
,
double
>
::
difference
(
a
[
i
],
b
[
i
]);
result
[
i
]
=
TargetSpace
::
difference
(
a
[
i
],
b
[
i
]);
}
}
...
...
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