-
Notifications
You must be signed in to change notification settings - Fork 473
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(Undirected) Edge indexing mode #654
Open
isaacbrodsky
wants to merge
21
commits into
uber:master
Choose a base branch
from
isaacbrodsky:edge
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
9322d5f
(nondirected) edge mode
09a1603
update tests
6b3e3ab
Merge branch 'master' into edge
7a58fb7
changelog
12a5f67
fix missing H3_EXPORT macro
1dec0fc
Standardize undirected edge term per review
isaacbrodsky f9fa92c
Merge branch 'master' into edge
d023233
Merge branch 'master' into edge
c08f878
Merge branch 'master' into edge
isaacbrodsky b5b3869
update edge mode and tests
isaacbrodsky 4ae0225
Remove NEVER()
isaacbrodsky 018f66f
cover remaining cases
isaacbrodsky f1a28d5
remove commented tests
isaacbrodsky 193727a
fix isPentagon coverage
isaacbrodsky ff22f7e
add coverage for new functionality in edgeLength
isaacbrodsky 4aa7e57
remove irrelevant comment
isaacbrodsky d4386fd
Update website/docs/library/index/h3indexing.md
isaacbrodsky c021e54
Fix assertion message
isaacbrodsky 5fd7ad4
update isValidEdge, docs
isaacbrodsky ce58cda
Merge branch 'master' into edge
isaacbrodsky 7aad06b
Update changelog
isaacbrodsky File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Copyright 2022 Uber Technologies, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
#include "benchmark.h" | ||
#include "h3api.h" | ||
#include "latLng.h" | ||
|
||
// Fixtures (arbitrary res 9 hexagon) | ||
H3Index edges[6] = {0}; | ||
H3Index hex = 0x89283080ddbffff; | ||
|
||
BEGIN_BENCHMARKS(); | ||
|
||
CellBoundary outBoundary; | ||
H3_EXPORT(cellToEdges)(hex, edges); | ||
|
||
BENCHMARK(edgeToBoundary, 10000, { | ||
for (int i = 0; i < 6; i++) { | ||
H3_EXPORT(edgeToBoundary)(edges[i], &outBoundary); | ||
} | ||
}); | ||
|
||
END_BENCHMARKS(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* Copyright 2022 Uber Technologies, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
/** @file | ||
* @brief Fuzzer program for cellsToEdge and related functions | ||
*/ | ||
|
||
#include "aflHarness.h" | ||
#include "h3api.h" | ||
#include "utility.h" | ||
|
||
typedef struct { | ||
H3Index index; | ||
H3Index index2; | ||
} inputArgs; | ||
|
||
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { | ||
if (size < sizeof(inputArgs)) { | ||
return 0; | ||
} | ||
const inputArgs *args = (const inputArgs *)data; | ||
|
||
// Note that index and index2 need to be plausibly neighbors | ||
// for most of these | ||
H3Index out; | ||
H3_EXPORT(cellsToEdge)(args->index, args->index2, &out); | ||
H3_EXPORT(isValidEdge)(args->index); | ||
H3Index out2[2]; | ||
H3_EXPORT(edgeToCells)(args->index, out2); | ||
H3Index out6[6]; | ||
H3_EXPORT(cellToEdges)(args->index, out6); | ||
CellBoundary bndry; | ||
H3_EXPORT(edgeToBoundary)(args->index, &bndry); | ||
H3_EXPORT(directedEdgeToEdge)(args->index, out2); | ||
|
||
return 0; | ||
} | ||
|
||
AFL_HARNESS_MAIN(sizeof(inputArgs)); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor nit (and here just because it provides a nice summary): thoughts on the value of a
edgeToDirectedEdges
function?