Skip to content

Commit c6e6577

Browse files
committed
Auto-generated commit
1 parent 50e6c0f commit c6e6577

File tree

296 files changed

+2746
-290
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

296 files changed

+2746
-290
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,16 @@
203203

204204
<details>
205205

206+
<section class="features">
207+
208+
##### Features
209+
210+
- [`a360f04`](https://github.com/stdlib-js/stdlib/commit/a360f048dde8429a3ffcc60d36abe9ad33038c73) - add boolean dtype support to `ndarray/base/unary` [(#2587)](https://github.com/stdlib-js/stdlib/pull/2587)
211+
212+
</section>
213+
214+
<!-- /.features -->
215+
206216
<section class="bug-fixes">
207217

208218
##### Bug Fixes
@@ -517,6 +527,7 @@ A total of 3 people contributed to this release. Thank you to the following cont
517527

518528
<details>
519529

530+
- [`a360f04`](https://github.com/stdlib-js/stdlib/commit/a360f048dde8429a3ffcc60d36abe9ad33038c73) - **feat:** add boolean dtype support to `ndarray/base/unary` [(#2587)](https://github.com/stdlib-js/stdlib/pull/2587) _(by Jaysukh Makvana)_
520531
- [`19d4a8d`](https://github.com/stdlib-js/stdlib/commit/19d4a8da27facd0cc72b6162dc7e6b0d66d7a63c) - **feat:** add boolean dtype support to `ndarray/base/nullary` [(#2586)](https://github.com/stdlib-js/stdlib/pull/2586) _(by Jaysukh Makvana)_
521532
- [`c067b6c`](https://github.com/stdlib-js/stdlib/commit/c067b6c990c99b8f4cf315b5378af8574098962b) - **docs:** update namespace table of contents [(#2576)](https://github.com/stdlib-js/stdlib/pull/2576) _(by stdlib-bot, Philipp Burckhardt)_
522533
- [`d71c3a9`](https://github.com/stdlib-js/stdlib/commit/d71c3a91bd81b7dff1a24b151ef429c427e5875b) - **docs:** update namespace TypeScript declarations [(#2584)](https://github.com/stdlib-js/stdlib/pull/2584) _(by stdlib-bot, Athan Reines)_

base/unary/README.md

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ Character codes for data types:
177177

178178
<!-- charcodes -->
179179

180+
- **x**: `bool` (boolean).
180181
- **c**: `complex64` (single-precision floating-point complex number).
181182
- **z**: `complex128` (double-precision floating-point complex number).
182183
- **f**: `float32` (single-precision floating-point number).
@@ -13086,6 +13087,97 @@ The function accepts the following arguments:
1308613087
int8_t stdlib_ndarray_u_z_as_z_z( struct ndarray *arrays[], void *fcn );
1308713088
```
1308813089

13090+
#### stdlib_ndarray_x_x( \*arrays\[], \*fcn )
13091+
13092+
Applies a unary callback to an input ndarray and assigns results to elements in an output ndarray.
13093+
13094+
```c
13095+
#include "stdlib/ndarray/dtypes.h"
13096+
#include "stdlib/ndarray/index_modes.h"
13097+
#include "stdlib/ndarray/orders.h"
13098+
#include "stdlib/ndarray/ctor.h"
13099+
#include <stdbool.h>
13100+
#include <stdint.h>
13101+
#include <stdlib.h>
13102+
#include <stdio.h>
13103+
13104+
// Define the ndarray data types:
13105+
enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_BOOL;
13106+
enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL;
13107+
13108+
// Create underlying byte arrays:
13109+
uint8_t xbuf[] = { 0, 0, 0, 0 };
13110+
uint8_t ybuf[] = { 0, 0, 0, 0 };
13111+
13112+
// Define the number of dimensions:
13113+
int64_t ndims = 2;
13114+
13115+
// Define the array shapes:
13116+
int64_t shape[] = { 2, 2 };
13117+
13118+
// Define the strides:
13119+
int64_t sx[] = { 2, 1 };
13120+
int64_t sy[] = { 2, 1 };
13121+
13122+
// Define the offsets:
13123+
int64_t ox = 0;
13124+
int64_t oy = 0;
13125+
13126+
// Define the array order:
13127+
enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
13128+
13129+
// Specify the index mode:
13130+
enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
13131+
13132+
// Specify the subscript index modes:
13133+
int8_t submodes[] = { imode };
13134+
int64_t nsubmodes = 1;
13135+
13136+
// Create an input ndarray:
13137+
struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shape, sx, ox, order, imode, nsubmodes, submodes );
13138+
if ( x == NULL ) {
13139+
fprintf( stderr, "Error allocating memory.\n" );
13140+
exit( EXIT_FAILURE );
13141+
}
13142+
13143+
// Create an output ndarray:
13144+
struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shape, sy, oy, order, imode, nsubmodes, submodes );
13145+
if ( y == NULL ) {
13146+
fprintf( stderr, "Error allocating memory.\n" );
13147+
exit( EXIT_FAILURE );
13148+
}
13149+
13150+
// Create an array containing the ndarrays:
13151+
struct ndarray *arrays[] = { x, y };
13152+
13153+
// Define a callback:
13154+
static bool fcn( const bool x ) {
13155+
return x;
13156+
}
13157+
13158+
// Apply the callback:
13159+
int8_t status = stdlib_ndarray_x_x( arrays, (void *)fcn );
13160+
if ( status != 0 ) {
13161+
fprintf( stderr, "Error during computation.\n" );
13162+
exit( EXIT_FAILURE );
13163+
}
13164+
13165+
// ...
13166+
13167+
// Free allocated memory:
13168+
stdlib_ndarray_free( x );
13169+
stdlib_ndarray_free( y );
13170+
```
13171+
13172+
The function accepts the following arguments:
13173+
13174+
- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray.
13175+
- **fcn**: `[in] void*` a `bool (*f)(bool)` function to apply provided as a `void` pointer.
13176+
13177+
```c
13178+
int8_t stdlib_ndarray_x_x( struct ndarray *arrays[], void *fcn );
13179+
```
13180+
1308913181
#### stdlib_ndarray_z_d_as_z_d( \*arrays\[], \*fcn )
1309013182

1309113183
Applies a unary callback to an input ndarray and assigns results to elements in an output ndarray.

base/unary/include/stdlib/ndarray/base/unary.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,8 @@
183183
#include "unary/u_z_as_u_z.h"
184184
#include "unary/u_z_as_z_z.h"
185185

186+
#include "unary/x_x.h"
187+
186188
#include "unary/z_d_as_z_d.h"
187189
#include "unary/z_z.h"
188190
// END LOOPS

base/unary/include/stdlib/ndarray/base/unary/b_b.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2023 The Stdlib Authors.
4+
* Copyright (c) 2024 The Stdlib Authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.

base/unary/include/stdlib/ndarray/base/unary/b_b_as_u_u.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2023 The Stdlib Authors.
4+
* Copyright (c) 2024 The Stdlib Authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.

base/unary/include/stdlib/ndarray/base/unary/b_c.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2023 The Stdlib Authors.
4+
* Copyright (c) 2024 The Stdlib Authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.

base/unary/include/stdlib/ndarray/base/unary/b_c_as_b_c.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2023 The Stdlib Authors.
4+
* Copyright (c) 2024 The Stdlib Authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.

base/unary/include/stdlib/ndarray/base/unary/b_c_as_c_c.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2023 The Stdlib Authors.
4+
* Copyright (c) 2024 The Stdlib Authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.

base/unary/include/stdlib/ndarray/base/unary/b_c_as_z_z.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2023 The Stdlib Authors.
4+
* Copyright (c) 2024 The Stdlib Authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.

base/unary/include/stdlib/ndarray/base/unary/b_d.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2023 The Stdlib Authors.
4+
* Copyright (c) 2024 The Stdlib Authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.

base/unary/include/stdlib/ndarray/base/unary/b_d_as_b_d.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2023 The Stdlib Authors.
4+
* Copyright (c) 2024 The Stdlib Authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.

base/unary/include/stdlib/ndarray/base/unary/b_d_as_d_d.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2023 The Stdlib Authors.
4+
* Copyright (c) 2024 The Stdlib Authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.

base/unary/include/stdlib/ndarray/base/unary/b_f.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2023 The Stdlib Authors.
4+
* Copyright (c) 2024 The Stdlib Authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.

base/unary/include/stdlib/ndarray/base/unary/b_f_as_b_f.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2023 The Stdlib Authors.
4+
* Copyright (c) 2024 The Stdlib Authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.

base/unary/include/stdlib/ndarray/base/unary/b_f_as_d_d.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2023 The Stdlib Authors.
4+
* Copyright (c) 2024 The Stdlib Authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.

base/unary/include/stdlib/ndarray/base/unary/b_f_as_f_f.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2023 The Stdlib Authors.
4+
* Copyright (c) 2024 The Stdlib Authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.

base/unary/include/stdlib/ndarray/base/unary/b_i.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2023 The Stdlib Authors.
4+
* Copyright (c) 2024 The Stdlib Authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.

base/unary/include/stdlib/ndarray/base/unary/b_i_as_b_i.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2023 The Stdlib Authors.
4+
* Copyright (c) 2024 The Stdlib Authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.

base/unary/include/stdlib/ndarray/base/unary/b_i_as_i_i.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2023 The Stdlib Authors.
4+
* Copyright (c) 2024 The Stdlib Authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.

base/unary/include/stdlib/ndarray/base/unary/b_k.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2023 The Stdlib Authors.
4+
* Copyright (c) 2024 The Stdlib Authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.

base/unary/include/stdlib/ndarray/base/unary/b_k_as_b_k.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2023 The Stdlib Authors.
4+
* Copyright (c) 2024 The Stdlib Authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.

base/unary/include/stdlib/ndarray/base/unary/b_k_as_i_i.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2023 The Stdlib Authors.
4+
* Copyright (c) 2024 The Stdlib Authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.

base/unary/include/stdlib/ndarray/base/unary/b_k_as_k_k.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2023 The Stdlib Authors.
4+
* Copyright (c) 2024 The Stdlib Authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.

base/unary/include/stdlib/ndarray/base/unary/b_t.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2023 The Stdlib Authors.
4+
* Copyright (c) 2024 The Stdlib Authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.

base/unary/include/stdlib/ndarray/base/unary/b_t_as_b_t.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2023 The Stdlib Authors.
4+
* Copyright (c) 2024 The Stdlib Authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.

base/unary/include/stdlib/ndarray/base/unary/b_t_as_t_t.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2023 The Stdlib Authors.
4+
* Copyright (c) 2024 The Stdlib Authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.

base/unary/include/stdlib/ndarray/base/unary/b_t_as_u_u.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2023 The Stdlib Authors.
4+
* Copyright (c) 2024 The Stdlib Authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.

base/unary/include/stdlib/ndarray/base/unary/b_u.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2023 The Stdlib Authors.
4+
* Copyright (c) 2024 The Stdlib Authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.

base/unary/include/stdlib/ndarray/base/unary/b_u_as_b_u.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2023 The Stdlib Authors.
4+
* Copyright (c) 2024 The Stdlib Authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.

base/unary/include/stdlib/ndarray/base/unary/b_u_as_u_u.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2023 The Stdlib Authors.
4+
* Copyright (c) 2024 The Stdlib Authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.

base/unary/include/stdlib/ndarray/base/unary/b_z.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2023 The Stdlib Authors.
4+
* Copyright (c) 2024 The Stdlib Authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)