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
08e09fb7
Commit
08e09fb7
authored
13 years ago
by
Oliver Sander
Committed by
sander@FU-BERLIN.DE
13 years ago
Browse files
Options
Downloads
Patches
Plain Diff
specializations for RealTuple<3> and RigidBodyMotion<3>
[[Imported from SVN: r8006]]
parent
96a0e769
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
test/valuefactory.hh
+59
-0
59 additions, 0 deletions
test/valuefactory.hh
with
59 additions
and
0 deletions
test/valuefactory.hh
+
59
−
0
View file @
08e09fb7
...
...
@@ -42,6 +42,37 @@ public:
};
/** \brief A class that creates sets of values of various types, to be used in unit tests
*
* This is the specialization for RealTuple<3>
*/
template
<
>
class
ValueFactory
<
RealTuple
<
3
>
>
{
public:
static
void
get
(
std
::
vector
<
RealTuple
<
3
>
>&
values
)
{
int
nTestPoints
=
10
;
double
testPoints
[
10
][
3
]
=
{{
1
,
0
,
0
},
{
0
,
1
,
0
},
{
-
0.838114
,
0.356751
,
-
0.412667
},
{
-
0.490946
,
-
0.306456
,
0.81551
},{
-
0.944506
,
0.123687
,
-
0.304319
},
{
-
0.6
,
0.1
,
-
0.2
},{
0.45
,
0.12
,
0.517
},
{
-
0.1
,
0.3
,
-
0.1
},{
-
0.444506
,
0.123687
,
0.104319
},{
-
0.7
,
-
0.123687
,
-
0.304319
}};
values
.
resize
(
nTestPoints
);
// Set up elements of S^1
for
(
int
i
=
0
;
i
<
nTestPoints
;
i
++
)
{
Dune
::
FieldVector
<
double
,
3
>
w
;
for
(
int
j
=
0
;
j
<
3
;
j
++
)
w
[
j
]
=
testPoints
[
i
][
j
];
values
[
i
]
=
RealTuple
<
3
>
(
w
);
}
}
};
/** \brief A class that creates sets of values of various types, to be used in unit tests
*
...
...
@@ -165,5 +196,33 @@ public:
};
/** \brief A class that creates sets of values of various types, to be used in unit tests
*
* This is the specialization for RigidBodyMotion<3>
*/
template
<
>
class
ValueFactory
<
RigidBodyMotion
<
3
>
>
{
public:
static
void
get
(
std
::
vector
<
RigidBodyMotion
<
3
>
>&
values
)
{
std
::
vector
<
RealTuple
<
3
>
>
rValues
;
ValueFactory
<
RealTuple
<
3
>
>::
get
(
rValues
);
std
::
vector
<
Rotation
<
3
,
double
>
>
qValues
;
ValueFactory
<
Rotation
<
3
,
double
>
>::
get
(
qValues
);
int
nTestPoints
=
std
::
min
(
rValues
.
size
(),
qValues
.
size
());
values
.
resize
(
nTestPoints
);
// Set up elements of S^1
for
(
int
i
=
0
;
i
<
nTestPoints
;
i
++
)
values
[
i
]
=
RigidBodyMotion
<
3
>
(
rValues
[
i
].
globalCoordinates
(),
qValues
[
i
]);
}
};
#endif
\ No newline at end of file
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