Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Y
yaxt
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
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
dkrz-sw
yaxt
Commits
72e8a390
Commit
72e8a390
authored
12 years ago
by
Moritz Hanke
Browse files
Options
Downloads
Patches
Plain Diff
removes the constraint of xt_idxstripes, which only allowed non overlapping stripes
parent
02e0c513
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/xt_idxstripes.h
+0
-3
0 additions, 3 deletions
src/xt_idxstripes.h
tests/test_idxstripes.c
+99
-0
99 additions, 0 deletions
tests/test_idxstripes.c
with
99 additions
and
3 deletions
src/xt_idxstripes.h
+
0
−
3
View file @
72e8a390
...
...
@@ -8,9 +8,6 @@
*
* @param[in] stripes array defining the stripes
* @param[in] num_stripes number of stripes
*
* @remarks this routine does not check for overlaps between stripes
* and assumes that there are no
*/
Xt_idxlist
xt_idxstripes_new
(
struct
Xt_stripe
const
*
stripes
,
Xt_count
num_stripes
);
...
...
This diff is collapsed.
Click to expand it.
tests/test_idxstripes.c
+
99
−
0
View file @
72e8a390
...
...
@@ -382,6 +382,105 @@ int main(void) {
xt_idxlist_delete
(
intersection
[
1
]);
}
{
// intersection test
Xt_idxlist
idxstripes_a
,
idxstripes_b
;
struct
Xt_stripe
stripes_a
[
3
]
=
{{
0
,
5
,
1
},{
1
,
5
,
1
},{
2
,
5
,
1
}};
struct
Xt_stripe
stripes_b
[
1
]
=
{{
-
2
,
10
,
1
}};
idxstripes_a
=
xt_idxstripes_new
(
stripes_a
,
3
);
idxstripes_b
=
xt_idxstripes_new
(
stripes_b
,
1
);
// compute intersection
Xt_idxlist
intersection
[
2
];
intersection
[
0
]
=
xt_idxlist_get_intersection
(
idxstripes_a
,
idxstripes_b
);
intersection
[
1
]
=
xt_idxlist_get_intersection
(
idxstripes_b
,
idxstripes_a
);
// check intersection
Xt_idx
ref_indices
[
2
][
15
]
=
{{
0
,
1
,
2
,
3
,
4
,
5
,
6
},{
0
,
1
,
1
,
2
,
2
,
2
,
3
,
3
,
3
,
4
,
4
,
4
,
5
,
5
,
6
}};
Xt_count
ref_num_indices
[
2
]
=
{
7
,
15
};
do_tests
(
intersection
[
0
],
ref_indices
[
0
],
ref_num_indices
[
0
]);
do_tests
(
intersection
[
1
],
ref_indices
[
1
],
ref_num_indices
[
1
]);
// clean up
xt_idxlist_delete
(
idxstripes_a
);
xt_idxlist_delete
(
idxstripes_b
);
xt_idxlist_delete
(
intersection
[
0
]);
xt_idxlist_delete
(
intersection
[
1
]);
}
{
// intersection test
Xt_idxlist
idxstripes_a
,
idxstripes_b
;
struct
Xt_stripe
stripes_a
[
1
]
=
{{
0
,
5
,
2
}};
struct
Xt_stripe
stripes_b
[
1
]
=
{{
1
,
5
,
2
}};
idxstripes_a
=
xt_idxstripes_new
(
stripes_a
,
1
);
idxstripes_b
=
xt_idxstripes_new
(
stripes_b
,
1
);
// compute intersection
Xt_idxlist
intersection
[
2
];
intersection
[
0
]
=
xt_idxlist_get_intersection
(
idxstripes_a
,
idxstripes_b
);
intersection
[
1
]
=
xt_idxlist_get_intersection
(
idxstripes_b
,
idxstripes_a
);
// check intersection
Xt_idx
ref_indices
[
1
]
=
{};
Xt_count
ref_num_indices
=
0
;
do_tests
(
intersection
[
0
],
ref_indices
,
ref_num_indices
);
do_tests
(
intersection
[
1
],
ref_indices
,
ref_num_indices
);
// clean up
xt_idxlist_delete
(
idxstripes_a
);
xt_idxlist_delete
(
idxstripes_b
);
xt_idxlist_delete
(
intersection
[
0
]);
xt_idxlist_delete
(
intersection
[
1
]);
}
{
// intersection test
Xt_idxlist
idxstripes_a
,
idxstripes_b
;
struct
Xt_stripe
stripes_a
[
1
]
=
{{
0
,
20
,
5
}};
struct
Xt_stripe
stripes_b
[
1
]
=
{{
1
,
15
,
7
}};
idxstripes_a
=
xt_idxstripes_new
(
stripes_a
,
1
);
idxstripes_b
=
xt_idxstripes_new
(
stripes_b
,
1
);
// compute intersection
Xt_idxlist
intersection
[
2
];
intersection
[
0
]
=
xt_idxlist_get_intersection
(
idxstripes_a
,
idxstripes_b
);
intersection
[
1
]
=
xt_idxlist_get_intersection
(
idxstripes_b
,
idxstripes_a
);
// check intersection
Xt_idx
ref_indices
[
3
]
=
{
15
,
50
,
85
};
Xt_count
ref_num_indices
=
3
;
do_tests
(
intersection
[
0
],
ref_indices
,
ref_num_indices
);
do_tests
(
intersection
[
1
],
ref_indices
,
ref_num_indices
);
// clean up
xt_idxlist_delete
(
idxstripes_a
);
xt_idxlist_delete
(
idxstripes_b
);
xt_idxlist_delete
(
intersection
[
0
]);
xt_idxlist_delete
(
intersection
[
1
]);
}
MPI_Finalize
();
return
TEST_EXIT_CODE
;
...
...
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