Skip to content

Commit 9f517d8

Browse files
committed
feat: add header files for internal C utilities
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent 7a58757 commit 9f517d8

File tree

3 files changed

+87
-0
lines changed

3 files changed

+87
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2023 The Stdlib Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
#ifndef STDLIB_NDARRAY_BASE_EVERY_INTERNAL_PERMUTE_H
20+
#define STDLIB_NDARRAY_BASE_EVERY_INTERNAL_PERMUTE_H
21+
22+
#include <stdint.h>
23+
24+
/**
25+
* Permutes an input array according to a provided index array.
26+
*/
27+
void stdlib_ndarray_base_every_internal_permute( const int64_t n, const int64_t *arr, const int64_t *idx, int64_t *out );
28+
29+
#endif // !STDLIB_NDARRAY_BASE_EVERY_INTERNAL_PERMUTE_H
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2023 The Stdlib Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
#ifndef STDLIB_NDARRAY_BASE_EVERY_INTERNAL_RANGE_H
20+
#define STDLIB_NDARRAY_BASE_EVERY_INTERNAL_RANGE_H
21+
22+
#include <stdint.h>
23+
24+
/**
25+
* Writes `n` evenly spaced values from `0` to `n-1` to an output array.
26+
*/
27+
void stdlib_ndarray_base_every_internal_range( const int64_t n, int64_t *out );
28+
29+
#endif // !STDLIB_NDARRAY_BASE_EVERY_INTERNAL_RANGE_H
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2023 The Stdlib Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
#ifndef STDLIB_NDARRAY_BASE_EVERY_INTERNAL_SORT2INS_H
20+
#define STDLIB_NDARRAY_BASE_EVERY_INTERNAL_SORT2INS_H
21+
22+
#include <stdint.h>
23+
24+
/**
25+
* Simultaneously sorts two arrays based on the sort order of the first array using insertion sort.
26+
*/
27+
void stdlib_ndarray_base_every_internal_sort2ins( const int64_t n, int64_t *x, int64_t *y );
28+
29+
#endif // !STDLIB_NDARRAY_BASE_EVERY_INTERNAL_SORT2INS_H

0 commit comments

Comments
 (0)