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
8dc0d3ab
Commit
8dc0d3ab
authored
13 years ago
by
Oliver Sander
Committed by
sander@FU-BERLIN.DE
13 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Move the MultiIndex class into a separate file
[[Imported from SVN: r7120]]
parent
a8293e95
No related branches found
No related tags found
Loading
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
test/localgeodesicfefunctiontest.cc
+1
-47
1 addition, 47 deletions
test/localgeodesicfefunctiontest.cc
test/multiindex.hh
+52
-0
52 additions, 0 deletions
test/multiindex.hh
with
53 additions
and
47 deletions
test/localgeodesicfefunctiontest.cc
+
1
−
47
View file @
8dc0d3ab
...
@@ -11,58 +11,12 @@
...
@@ -11,58 +11,12 @@
#include
<dune/gfe/unitvector.hh>
#include
<dune/gfe/unitvector.hh>
#include
<dune/gfe/localgeodesicfefunction.hh>
#include
<dune/gfe/localgeodesicfefunction.hh>
#include
"multiindex.hh"
const
double
eps
=
1e-6
;
const
double
eps
=
1e-6
;
using
namespace
Dune
;
using
namespace
Dune
;
/** \brief N-dimensional multi-index
*/
template
<
int
N
>
class
MultiIndex
:
public
array
<
unsigned
int
,
N
>
{
// The range of each component
unsigned
int
limit_
;
public:
/** \brief Constructor with a given range for each digit */
MultiIndex
(
unsigned
int
limit
)
:
limit_
(
limit
)
{
std
::
fill
(
this
->
begin
(),
this
->
end
(),
0
);
}
/** \brief Increment the MultiIndex */
MultiIndex
&
operator
++
()
{
for
(
int
i
=
0
;
i
<
N
;
i
++
)
{
// Augment digit
(
*
this
)[
i
]
++
;
// If there is no carry-over we can stop here
if
((
*
this
)[
i
]
<
limit_
)
break
;
(
*
this
)[
i
]
=
0
;
}
return
*
this
;
}
/** \brief Compute how many times you can call operator++ before getting to (0,...,0) again */
size_t
cycle
()
const
{
size_t
result
=
1
;
for
(
int
i
=
0
;
i
<
N
;
i
++
)
result
*=
limit_
;
return
result
;
}
};
template
<
int
domainDim
>
template
<
int
domainDim
>
void
testDerivativeTangentiality
(
const
RealTuple
<
1
>&
x
,
void
testDerivativeTangentiality
(
const
RealTuple
<
1
>&
x
,
const
FieldMatrix
<
double
,
1
,
domainDim
>&
derivative
)
const
FieldMatrix
<
double
,
1
,
domainDim
>&
derivative
)
...
...
This diff is collapsed.
Click to expand it.
test/multiindex.hh
0 → 100644
+
52
−
0
View file @
8dc0d3ab
#ifndef MULTI_INDEX_HH
#define MULTI_INDEX_HH
#include
<dune/common/array.hh>
/** \brief N-dimensional multi-index
*/
template
<
int
N
>
class
MultiIndex
:
public
Dune
::
array
<
unsigned
int
,
N
>
{
// The range of each component
unsigned
int
limit_
;
public:
/** \brief Constructor with a given range for each digit */
MultiIndex
(
unsigned
int
limit
)
:
limit_
(
limit
)
{
std
::
fill
(
this
->
begin
(),
this
->
end
(),
0
);
}
/** \brief Increment the MultiIndex */
MultiIndex
&
operator
++
()
{
for
(
int
i
=
0
;
i
<
N
;
i
++
)
{
// Augment digit
(
*
this
)[
i
]
++
;
// If there is no carry-over we can stop here
if
((
*
this
)[
i
]
<
limit_
)
break
;
(
*
this
)[
i
]
=
0
;
}
return
*
this
;
}
/** \brief Compute how many times you can call operator++ before getting to (0,...,0) again */
size_t
cycle
()
const
{
size_t
result
=
1
;
for
(
int
i
=
0
;
i
<
N
;
i
++
)
result
*=
limit_
;
return
result
;
}
};
#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