From d7877e41b5a0c25512d4421d39e7aeab56beaf28 Mon Sep 17 00:00:00 2001 From: Jaysukh-409 Date: Sat, 13 Jul 2024 19:36:56 +0530 Subject: [PATCH 1/2] feat: add boolean dtype support to ndarray/base/nullary --- .../@stdlib/ndarray/base/nullary/README.md | 81 +- .../include/stdlib/ndarray/base/nullary.h | 2 + .../include/stdlib/ndarray/base/nullary/b.h | 2 +- .../include/stdlib/ndarray/base/nullary/c.h | 2 +- .../stdlib/ndarray/base/nullary/c_as_b.h | 2 +- .../stdlib/ndarray/base/nullary/c_as_f.h | 2 +- .../stdlib/ndarray/base/nullary/c_as_k.h | 2 +- .../stdlib/ndarray/base/nullary/c_as_s.h | 2 +- .../stdlib/ndarray/base/nullary/c_as_t.h | 2 +- .../stdlib/ndarray/base/nullary/c_as_z.h | 2 +- .../include/stdlib/ndarray/base/nullary/d.h | 2 +- .../stdlib/ndarray/base/nullary/d_as_b.h | 2 +- .../stdlib/ndarray/base/nullary/d_as_f.h | 2 +- .../stdlib/ndarray/base/nullary/d_as_i.h | 2 +- .../stdlib/ndarray/base/nullary/d_as_k.h | 2 +- .../stdlib/ndarray/base/nullary/d_as_s.h | 2 +- .../stdlib/ndarray/base/nullary/d_as_t.h | 2 +- .../stdlib/ndarray/base/nullary/d_as_u.h | 2 +- .../include/stdlib/ndarray/base/nullary/f.h | 2 +- .../stdlib/ndarray/base/nullary/f_as_b.h | 2 +- .../stdlib/ndarray/base/nullary/f_as_d.h | 2 +- .../stdlib/ndarray/base/nullary/f_as_k.h | 2 +- .../stdlib/ndarray/base/nullary/f_as_s.h | 2 +- .../stdlib/ndarray/base/nullary/f_as_t.h | 2 +- .../include/stdlib/ndarray/base/nullary/i.h | 2 +- .../stdlib/ndarray/base/nullary/i_as_b.h | 2 +- .../stdlib/ndarray/base/nullary/i_as_k.h | 2 +- .../stdlib/ndarray/base/nullary/i_as_s.h | 2 +- .../stdlib/ndarray/base/nullary/i_as_t.h | 2 +- .../include/stdlib/ndarray/base/nullary/k.h | 2 +- .../stdlib/ndarray/base/nullary/k_as_b.h | 2 +- .../stdlib/ndarray/base/nullary/k_as_s.h | 2 +- .../include/stdlib/ndarray/base/nullary/s.h | 2 +- .../include/stdlib/ndarray/base/nullary/t.h | 2 +- .../stdlib/ndarray/base/nullary/t_as_b.h | 2 +- .../include/stdlib/ndarray/base/nullary/u.h | 2 +- .../stdlib/ndarray/base/nullary/u_as_b.h | 2 +- .../stdlib/ndarray/base/nullary/u_as_t.h | 2 +- .../include/stdlib/ndarray/base/nullary/x.h | 150 ++ .../include/stdlib/ndarray/base/nullary/z.h | 2 +- .../stdlib/ndarray/base/nullary/z_as_b.h | 2 +- .../stdlib/ndarray/base/nullary/z_as_c.h | 2 +- .../stdlib/ndarray/base/nullary/z_as_d.h | 2 +- .../stdlib/ndarray/base/nullary/z_as_f.h | 2 +- .../stdlib/ndarray/base/nullary/z_as_i.h | 2 +- .../stdlib/ndarray/base/nullary/z_as_k.h | 2 +- .../stdlib/ndarray/base/nullary/z_as_s.h | 2 +- .../stdlib/ndarray/base/nullary/z_as_t.h | 2 +- .../stdlib/ndarray/base/nullary/z_as_u.h | 2 +- .../ndarray/base/nullary/manifest.json | 1 + .../ndarray/base/nullary/scripts/loops.js | 11 +- .../base/nullary/scripts/templates/docs.txt | 2 +- .../@stdlib/ndarray/base/nullary/src/b.c | 2 +- .../@stdlib/ndarray/base/nullary/src/c.c | 2 +- .../@stdlib/ndarray/base/nullary/src/c_as_b.c | 2 +- .../@stdlib/ndarray/base/nullary/src/c_as_f.c | 2 +- .../@stdlib/ndarray/base/nullary/src/c_as_k.c | 2 +- .../@stdlib/ndarray/base/nullary/src/c_as_s.c | 2 +- .../@stdlib/ndarray/base/nullary/src/c_as_t.c | 2 +- .../@stdlib/ndarray/base/nullary/src/c_as_z.c | 2 +- .../@stdlib/ndarray/base/nullary/src/d.c | 2 +- .../@stdlib/ndarray/base/nullary/src/d_as_b.c | 2 +- .../@stdlib/ndarray/base/nullary/src/d_as_f.c | 2 +- .../@stdlib/ndarray/base/nullary/src/d_as_i.c | 2 +- .../@stdlib/ndarray/base/nullary/src/d_as_k.c | 2 +- .../@stdlib/ndarray/base/nullary/src/d_as_s.c | 2 +- .../@stdlib/ndarray/base/nullary/src/d_as_t.c | 2 +- .../@stdlib/ndarray/base/nullary/src/d_as_u.c | 2 +- .../@stdlib/ndarray/base/nullary/src/f.c | 2 +- .../@stdlib/ndarray/base/nullary/src/f_as_b.c | 2 +- .../@stdlib/ndarray/base/nullary/src/f_as_d.c | 2 +- .../@stdlib/ndarray/base/nullary/src/f_as_k.c | 2 +- .../@stdlib/ndarray/base/nullary/src/f_as_s.c | 2 +- .../@stdlib/ndarray/base/nullary/src/f_as_t.c | 2 +- .../@stdlib/ndarray/base/nullary/src/i.c | 2 +- .../@stdlib/ndarray/base/nullary/src/i_as_b.c | 2 +- .../@stdlib/ndarray/base/nullary/src/i_as_k.c | 2 +- .../@stdlib/ndarray/base/nullary/src/i_as_s.c | 2 +- .../@stdlib/ndarray/base/nullary/src/i_as_t.c | 2 +- .../@stdlib/ndarray/base/nullary/src/k.c | 2 +- .../@stdlib/ndarray/base/nullary/src/k_as_b.c | 2 +- .../@stdlib/ndarray/base/nullary/src/k_as_s.c | 2 +- .../@stdlib/ndarray/base/nullary/src/s.c | 2 +- .../@stdlib/ndarray/base/nullary/src/t.c | 2 +- .../@stdlib/ndarray/base/nullary/src/t_as_b.c | 2 +- .../@stdlib/ndarray/base/nullary/src/u.c | 2 +- .../@stdlib/ndarray/base/nullary/src/u_as_b.c | 2 +- .../@stdlib/ndarray/base/nullary/src/u_as_t.c | 2 +- .../@stdlib/ndarray/base/nullary/src/x.c | 1922 +++++++++++++++++ .../@stdlib/ndarray/base/nullary/src/z.c | 2 +- .../@stdlib/ndarray/base/nullary/src/z_as_b.c | 2 +- .../@stdlib/ndarray/base/nullary/src/z_as_c.c | 2 +- .../@stdlib/ndarray/base/nullary/src/z_as_d.c | 2 +- .../@stdlib/ndarray/base/nullary/src/z_as_f.c | 2 +- .../@stdlib/ndarray/base/nullary/src/z_as_i.c | 2 +- .../@stdlib/ndarray/base/nullary/src/z_as_k.c | 2 +- .../@stdlib/ndarray/base/nullary/src/z_as_s.c | 2 +- .../@stdlib/ndarray/base/nullary/src/z_as_t.c | 2 +- .../@stdlib/ndarray/base/nullary/src/z_as_u.c | 2 +- 99 files changed, 2258 insertions(+), 95 deletions(-) create mode 100644 lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/x.h create mode 100644 lib/node_modules/@stdlib/ndarray/base/nullary/src/x.c diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/README.md b/lib/node_modules/@stdlib/ndarray/base/nullary/README.md index 7d845758220f..d04aecc268f1 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/README.md @@ -2,7 +2,7 @@ @license Apache-2.0 -Copyright (c) 2023 The Stdlib Authors. +Copyright (c) 2024 The Stdlib Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -153,6 +153,7 @@ Character codes for data types: +- **x**: `bool` (boolean). - **z**: `complex128` (double-precision floating-point complex number). - **c**: `complex64` (single-precision floating-point complex number). - **f**: `float32` (single-precision floating-point number). @@ -3028,6 +3029,84 @@ The function accepts the following arguments: int8_t stdlib_ndarray_u_as_t( struct ndarray *arrays[], void *fcn ); ``` +#### stdlib_ndarray_x( \*arrays\[], \*fcn ) + +Applies a nullary callback and assigns results to elements in an output ndarray. + +```c +#include "stdlib/ndarray/dtypes.h" +#include "stdlib/ndarray/index_modes.h" +#include "stdlib/ndarray/orders.h" +#include "stdlib/ndarray/ctor.h" +#include +#include +#include + +// Define the ndarray data type: +enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_BOOL; + +// Create an underlying byte array: +uint8_t xbuf[] = { 0, 0, 0, 0 }; + +// Define the number of dimensions: +int64_t ndims = 2; + +// Define the array shape: +int64_t shape[] = { 2, 2 }; + +// Define the strides: +int64_t sx[] = { 2, 1 }; + +// Define the index offset: +int64_t ox = 0; + +// Define the array order: +enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; + +// Specify the index mode: +enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; + +// Specify the subscript index modes: +int8_t submodes[] = { imode }; +int64_t nsubmodes = 1; + +// Create an output ndarray: +struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shape, sx, ox, order, imode, nsubmodes, submodes ); +if ( x == NULL ) { + fprintf( stderr, "Error allocating memory.\n" ); + exit( EXIT_FAILURE ); +} + +// Create an array containing a pointer to the ndarray: +struct ndarray *arrays[] = { x }; + +// Define a callback: +static bool fcn( void ) { + return true; +} + +// Apply the callback: +int8_t status = stdlib_ndarray_x( arrays, (void *)fcn ); +if ( status != 0 ) { + fprintf( stderr, "Error during computation.\n" ); + exit( EXIT_FAILURE ); +} + +// ... + +// Free allocated memory: +stdlib_ndarray_free( x ); +``` + +The function accepts the following arguments: + +- **arrays**: `[inout] struct ndarray**` array whose only element is a pointer to an output ndarray. +- **fcn**: `[in] void*` a `bool (*f)()` function to apply provided as a `void` pointer. + +```c +int8_t stdlib_ndarray_x( struct ndarray *arrays[], void *fcn ); +``` + #### stdlib_ndarray_z( \*arrays\[], \*fcn ) Applies a nullary callback and assigns results to elements in an output ndarray. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary.h b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary.h index e22703dca456..5e7ae6254d34 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary.h +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary.h @@ -77,6 +77,8 @@ #include "nullary/u_as_b.h" #include "nullary/u_as_t.h" +#include "nullary/x.h" + #include "nullary/z.h" #include "nullary/z_as_b.h" #include "nullary/z_as_c.h" diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/b.h b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/b.h index 6642a01dc788..cd3555676585 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/b.h +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/b.h @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/c.h b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/c.h index 17cb6d603b80..715d006bf29b 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/c.h +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/c.h @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/c_as_b.h b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/c_as_b.h index 57ed8dcd8d0e..deae4ac14f02 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/c_as_b.h +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/c_as_b.h @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/c_as_f.h b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/c_as_f.h index 35fb26c263a2..614755a6e4ed 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/c_as_f.h +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/c_as_f.h @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/c_as_k.h b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/c_as_k.h index c9ebb4ba52a9..9481444ce509 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/c_as_k.h +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/c_as_k.h @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/c_as_s.h b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/c_as_s.h index 4b2da9669434..f3fd9ed9ff29 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/c_as_s.h +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/c_as_s.h @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/c_as_t.h b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/c_as_t.h index 39b1903f4397..10ad85021c60 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/c_as_t.h +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/c_as_t.h @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/c_as_z.h b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/c_as_z.h index ccc77bd53d0e..bdb7cec60895 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/c_as_z.h +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/c_as_z.h @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/d.h b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/d.h index 87cdb82a32da..4702a5e4e521 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/d.h +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/d.h @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/d_as_b.h b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/d_as_b.h index ac52196745be..550971aecd88 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/d_as_b.h +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/d_as_b.h @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/d_as_f.h b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/d_as_f.h index 2ead41578ff8..b1c801ec1f10 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/d_as_f.h +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/d_as_f.h @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/d_as_i.h b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/d_as_i.h index 795d5e32ca26..3fec9406654f 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/d_as_i.h +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/d_as_i.h @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/d_as_k.h b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/d_as_k.h index d7997fba62b1..2a5536e32918 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/d_as_k.h +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/d_as_k.h @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/d_as_s.h b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/d_as_s.h index 642faf35655e..2948dc4d31fe 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/d_as_s.h +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/d_as_s.h @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/d_as_t.h b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/d_as_t.h index 08a03425546c..a51e5674a0d8 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/d_as_t.h +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/d_as_t.h @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/d_as_u.h b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/d_as_u.h index abb861e8208c..380e19de7993 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/d_as_u.h +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/d_as_u.h @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/f.h b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/f.h index 88f7c5e7a2f5..25631d97fca3 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/f.h +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/f.h @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/f_as_b.h b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/f_as_b.h index 03ba8f35d2c2..afcf6521feac 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/f_as_b.h +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/f_as_b.h @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/f_as_d.h b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/f_as_d.h index 140a3fbb9986..681b06eab28b 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/f_as_d.h +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/f_as_d.h @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/f_as_k.h b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/f_as_k.h index 2d17ae3c35b2..341c45e8a9df 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/f_as_k.h +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/f_as_k.h @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/f_as_s.h b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/f_as_s.h index df9c068a5805..5ba7b744ef25 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/f_as_s.h +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/f_as_s.h @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/f_as_t.h b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/f_as_t.h index d6a6117005a8..e44504c9cdf4 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/f_as_t.h +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/f_as_t.h @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/i.h b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/i.h index 16d227fc9cbc..b15b09483eda 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/i.h +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/i.h @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/i_as_b.h b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/i_as_b.h index 21a67d8362b2..e74e06fd6aaa 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/i_as_b.h +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/i_as_b.h @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/i_as_k.h b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/i_as_k.h index 7de43b09a46a..3230b5c97de1 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/i_as_k.h +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/i_as_k.h @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/i_as_s.h b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/i_as_s.h index c2b129f97f82..e5e555ad9a5f 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/i_as_s.h +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/i_as_s.h @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/i_as_t.h b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/i_as_t.h index 28fea81bcc34..d93c6675603c 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/i_as_t.h +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/i_as_t.h @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/k.h b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/k.h index f09c274ae2ca..4a38c442dad7 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/k.h +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/k.h @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/k_as_b.h b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/k_as_b.h index 3af531868f79..6e2ccafd3c0f 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/k_as_b.h +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/k_as_b.h @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/k_as_s.h b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/k_as_s.h index 1c285977c43e..77734f6a6c6a 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/k_as_s.h +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/k_as_s.h @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/s.h b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/s.h index 481f9cbee43e..31db6b58dc1b 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/s.h +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/s.h @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/t.h b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/t.h index 5929a803f763..c3a7f3e8454a 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/t.h +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/t.h @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/t_as_b.h b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/t_as_b.h index a811bc77fc77..38159d8c1f60 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/t_as_b.h +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/t_as_b.h @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/u.h b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/u.h index cf817ec55810..0692483e35a9 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/u.h +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/u.h @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/u_as_b.h b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/u_as_b.h index 0b97c2eb5dea..728908a7e157 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/u_as_b.h +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/u_as_b.h @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/u_as_t.h b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/u_as_t.h index d6883b0d9c1f..bccddc8831a6 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/u_as_t.h +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/u_as_t.h @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/x.h b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/x.h new file mode 100644 index 000000000000..6efc4b3c2288 --- /dev/null +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/x.h @@ -0,0 +1,150 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* 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. +*/ + +/* +* The following is auto-generated. Do not manually edit. See scripts/loops.js. +*/ + +#ifndef STDLIB_NDARRAY_BASE_NULLARY_X_H +#define STDLIB_NDARRAY_BASE_NULLARY_X_H + +#include "stdlib/ndarray/ctor.h" +#include + +/* +* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. +*/ +#ifdef __cplusplus +extern "C" { +#endif + +/** +* Applies a nullary callback and assigns results to elements in an output ndarray. +*/ +int8_t stdlib_ndarray_x( struct ndarray *arrays[], void *fcn ); + +/** +* Applies a nullary callback and assigns results to elements in a zero-dimensional output ndarray. +*/ +int8_t stdlib_ndarray_x_0d( struct ndarray *arrays[], void *fcn ); + +/** +* Applies a nullary callback and assigns results to elements in a one-dimensional output ndarray. +*/ +int8_t stdlib_ndarray_x_1d( struct ndarray *arrays[], void *fcn ); + +/** +* Applies a nullary callback and assigns results to elements in a two-dimensional output ndarray. +*/ +int8_t stdlib_ndarray_x_2d( struct ndarray *arrays[], void *fcn ); + +/** +* Applies a nullary callback and assigns results to elements in a two-dimensional output ndarray. +*/ +int8_t stdlib_ndarray_x_2d_blocked( struct ndarray *arrays[], void *fcn ); + +/** +* Applies a nullary callback and assigns results to elements in a three-dimensional output ndarray. +*/ +int8_t stdlib_ndarray_x_3d( struct ndarray *arrays[], void *fcn ); + +/** +* Applies a nullary callback and assigns results to elements in a three-dimensional output ndarray. +*/ +int8_t stdlib_ndarray_x_3d_blocked( struct ndarray *arrays[], void *fcn ); + +/** +* Applies a nullary callback and assigns results to elements in a four-dimensional output ndarray. +*/ +int8_t stdlib_ndarray_x_4d( struct ndarray *arrays[], void *fcn ); + +/** +* Applies a nullary callback and assigns results to elements in a four-dimensional output ndarray. +*/ +int8_t stdlib_ndarray_x_4d_blocked( struct ndarray *arrays[], void *fcn ); + +/** +* Applies a nullary callback and assigns results to elements in a five-dimensional output ndarray. +*/ +int8_t stdlib_ndarray_x_5d( struct ndarray *arrays[], void *fcn ); + +/** +* Applies a nullary callback and assigns results to elements in a five-dimensional output ndarray. +*/ +int8_t stdlib_ndarray_x_5d_blocked( struct ndarray *arrays[], void *fcn ); + +/** +* Applies a nullary callback and assigns results to elements in a six-dimensional output ndarray. +*/ +int8_t stdlib_ndarray_x_6d( struct ndarray *arrays[], void *fcn ); + +/** +* Applies a nullary callback and assigns results to elements in a six-dimensional output ndarray. +*/ +int8_t stdlib_ndarray_x_6d_blocked( struct ndarray *arrays[], void *fcn ); + +/** +* Applies a nullary callback and assigns results to elements in a seven-dimensional output ndarray. +*/ +int8_t stdlib_ndarray_x_7d( struct ndarray *arrays[], void *fcn ); + +/** +* Applies a nullary callback and assigns results to elements in a seven-dimensional output ndarray. +*/ +int8_t stdlib_ndarray_x_7d_blocked( struct ndarray *arrays[], void *fcn ); + +/** +* Applies a nullary callback and assigns results to elements in an eight-dimensional output ndarray. +*/ +int8_t stdlib_ndarray_x_8d( struct ndarray *arrays[], void *fcn ); + +/** +* Applies a nullary callback and assigns results to elements in an eight-dimensional output ndarray. +*/ +int8_t stdlib_ndarray_x_8d_blocked( struct ndarray *arrays[], void *fcn ); + +/** +* Applies a nullary callback and assigns results to elements in a nine-dimensional output ndarray. +*/ +int8_t stdlib_ndarray_x_9d( struct ndarray *arrays[], void *fcn ); + +/** +* Applies a nullary callback and assigns results to elements in a nine-dimensional output ndarray. +*/ +int8_t stdlib_ndarray_x_9d_blocked( struct ndarray *arrays[], void *fcn ); + +/** +* Applies a nullary callback and assigns results to elements in a ten-dimensional output ndarray. +*/ +int8_t stdlib_ndarray_x_10d( struct ndarray *arrays[], void *fcn ); + +/** +* Applies a nullary callback and assigns results to elements in a ten-dimensional output ndarray. +*/ +int8_t stdlib_ndarray_x_10d_blocked( struct ndarray *arrays[], void *fcn ); + +/** +* Applies a nullary callback and assigns results to elements in an n-dimensional output ndarray. +*/ +int8_t stdlib_ndarray_x_nd( struct ndarray *arrays[], void *fcn ); + +#ifdef __cplusplus +} +#endif + +#endif // !STDLIB_NDARRAY_BASE_NULLARY_X_H diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/z.h b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/z.h index 7da5b60aaa47..08548b59d2f7 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/z.h +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/z.h @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/z_as_b.h b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/z_as_b.h index 1da9ff79dec7..eecd172767dc 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/z_as_b.h +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/z_as_b.h @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/z_as_c.h b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/z_as_c.h index 001298391c71..5a695b0e0a70 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/z_as_c.h +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/z_as_c.h @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/z_as_d.h b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/z_as_d.h index 71dd3881bf19..aaf94ba94b6b 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/z_as_d.h +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/z_as_d.h @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/z_as_f.h b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/z_as_f.h index 629fa71d64c1..6c64df7cd38e 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/z_as_f.h +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/z_as_f.h @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/z_as_i.h b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/z_as_i.h index 345436f13f8a..e8b668e3939c 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/z_as_i.h +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/z_as_i.h @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/z_as_k.h b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/z_as_k.h index 10636edc9028..57b70f9307f6 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/z_as_k.h +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/z_as_k.h @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/z_as_s.h b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/z_as_s.h index 64dd2e641c38..406d273d4db8 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/z_as_s.h +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/z_as_s.h @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/z_as_t.h b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/z_as_t.h index 15337934ded8..93f50cbddfa9 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/z_as_t.h +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/z_as_t.h @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/z_as_u.h b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/z_as_u.h index 3d03fe0df9c1..9ea9b8902919 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/z_as_u.h +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/include/stdlib/ndarray/base/nullary/z_as_u.h @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/manifest.json b/lib/node_modules/@stdlib/ndarray/base/nullary/manifest.json index 0e7e1a61c640..e3b1e2394189 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/manifest.json +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/manifest.json @@ -61,6 +61,7 @@ "./src/u.c", "./src/u_as_b.c", "./src/u_as_t.c", + "./src/x.c", "./src/z.c", "./src/z_as_b.c", "./src/z_as_c.c", diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/scripts/loops.js b/lib/node_modules/@stdlib/ndarray/base/nullary/scripts/loops.js index 2ae2b233ca03..8737540e8948 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/scripts/loops.js +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/scripts/loops.js @@ -3,7 +3,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -156,6 +156,9 @@ function callbackBody( ch1 ) { if ( isComplexChar( ch1 ) ) { return '// ...'; } + if ( ch1 === 'x' ) { + return 'return true;'; + } if ( ch1 === 'd' ) { return 'return 10.0;'; } @@ -473,6 +476,9 @@ function createSourceFile( signature ) { if ( /z/.test( signature ) ) { inc.push( '#include "stdlib/complex/float64/ctor.h"' ); } + if ( /x/.test( signature ) ) { + inc.push( '#include '); + } if ( inc.length ) { file = replace( file, '{{INCLUDES}}', '\n'+inc.join( '\n' ) ); } else { @@ -490,6 +496,9 @@ function createSourceFile( signature ) { if ( /z/.test( tmp ) ) { inc.push( '#include "stdlib/complex/float64/ctor.h"' ); } + if ( /x/.test( tmp ) ) { + inc.push( '#include '); + } if ( inc.length ) { file = replace( file, '{{EXAMPLE_INCLUDES}}', '\n* '+inc.join( '\n* ' ) ); } else { diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/scripts/templates/docs.txt b/lib/node_modules/@stdlib/ndarray/base/nullary/scripts/templates/docs.txt index a5242a81358c..6c01d3fa11f3 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/scripts/templates/docs.txt +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/scripts/templates/docs.txt @@ -1,4 +1,4 @@ -#### stdlib_ndarray_{{SIGNATURE}}( \*arrays[], \*fcn ) +#### stdlib_ndarray_{{SIGNATURE}}( \*arrays\[], \*fcn ) Applies a nullary callback and assigns results to elements in an output ndarray. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/src/b.c b/lib/node_modules/@stdlib/ndarray/base/nullary/src/b.c index 43b874e08b1e..5fefadf15545 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/src/b.c +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/src/b.c @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/src/c.c b/lib/node_modules/@stdlib/ndarray/base/nullary/src/c.c index f45e685244ad..7a6c15e08694 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/src/c.c +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/src/c.c @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/src/c_as_b.c b/lib/node_modules/@stdlib/ndarray/base/nullary/src/c_as_b.c index 18a451e47641..ceac1a12439e 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/src/c_as_b.c +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/src/c_as_b.c @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/src/c_as_f.c b/lib/node_modules/@stdlib/ndarray/base/nullary/src/c_as_f.c index f5eb782f1eb3..2d775ac12d6e 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/src/c_as_f.c +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/src/c_as_f.c @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/src/c_as_k.c b/lib/node_modules/@stdlib/ndarray/base/nullary/src/c_as_k.c index 3cc3f918242a..5356ef0a6927 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/src/c_as_k.c +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/src/c_as_k.c @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/src/c_as_s.c b/lib/node_modules/@stdlib/ndarray/base/nullary/src/c_as_s.c index bb0c51416a47..ab2a0bee9258 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/src/c_as_s.c +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/src/c_as_s.c @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/src/c_as_t.c b/lib/node_modules/@stdlib/ndarray/base/nullary/src/c_as_t.c index 995102a99a73..63b52d05a291 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/src/c_as_t.c +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/src/c_as_t.c @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/src/c_as_z.c b/lib/node_modules/@stdlib/ndarray/base/nullary/src/c_as_z.c index 02b61817796a..488f52a4a0e8 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/src/c_as_z.c +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/src/c_as_z.c @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/src/d.c b/lib/node_modules/@stdlib/ndarray/base/nullary/src/d.c index 00c0c82ad513..36e3f1d47283 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/src/d.c +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/src/d.c @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/src/d_as_b.c b/lib/node_modules/@stdlib/ndarray/base/nullary/src/d_as_b.c index 3bf3649b9ee9..c445bcdfc2c5 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/src/d_as_b.c +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/src/d_as_b.c @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/src/d_as_f.c b/lib/node_modules/@stdlib/ndarray/base/nullary/src/d_as_f.c index c6dc931fd984..ee05e0cc49bf 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/src/d_as_f.c +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/src/d_as_f.c @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/src/d_as_i.c b/lib/node_modules/@stdlib/ndarray/base/nullary/src/d_as_i.c index df4638b286f4..d1be0fe43a62 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/src/d_as_i.c +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/src/d_as_i.c @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/src/d_as_k.c b/lib/node_modules/@stdlib/ndarray/base/nullary/src/d_as_k.c index e07f41149cb4..4b55fbf372a7 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/src/d_as_k.c +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/src/d_as_k.c @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/src/d_as_s.c b/lib/node_modules/@stdlib/ndarray/base/nullary/src/d_as_s.c index ef2cbc9a523c..acf371f69542 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/src/d_as_s.c +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/src/d_as_s.c @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/src/d_as_t.c b/lib/node_modules/@stdlib/ndarray/base/nullary/src/d_as_t.c index e0417a8328c5..65d5b9604466 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/src/d_as_t.c +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/src/d_as_t.c @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/src/d_as_u.c b/lib/node_modules/@stdlib/ndarray/base/nullary/src/d_as_u.c index 2bd926523e4f..8c637d718131 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/src/d_as_u.c +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/src/d_as_u.c @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/src/f.c b/lib/node_modules/@stdlib/ndarray/base/nullary/src/f.c index 1bb5a384ec5d..e14ed786f47a 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/src/f.c +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/src/f.c @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/src/f_as_b.c b/lib/node_modules/@stdlib/ndarray/base/nullary/src/f_as_b.c index 7093fb273889..0002fbc5f5b0 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/src/f_as_b.c +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/src/f_as_b.c @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/src/f_as_d.c b/lib/node_modules/@stdlib/ndarray/base/nullary/src/f_as_d.c index ce28bab14abc..887bb5da1646 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/src/f_as_d.c +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/src/f_as_d.c @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/src/f_as_k.c b/lib/node_modules/@stdlib/ndarray/base/nullary/src/f_as_k.c index 981b2f9a9b39..d86c849c0521 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/src/f_as_k.c +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/src/f_as_k.c @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/src/f_as_s.c b/lib/node_modules/@stdlib/ndarray/base/nullary/src/f_as_s.c index d6427af4204d..06293d0b7b7e 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/src/f_as_s.c +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/src/f_as_s.c @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/src/f_as_t.c b/lib/node_modules/@stdlib/ndarray/base/nullary/src/f_as_t.c index 815bdccc6835..8047260975ee 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/src/f_as_t.c +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/src/f_as_t.c @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/src/i.c b/lib/node_modules/@stdlib/ndarray/base/nullary/src/i.c index 3652cbb7b7f4..3f8690f080ea 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/src/i.c +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/src/i.c @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/src/i_as_b.c b/lib/node_modules/@stdlib/ndarray/base/nullary/src/i_as_b.c index 45f3d6ba6d32..06c28b9c67a9 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/src/i_as_b.c +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/src/i_as_b.c @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/src/i_as_k.c b/lib/node_modules/@stdlib/ndarray/base/nullary/src/i_as_k.c index d6d68257ceea..8f19b2ab0f86 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/src/i_as_k.c +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/src/i_as_k.c @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/src/i_as_s.c b/lib/node_modules/@stdlib/ndarray/base/nullary/src/i_as_s.c index 6043a10ffc50..f518907d2ad0 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/src/i_as_s.c +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/src/i_as_s.c @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/src/i_as_t.c b/lib/node_modules/@stdlib/ndarray/base/nullary/src/i_as_t.c index d6d9d97315f2..667aade2b158 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/src/i_as_t.c +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/src/i_as_t.c @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/src/k.c b/lib/node_modules/@stdlib/ndarray/base/nullary/src/k.c index 2a682932f776..b37e22235f4c 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/src/k.c +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/src/k.c @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/src/k_as_b.c b/lib/node_modules/@stdlib/ndarray/base/nullary/src/k_as_b.c index d5e7943660dc..7fd8a2b4fd84 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/src/k_as_b.c +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/src/k_as_b.c @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/src/k_as_s.c b/lib/node_modules/@stdlib/ndarray/base/nullary/src/k_as_s.c index 06abf2f54b55..7ef4010eeba3 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/src/k_as_s.c +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/src/k_as_s.c @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/src/s.c b/lib/node_modules/@stdlib/ndarray/base/nullary/src/s.c index bbbbe0e1b40f..04a203877d41 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/src/s.c +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/src/s.c @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/src/t.c b/lib/node_modules/@stdlib/ndarray/base/nullary/src/t.c index 790ec8520095..29cbd2f24a70 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/src/t.c +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/src/t.c @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/src/t_as_b.c b/lib/node_modules/@stdlib/ndarray/base/nullary/src/t_as_b.c index 106eee8675e9..bb41b8da7106 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/src/t_as_b.c +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/src/t_as_b.c @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/src/u.c b/lib/node_modules/@stdlib/ndarray/base/nullary/src/u.c index be085c98cf95..1f99a75b40cf 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/src/u.c +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/src/u.c @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/src/u_as_b.c b/lib/node_modules/@stdlib/ndarray/base/nullary/src/u_as_b.c index 61734b87a00c..033aeae05614 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/src/u_as_b.c +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/src/u_as_b.c @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/src/u_as_t.c b/lib/node_modules/@stdlib/ndarray/base/nullary/src/u_as_t.c index 5fc3c3bc495d..88b79971ee5d 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/src/u_as_t.c +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/src/u_as_t.c @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/src/x.c b/lib/node_modules/@stdlib/ndarray/base/nullary/src/x.c new file mode 100644 index 000000000000..8dad4ca28ca8 --- /dev/null +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/src/x.c @@ -0,0 +1,1922 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* 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. +*/ + +/* +* The following is auto-generated. Do not manually edit. See scripts/loops.js. +*/ + +#include "stdlib/ndarray/base/nullary/x.h" +#include "stdlib/ndarray/base/nullary/typedefs.h" +#include "stdlib/ndarray/base/nullary/macros.h" +#include "stdlib/ndarray/base/nullary/dispatch_object.h" +#include "stdlib/ndarray/base/nullary/dispatch.h" +#include "stdlib/ndarray/ctor.h" +#include +#include + +/** +* Applies a nullary callback and assigns results to elements in a zero-dimensional output ndarray. +* +* ## Notes +* +* - If successful, the functions returns `0`; otherwise, the function returns an error code. +* +* @param arrays array whose only element is a pointer to an output array +* @param fcn callback +* @return status code +* +* @example +* #include "stdlib/ndarray/base/nullary/x.h" +* #include "stdlib/ndarray/dtypes.h" +* #include "stdlib/ndarray/index_modes.h" +* #include "stdlib/ndarray/orders.h" +* #include "stdlib/ndarray/ctor.h" +* #include +* #include +* #include +* #include +* +* // Define the ndarray data type: +* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_BOOL; +* +* // Create an underlying byte array: +* uint8_t xbuf[] = { 0 }; +* +* // Define the number of dimensions: +* int64_t ndims = 0; +* +* // Define the array shape: +* int64_t shape[] = {}; +* +* // Define the strides: +* int64_t sx[] = { 0 }; +* +* // Define the index offset: +* int64_t ox = 0; +* +* // Define the array order: +* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; +* +* // Specify the index mode: +* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; +* +* // Specify the subscript index modes: +* int8_t submodes[] = { imode }; +* int64_t nsubmodes = 1; +* +* // Create an output ndarray: +* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shape, sx, ox, order, imode, nsubmodes, submodes ); +* if ( x == NULL ) { +* fprintf( stderr, "Error allocating memory.\n" ); +* exit( EXIT_FAILURE ); +* } +* +* // Create an array containing a pointer to the ndarray: +* struct ndarray *arrays[] = { x }; +* +* // Define a callback: +* static bool fcn( void ) { +* return true; +* } +* +* // Apply the callback: +* int8_t status = stdlib_ndarray_x_0d( arrays, (void *)fcn ); +* if ( status != 0 ) { +* fprintf( stderr, "Error during computation.\n" ); +* exit( EXIT_FAILURE ); +* } +* +* // ... +* +* // Free allocated memory: +* stdlib_ndarray_free( x ); +*/ +int8_t stdlib_ndarray_x_0d( struct ndarray *arrays[], void *fcn ) { + typedef bool func_type( void ); + func_type *f = (func_type *)fcn; + int8_t status = stdlib_ndarray_iset_bool( arrays[ 0 ], 0, f() ); + if ( status != 0 ) { + return -1; + } + return 0; +} + +/** +* Applies a nullary callback and assigns results to elements in a one-dimensional output ndarray. +* +* ## Notes +* +* - If successful, the functions returns `0`; otherwise, the function returns an error code. +* +* @param arrays array whose only element is a pointer to an output array +* @param fcn callback +* @return status code +* +* @example +* #include "stdlib/ndarray/base/nullary/x.h" +* #include "stdlib/ndarray/dtypes.h" +* #include "stdlib/ndarray/index_modes.h" +* #include "stdlib/ndarray/orders.h" +* #include "stdlib/ndarray/ctor.h" +* #include +* #include +* #include +* #include +* +* // Define the ndarray data type: +* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_BOOL; +* +* // Create an underlying byte array: +* uint8_t xbuf[] = { 0, 0, 0 }; +* +* // Define the number of dimensions: +* int64_t ndims = 1; +* +* // Define the array shape: +* int64_t shape[] = { 3 }; +* +* // Define the strides: +* int64_t sx[] = { 1 }; +* +* // Define the index offset: +* int64_t ox = 0; +* +* // Define the array order: +* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; +* +* // Specify the index mode: +* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; +* +* // Specify the subscript index modes: +* int8_t submodes[] = { imode }; +* int64_t nsubmodes = 1; +* +* // Create an output ndarray: +* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shape, sx, ox, order, imode, nsubmodes, submodes ); +* if ( x == NULL ) { +* fprintf( stderr, "Error allocating memory.\n" ); +* exit( EXIT_FAILURE ); +* } +* +* // Create an array containing a pointer to the ndarray: +* struct ndarray *arrays[] = { x }; +* +* // Define a callback: +* static bool fcn( void ) { +* return true; +* } +* +* // Apply the callback: +* int8_t status = stdlib_ndarray_x_1d( arrays, (void *)fcn ); +* if ( status != 0 ) { +* fprintf( stderr, "Error during computation.\n" ); +* exit( EXIT_FAILURE ); +* } +* +* // ... +* +* // Free allocated memory: +* stdlib_ndarray_free( x ); +*/ +int8_t stdlib_ndarray_x_1d( struct ndarray *arrays[], void *fcn ) { + typedef bool func_type( void ); + func_type *f = (func_type *)fcn; + STDLIB_NDARRAY_NULLARY_1D_LOOP_CLBK( bool ) + return 0; +} + +/** +* Applies a nullary callback and assigns results to elements in a two-dimensional output ndarray. +* +* ## Notes +* +* - If successful, the functions returns `0`; otherwise, the function returns an error code. +* +* @param arrays array whose only element is a pointer to an output array +* @param fcn callback +* @return status code +* +* @example +* #include "stdlib/ndarray/base/nullary/x.h" +* #include "stdlib/ndarray/dtypes.h" +* #include "stdlib/ndarray/index_modes.h" +* #include "stdlib/ndarray/orders.h" +* #include "stdlib/ndarray/ctor.h" +* #include +* #include +* #include +* #include +* +* // Define the ndarray data type: +* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_BOOL; +* +* // Create an underlying byte array: +* uint8_t xbuf[] = { 0, 0, 0, 0 }; +* +* // Define the number of dimensions: +* int64_t ndims = 2; +* +* // Define the array shape: +* int64_t shape[] = { 2, 2 }; +* +* // Define the strides: +* int64_t sx[] = { 2, 1 }; +* +* // Define the index offset: +* int64_t ox = 0; +* +* // Define the array order: +* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; +* +* // Specify the index mode: +* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; +* +* // Specify the subscript index modes: +* int8_t submodes[] = { imode }; +* int64_t nsubmodes = 1; +* +* // Create an output ndarray: +* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shape, sx, ox, order, imode, nsubmodes, submodes ); +* if ( x == NULL ) { +* fprintf( stderr, "Error allocating memory.\n" ); +* exit( EXIT_FAILURE ); +* } +* +* // Create an array containing a pointer to the ndarray: +* struct ndarray *arrays[] = { x }; +* +* // Define a callback: +* static bool fcn( void ) { +* return true; +* } +* +* // Apply the callback: +* int8_t status = stdlib_ndarray_x_2d( arrays, (void *)fcn ); +* if ( status != 0 ) { +* fprintf( stderr, "Error during computation.\n" ); +* exit( EXIT_FAILURE ); +* } +* +* // ... +* +* // Free allocated memory: +* stdlib_ndarray_free( x ); +*/ +int8_t stdlib_ndarray_x_2d( struct ndarray *arrays[], void *fcn ) { + typedef bool func_type( void ); + func_type *f = (func_type *)fcn; + STDLIB_NDARRAY_NULLARY_2D_LOOP_CLBK( bool ) + return 0; +} + +/** +* Applies a nullary callback and assigns results to elements in a two-dimensional output ndarray. +* +* ## Notes +* +* - If successful, the functions returns `0`; otherwise, the function returns an error code. +* +* @param arrays array whose only element is a pointer to an output array +* @param fcn callback +* @return status code +* +* @example +* #include "stdlib/ndarray/base/nullary/x.h" +* #include "stdlib/ndarray/dtypes.h" +* #include "stdlib/ndarray/index_modes.h" +* #include "stdlib/ndarray/orders.h" +* #include "stdlib/ndarray/ctor.h" +* #include +* #include +* #include +* #include +* +* // Define the ndarray data type: +* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_BOOL; +* +* // Create an underlying byte array: +* uint8_t xbuf[] = { 0, 0, 0, 0 }; +* +* // Define the number of dimensions: +* int64_t ndims = 2; +* +* // Define the array shape: +* int64_t shape[] = { 2, 2 }; +* +* // Define the strides: +* int64_t sx[] = { 2, 1 }; +* +* // Define the index offset: +* int64_t ox = 0; +* +* // Define the array order: +* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; +* +* // Specify the index mode: +* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; +* +* // Specify the subscript index modes: +* int8_t submodes[] = { imode }; +* int64_t nsubmodes = 1; +* +* // Create an output ndarray: +* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shape, sx, ox, order, imode, nsubmodes, submodes ); +* if ( x == NULL ) { +* fprintf( stderr, "Error allocating memory.\n" ); +* exit( EXIT_FAILURE ); +* } +* +* // Create an array containing a pointer to the ndarray: +* struct ndarray *arrays[] = { x }; +* +* // Define a callback: +* static bool fcn( void ) { +* return true; +* } +* +* // Apply the callback: +* int8_t status = stdlib_ndarray_x_2d_blocked( arrays, (void *)fcn ); +* if ( status != 0 ) { +* fprintf( stderr, "Error during computation.\n" ); +* exit( EXIT_FAILURE ); +* } +* +* // ... +* +* // Free allocated memory: +* stdlib_ndarray_free( x ); +*/ +int8_t stdlib_ndarray_x_2d_blocked( struct ndarray *arrays[], void *fcn ) { + typedef bool func_type( void ); + func_type *f = (func_type *)fcn; + STDLIB_NDARRAY_NULLARY_2D_BLOCKED_LOOP_CLBK( bool ) + return 0; +} + +/** +* Applies a nullary callback and assigns results to elements in a three-dimensional output ndarray. +* +* ## Notes +* +* - If successful, the functions returns `0`; otherwise, the function returns an error code. +* +* @param arrays array whose only element is a pointer to an output array +* @param fcn callback +* @return status code +* +* @example +* #include "stdlib/ndarray/base/nullary/x.h" +* #include "stdlib/ndarray/dtypes.h" +* #include "stdlib/ndarray/index_modes.h" +* #include "stdlib/ndarray/orders.h" +* #include "stdlib/ndarray/ctor.h" +* #include +* #include +* #include +* #include +* +* // Define the ndarray data type: +* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_BOOL; +* +* // Create an underlying byte array: +* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; +* +* // Define the number of dimensions: +* int64_t ndims = 3; +* +* // Define the array shape: +* int64_t shape[] = { 2, 2, 2 }; +* +* // Define the strides: +* int64_t sx[] = { 4, 2, 1 }; +* +* // Define the index offset: +* int64_t ox = 0; +* +* // Define the array order: +* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; +* +* // Specify the index mode: +* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; +* +* // Specify the subscript index modes: +* int8_t submodes[] = { imode }; +* int64_t nsubmodes = 1; +* +* // Create an output ndarray: +* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shape, sx, ox, order, imode, nsubmodes, submodes ); +* if ( x == NULL ) { +* fprintf( stderr, "Error allocating memory.\n" ); +* exit( EXIT_FAILURE ); +* } +* +* // Create an array containing a pointer to the ndarray: +* struct ndarray *arrays[] = { x }; +* +* // Define a callback: +* static bool fcn( void ) { +* return true; +* } +* +* // Apply the callback: +* int8_t status = stdlib_ndarray_x_3d( arrays, (void *)fcn ); +* if ( status != 0 ) { +* fprintf( stderr, "Error during computation.\n" ); +* exit( EXIT_FAILURE ); +* } +* +* // ... +* +* // Free allocated memory: +* stdlib_ndarray_free( x ); +*/ +int8_t stdlib_ndarray_x_3d( struct ndarray *arrays[], void *fcn ) { + typedef bool func_type( void ); + func_type *f = (func_type *)fcn; + STDLIB_NDARRAY_NULLARY_3D_LOOP_CLBK( bool ) + return 0; +} + +/** +* Applies a nullary callback and assigns results to elements in a three-dimensional output ndarray. +* +* ## Notes +* +* - If successful, the functions returns `0`; otherwise, the function returns an error code. +* +* @param arrays array whose only element is a pointer to an output array +* @param fcn callback +* @return status code +* +* @example +* #include "stdlib/ndarray/base/nullary/x.h" +* #include "stdlib/ndarray/dtypes.h" +* #include "stdlib/ndarray/index_modes.h" +* #include "stdlib/ndarray/orders.h" +* #include "stdlib/ndarray/ctor.h" +* #include +* #include +* #include +* #include +* +* // Define the ndarray data type: +* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_BOOL; +* +* // Create an underlying byte array: +* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; +* +* // Define the number of dimensions: +* int64_t ndims = 3; +* +* // Define the array shape: +* int64_t shape[] = { 2, 2, 2 }; +* +* // Define the strides: +* int64_t sx[] = { 4, 2, 1 }; +* +* // Define the index offset: +* int64_t ox = 0; +* +* // Define the array order: +* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; +* +* // Specify the index mode: +* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; +* +* // Specify the subscript index modes: +* int8_t submodes[] = { imode }; +* int64_t nsubmodes = 1; +* +* // Create an output ndarray: +* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shape, sx, ox, order, imode, nsubmodes, submodes ); +* if ( x == NULL ) { +* fprintf( stderr, "Error allocating memory.\n" ); +* exit( EXIT_FAILURE ); +* } +* +* // Create an array containing a pointer to the ndarray: +* struct ndarray *arrays[] = { x }; +* +* // Define a callback: +* static bool fcn( void ) { +* return true; +* } +* +* // Apply the callback: +* int8_t status = stdlib_ndarray_x_3d_blocked( arrays, (void *)fcn ); +* if ( status != 0 ) { +* fprintf( stderr, "Error during computation.\n" ); +* exit( EXIT_FAILURE ); +* } +* +* // ... +* +* // Free allocated memory: +* stdlib_ndarray_free( x ); +*/ +int8_t stdlib_ndarray_x_3d_blocked( struct ndarray *arrays[], void *fcn ) { + typedef bool func_type( void ); + func_type *f = (func_type *)fcn; + STDLIB_NDARRAY_NULLARY_3D_BLOCKED_LOOP_CLBK( bool ) + return 0; +} + +/** +* Applies a nullary callback and assigns results to elements in a four-dimensional output ndarray. +* +* ## Notes +* +* - If successful, the functions returns `0`; otherwise, the function returns an error code. +* +* @param arrays array whose only element is a pointer to an output array +* @param fcn callback +* @return status code +* +* @example +* #include "stdlib/ndarray/base/nullary/x.h" +* #include "stdlib/ndarray/dtypes.h" +* #include "stdlib/ndarray/index_modes.h" +* #include "stdlib/ndarray/orders.h" +* #include "stdlib/ndarray/ctor.h" +* #include +* #include +* #include +* #include +* +* // Define the ndarray data type: +* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_BOOL; +* +* // Create an underlying byte array: +* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; +* +* // Define the number of dimensions: +* int64_t ndims = 4; +* +* // Define the array shape: +* int64_t shape[] = { 1, 2, 2, 2 }; +* +* // Define the strides: +* int64_t sx[] = { 8, 4, 2, 1 }; +* +* // Define the index offset: +* int64_t ox = 0; +* +* // Define the array order: +* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; +* +* // Specify the index mode: +* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; +* +* // Specify the subscript index modes: +* int8_t submodes[] = { imode }; +* int64_t nsubmodes = 1; +* +* // Create an output ndarray: +* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shape, sx, ox, order, imode, nsubmodes, submodes ); +* if ( x == NULL ) { +* fprintf( stderr, "Error allocating memory.\n" ); +* exit( EXIT_FAILURE ); +* } +* +* // Create an array containing a pointer to the ndarray: +* struct ndarray *arrays[] = { x }; +* +* // Define a callback: +* static bool fcn( void ) { +* return true; +* } +* +* // Apply the callback: +* int8_t status = stdlib_ndarray_x_4d( arrays, (void *)fcn ); +* if ( status != 0 ) { +* fprintf( stderr, "Error during computation.\n" ); +* exit( EXIT_FAILURE ); +* } +* +* // ... +* +* // Free allocated memory: +* stdlib_ndarray_free( x ); +*/ +int8_t stdlib_ndarray_x_4d( struct ndarray *arrays[], void *fcn ) { + typedef bool func_type( void ); + func_type *f = (func_type *)fcn; + STDLIB_NDARRAY_NULLARY_4D_LOOP_CLBK( bool ) + return 0; +} + +/** +* Applies a nullary callback and assigns results to elements in a four-dimensional output ndarray. +* +* ## Notes +* +* - If successful, the functions returns `0`; otherwise, the function returns an error code. +* +* @param arrays array whose only element is a pointer to an output array +* @param fcn callback +* @return status code +* +* @example +* #include "stdlib/ndarray/base/nullary/x.h" +* #include "stdlib/ndarray/dtypes.h" +* #include "stdlib/ndarray/index_modes.h" +* #include "stdlib/ndarray/orders.h" +* #include "stdlib/ndarray/ctor.h" +* #include +* #include +* #include +* #include +* +* // Define the ndarray data type: +* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_BOOL; +* +* // Create an underlying byte array: +* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; +* +* // Define the number of dimensions: +* int64_t ndims = 4; +* +* // Define the array shape: +* int64_t shape[] = { 1, 2, 2, 2 }; +* +* // Define the strides: +* int64_t sx[] = { 8, 4, 2, 1 }; +* +* // Define the index offset: +* int64_t ox = 0; +* +* // Define the array order: +* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; +* +* // Specify the index mode: +* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; +* +* // Specify the subscript index modes: +* int8_t submodes[] = { imode }; +* int64_t nsubmodes = 1; +* +* // Create an output ndarray: +* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shape, sx, ox, order, imode, nsubmodes, submodes ); +* if ( x == NULL ) { +* fprintf( stderr, "Error allocating memory.\n" ); +* exit( EXIT_FAILURE ); +* } +* +* // Create an array containing a pointer to the ndarray: +* struct ndarray *arrays[] = { x }; +* +* // Define a callback: +* static bool fcn( void ) { +* return true; +* } +* +* // Apply the callback: +* int8_t status = stdlib_ndarray_x_4d_blocked( arrays, (void *)fcn ); +* if ( status != 0 ) { +* fprintf( stderr, "Error during computation.\n" ); +* exit( EXIT_FAILURE ); +* } +* +* // ... +* +* // Free allocated memory: +* stdlib_ndarray_free( x ); +*/ +int8_t stdlib_ndarray_x_4d_blocked( struct ndarray *arrays[], void *fcn ) { + typedef bool func_type( void ); + func_type *f = (func_type *)fcn; + STDLIB_NDARRAY_NULLARY_4D_BLOCKED_LOOP_CLBK( bool ) + return 0; +} + +/** +* Applies a nullary callback and assigns results to elements in a five-dimensional output ndarray. +* +* ## Notes +* +* - If successful, the functions returns `0`; otherwise, the function returns an error code. +* +* @param arrays array whose only element is a pointer to an output array +* @param fcn callback +* @return status code +* +* @example +* #include "stdlib/ndarray/base/nullary/x.h" +* #include "stdlib/ndarray/dtypes.h" +* #include "stdlib/ndarray/index_modes.h" +* #include "stdlib/ndarray/orders.h" +* #include "stdlib/ndarray/ctor.h" +* #include +* #include +* #include +* #include +* +* // Define the ndarray data type: +* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_BOOL; +* +* // Create an underlying byte array: +* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; +* +* // Define the number of dimensions: +* int64_t ndims = 5; +* +* // Define the array shape: +* int64_t shape[] = { 1, 1, 2, 2, 2 }; +* +* // Define the strides: +* int64_t sx[] = { 8, 8, 4, 2, 1 }; +* +* // Define the index offset: +* int64_t ox = 0; +* +* // Define the array order: +* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; +* +* // Specify the index mode: +* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; +* +* // Specify the subscript index modes: +* int8_t submodes[] = { imode }; +* int64_t nsubmodes = 1; +* +* // Create an output ndarray: +* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shape, sx, ox, order, imode, nsubmodes, submodes ); +* if ( x == NULL ) { +* fprintf( stderr, "Error allocating memory.\n" ); +* exit( EXIT_FAILURE ); +* } +* +* // Create an array containing a pointer to the ndarray: +* struct ndarray *arrays[] = { x }; +* +* // Define a callback: +* static bool fcn( void ) { +* return true; +* } +* +* // Apply the callback: +* int8_t status = stdlib_ndarray_x_5d( arrays, (void *)fcn ); +* if ( status != 0 ) { +* fprintf( stderr, "Error during computation.\n" ); +* exit( EXIT_FAILURE ); +* } +* +* // ... +* +* // Free allocated memory: +* stdlib_ndarray_free( x ); +*/ +int8_t stdlib_ndarray_x_5d( struct ndarray *arrays[], void *fcn ) { + typedef bool func_type( void ); + func_type *f = (func_type *)fcn; + STDLIB_NDARRAY_NULLARY_5D_LOOP_CLBK( bool ) + return 0; +} + +/** +* Applies a nullary callback and assigns results to elements in a five-dimensional output ndarray. +* +* ## Notes +* +* - If successful, the functions returns `0`; otherwise, the function returns an error code. +* +* @param arrays array whose only element is a pointer to an output array +* @param fcn callback +* @return status code +* +* @example +* #include "stdlib/ndarray/base/nullary/x.h" +* #include "stdlib/ndarray/dtypes.h" +* #include "stdlib/ndarray/index_modes.h" +* #include "stdlib/ndarray/orders.h" +* #include "stdlib/ndarray/ctor.h" +* #include +* #include +* #include +* #include +* +* // Define the ndarray data type: +* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_BOOL; +* +* // Create an underlying byte array: +* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; +* +* // Define the number of dimensions: +* int64_t ndims = 5; +* +* // Define the array shape: +* int64_t shape[] = { 1, 1, 2, 2, 2 }; +* +* // Define the strides: +* int64_t sx[] = { 8, 8, 4, 2, 1 }; +* +* // Define the index offset: +* int64_t ox = 0; +* +* // Define the array order: +* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; +* +* // Specify the index mode: +* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; +* +* // Specify the subscript index modes: +* int8_t submodes[] = { imode }; +* int64_t nsubmodes = 1; +* +* // Create an output ndarray: +* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shape, sx, ox, order, imode, nsubmodes, submodes ); +* if ( x == NULL ) { +* fprintf( stderr, "Error allocating memory.\n" ); +* exit( EXIT_FAILURE ); +* } +* +* // Create an array containing a pointer to the ndarray: +* struct ndarray *arrays[] = { x }; +* +* // Define a callback: +* static bool fcn( void ) { +* return true; +* } +* +* // Apply the callback: +* int8_t status = stdlib_ndarray_x_5d_blocked( arrays, (void *)fcn ); +* if ( status != 0 ) { +* fprintf( stderr, "Error during computation.\n" ); +* exit( EXIT_FAILURE ); +* } +* +* // ... +* +* // Free allocated memory: +* stdlib_ndarray_free( x ); +*/ +int8_t stdlib_ndarray_x_5d_blocked( struct ndarray *arrays[], void *fcn ) { + typedef bool func_type( void ); + func_type *f = (func_type *)fcn; + STDLIB_NDARRAY_NULLARY_5D_BLOCKED_LOOP_CLBK( bool ) + return 0; +} + +/** +* Applies a nullary callback and assigns results to elements in a six-dimensional output ndarray. +* +* ## Notes +* +* - If successful, the functions returns `0`; otherwise, the function returns an error code. +* +* @param arrays array whose only element is a pointer to an output array +* @param fcn callback +* @return status code +* +* @example +* #include "stdlib/ndarray/base/nullary/x.h" +* #include "stdlib/ndarray/dtypes.h" +* #include "stdlib/ndarray/index_modes.h" +* #include "stdlib/ndarray/orders.h" +* #include "stdlib/ndarray/ctor.h" +* #include +* #include +* #include +* #include +* +* // Define the ndarray data type: +* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_BOOL; +* +* // Create an underlying byte array: +* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; +* +* // Define the number of dimensions: +* int64_t ndims = 6; +* +* // Define the array shape: +* int64_t shape[] = { 1, 1, 1, 2, 2, 2 }; +* +* // Define the strides: +* int64_t sx[] = { 8, 8, 8, 4, 2, 1 }; +* +* // Define the index offset: +* int64_t ox = 0; +* +* // Define the array order: +* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; +* +* // Specify the index mode: +* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; +* +* // Specify the subscript index modes: +* int8_t submodes[] = { imode }; +* int64_t nsubmodes = 1; +* +* // Create an output ndarray: +* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shape, sx, ox, order, imode, nsubmodes, submodes ); +* if ( x == NULL ) { +* fprintf( stderr, "Error allocating memory.\n" ); +* exit( EXIT_FAILURE ); +* } +* +* // Create an array containing a pointer to the ndarray: +* struct ndarray *arrays[] = { x }; +* +* // Define a callback: +* static bool fcn( void ) { +* return true; +* } +* +* // Apply the callback: +* int8_t status = stdlib_ndarray_x_6d( arrays, (void *)fcn ); +* if ( status != 0 ) { +* fprintf( stderr, "Error during computation.\n" ); +* exit( EXIT_FAILURE ); +* } +* +* // ... +* +* // Free allocated memory: +* stdlib_ndarray_free( x ); +*/ +int8_t stdlib_ndarray_x_6d( struct ndarray *arrays[], void *fcn ) { + typedef bool func_type( void ); + func_type *f = (func_type *)fcn; + STDLIB_NDARRAY_NULLARY_6D_LOOP_CLBK( bool ) + return 0; +} + +/** +* Applies a nullary callback and assigns results to elements in a six-dimensional output ndarray. +* +* ## Notes +* +* - If successful, the functions returns `0`; otherwise, the function returns an error code. +* +* @param arrays array whose only element is a pointer to an output array +* @param fcn callback +* @return status code +* +* @example +* #include "stdlib/ndarray/base/nullary/x.h" +* #include "stdlib/ndarray/dtypes.h" +* #include "stdlib/ndarray/index_modes.h" +* #include "stdlib/ndarray/orders.h" +* #include "stdlib/ndarray/ctor.h" +* #include +* #include +* #include +* #include +* +* // Define the ndarray data type: +* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_BOOL; +* +* // Create an underlying byte array: +* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; +* +* // Define the number of dimensions: +* int64_t ndims = 6; +* +* // Define the array shape: +* int64_t shape[] = { 1, 1, 1, 2, 2, 2 }; +* +* // Define the strides: +* int64_t sx[] = { 8, 8, 8, 4, 2, 1 }; +* +* // Define the index offset: +* int64_t ox = 0; +* +* // Define the array order: +* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; +* +* // Specify the index mode: +* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; +* +* // Specify the subscript index modes: +* int8_t submodes[] = { imode }; +* int64_t nsubmodes = 1; +* +* // Create an output ndarray: +* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shape, sx, ox, order, imode, nsubmodes, submodes ); +* if ( x == NULL ) { +* fprintf( stderr, "Error allocating memory.\n" ); +* exit( EXIT_FAILURE ); +* } +* +* // Create an array containing a pointer to the ndarray: +* struct ndarray *arrays[] = { x }; +* +* // Define a callback: +* static bool fcn( void ) { +* return true; +* } +* +* // Apply the callback: +* int8_t status = stdlib_ndarray_x_6d_blocked( arrays, (void *)fcn ); +* if ( status != 0 ) { +* fprintf( stderr, "Error during computation.\n" ); +* exit( EXIT_FAILURE ); +* } +* +* // ... +* +* // Free allocated memory: +* stdlib_ndarray_free( x ); +*/ +int8_t stdlib_ndarray_x_6d_blocked( struct ndarray *arrays[], void *fcn ) { + typedef bool func_type( void ); + func_type *f = (func_type *)fcn; + STDLIB_NDARRAY_NULLARY_6D_BLOCKED_LOOP_CLBK( bool ) + return 0; +} + +/** +* Applies a nullary callback and assigns results to elements in a seven-dimensional output ndarray. +* +* ## Notes +* +* - If successful, the functions returns `0`; otherwise, the function returns an error code. +* +* @param arrays array whose only element is a pointer to an output array +* @param fcn callback +* @return status code +* +* @example +* #include "stdlib/ndarray/base/nullary/x.h" +* #include "stdlib/ndarray/dtypes.h" +* #include "stdlib/ndarray/index_modes.h" +* #include "stdlib/ndarray/orders.h" +* #include "stdlib/ndarray/ctor.h" +* #include +* #include +* #include +* #include +* +* // Define the ndarray data type: +* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_BOOL; +* +* // Create an underlying byte array: +* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; +* +* // Define the number of dimensions: +* int64_t ndims = 7; +* +* // Define the array shape: +* int64_t shape[] = { 1, 1, 1, 1, 2, 2, 2 }; +* +* // Define the strides: +* int64_t sx[] = { 8, 8, 8, 8, 4, 2, 1 }; +* +* // Define the index offset: +* int64_t ox = 0; +* +* // Define the array order: +* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; +* +* // Specify the index mode: +* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; +* +* // Specify the subscript index modes: +* int8_t submodes[] = { imode }; +* int64_t nsubmodes = 1; +* +* // Create an output ndarray: +* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shape, sx, ox, order, imode, nsubmodes, submodes ); +* if ( x == NULL ) { +* fprintf( stderr, "Error allocating memory.\n" ); +* exit( EXIT_FAILURE ); +* } +* +* // Create an array containing a pointer to the ndarray: +* struct ndarray *arrays[] = { x }; +* +* // Define a callback: +* static bool fcn( void ) { +* return true; +* } +* +* // Apply the callback: +* int8_t status = stdlib_ndarray_x_7d( arrays, (void *)fcn ); +* if ( status != 0 ) { +* fprintf( stderr, "Error during computation.\n" ); +* exit( EXIT_FAILURE ); +* } +* +* // ... +* +* // Free allocated memory: +* stdlib_ndarray_free( x ); +*/ +int8_t stdlib_ndarray_x_7d( struct ndarray *arrays[], void *fcn ) { + typedef bool func_type( void ); + func_type *f = (func_type *)fcn; + STDLIB_NDARRAY_NULLARY_7D_LOOP_CLBK( bool ) + return 0; +} + +/** +* Applies a nullary callback and assigns results to elements in a seven-dimensional output ndarray. +* +* ## Notes +* +* - If successful, the functions returns `0`; otherwise, the function returns an error code. +* +* @param arrays array whose only element is a pointer to an output array +* @param fcn callback +* @return status code +* +* @example +* #include "stdlib/ndarray/base/nullary/x.h" +* #include "stdlib/ndarray/dtypes.h" +* #include "stdlib/ndarray/index_modes.h" +* #include "stdlib/ndarray/orders.h" +* #include "stdlib/ndarray/ctor.h" +* #include +* #include +* #include +* #include +* +* // Define the ndarray data type: +* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_BOOL; +* +* // Create an underlying byte array: +* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; +* +* // Define the number of dimensions: +* int64_t ndims = 7; +* +* // Define the array shape: +* int64_t shape[] = { 1, 1, 1, 1, 2, 2, 2 }; +* +* // Define the strides: +* int64_t sx[] = { 8, 8, 8, 8, 4, 2, 1 }; +* +* // Define the index offset: +* int64_t ox = 0; +* +* // Define the array order: +* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; +* +* // Specify the index mode: +* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; +* +* // Specify the subscript index modes: +* int8_t submodes[] = { imode }; +* int64_t nsubmodes = 1; +* +* // Create an output ndarray: +* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shape, sx, ox, order, imode, nsubmodes, submodes ); +* if ( x == NULL ) { +* fprintf( stderr, "Error allocating memory.\n" ); +* exit( EXIT_FAILURE ); +* } +* +* // Create an array containing a pointer to the ndarray: +* struct ndarray *arrays[] = { x }; +* +* // Define a callback: +* static bool fcn( void ) { +* return true; +* } +* +* // Apply the callback: +* int8_t status = stdlib_ndarray_x_7d_blocked( arrays, (void *)fcn ); +* if ( status != 0 ) { +* fprintf( stderr, "Error during computation.\n" ); +* exit( EXIT_FAILURE ); +* } +* +* // ... +* +* // Free allocated memory: +* stdlib_ndarray_free( x ); +*/ +int8_t stdlib_ndarray_x_7d_blocked( struct ndarray *arrays[], void *fcn ) { + typedef bool func_type( void ); + func_type *f = (func_type *)fcn; + STDLIB_NDARRAY_NULLARY_7D_BLOCKED_LOOP_CLBK( bool ) + return 0; +} + +/** +* Applies a nullary callback and assigns results to elements in an eight-dimensional output ndarray. +* +* ## Notes +* +* - If successful, the functions returns `0`; otherwise, the function returns an error code. +* +* @param arrays array whose only element is a pointer to an output array +* @param fcn callback +* @return status code +* +* @example +* #include "stdlib/ndarray/base/nullary/x.h" +* #include "stdlib/ndarray/dtypes.h" +* #include "stdlib/ndarray/index_modes.h" +* #include "stdlib/ndarray/orders.h" +* #include "stdlib/ndarray/ctor.h" +* #include +* #include +* #include +* #include +* +* // Define the ndarray data type: +* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_BOOL; +* +* // Create an underlying byte array: +* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; +* +* // Define the number of dimensions: +* int64_t ndims = 8; +* +* // Define the array shape: +* int64_t shape[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; +* +* // Define the strides: +* int64_t sx[] = { 8, 8, 8, 8, 8, 4, 2, 1 }; +* +* // Define the index offset: +* int64_t ox = 0; +* +* // Define the array order: +* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; +* +* // Specify the index mode: +* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; +* +* // Specify the subscript index modes: +* int8_t submodes[] = { imode }; +* int64_t nsubmodes = 1; +* +* // Create an output ndarray: +* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shape, sx, ox, order, imode, nsubmodes, submodes ); +* if ( x == NULL ) { +* fprintf( stderr, "Error allocating memory.\n" ); +* exit( EXIT_FAILURE ); +* } +* +* // Create an array containing a pointer to the ndarray: +* struct ndarray *arrays[] = { x }; +* +* // Define a callback: +* static bool fcn( void ) { +* return true; +* } +* +* // Apply the callback: +* int8_t status = stdlib_ndarray_x_8d( arrays, (void *)fcn ); +* if ( status != 0 ) { +* fprintf( stderr, "Error during computation.\n" ); +* exit( EXIT_FAILURE ); +* } +* +* // ... +* +* // Free allocated memory: +* stdlib_ndarray_free( x ); +*/ +int8_t stdlib_ndarray_x_8d( struct ndarray *arrays[], void *fcn ) { + typedef bool func_type( void ); + func_type *f = (func_type *)fcn; + STDLIB_NDARRAY_NULLARY_8D_LOOP_CLBK( bool ) + return 0; +} + +/** +* Applies a nullary callback and assigns results to elements in an eight-dimensional output ndarray. +* +* ## Notes +* +* - If successful, the functions returns `0`; otherwise, the function returns an error code. +* +* @param arrays array whose only element is a pointer to an output array +* @param fcn callback +* @return status code +* +* @example +* #include "stdlib/ndarray/base/nullary/x.h" +* #include "stdlib/ndarray/dtypes.h" +* #include "stdlib/ndarray/index_modes.h" +* #include "stdlib/ndarray/orders.h" +* #include "stdlib/ndarray/ctor.h" +* #include +* #include +* #include +* #include +* +* // Define the ndarray data type: +* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_BOOL; +* +* // Create an underlying byte array: +* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; +* +* // Define the number of dimensions: +* int64_t ndims = 8; +* +* // Define the array shape: +* int64_t shape[] = { 1, 1, 1, 1, 1, 2, 2, 2 }; +* +* // Define the strides: +* int64_t sx[] = { 8, 8, 8, 8, 8, 4, 2, 1 }; +* +* // Define the index offset: +* int64_t ox = 0; +* +* // Define the array order: +* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; +* +* // Specify the index mode: +* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; +* +* // Specify the subscript index modes: +* int8_t submodes[] = { imode }; +* int64_t nsubmodes = 1; +* +* // Create an output ndarray: +* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shape, sx, ox, order, imode, nsubmodes, submodes ); +* if ( x == NULL ) { +* fprintf( stderr, "Error allocating memory.\n" ); +* exit( EXIT_FAILURE ); +* } +* +* // Create an array containing a pointer to the ndarray: +* struct ndarray *arrays[] = { x }; +* +* // Define a callback: +* static bool fcn( void ) { +* return true; +* } +* +* // Apply the callback: +* int8_t status = stdlib_ndarray_x_8d_blocked( arrays, (void *)fcn ); +* if ( status != 0 ) { +* fprintf( stderr, "Error during computation.\n" ); +* exit( EXIT_FAILURE ); +* } +* +* // ... +* +* // Free allocated memory: +* stdlib_ndarray_free( x ); +*/ +int8_t stdlib_ndarray_x_8d_blocked( struct ndarray *arrays[], void *fcn ) { + typedef bool func_type( void ); + func_type *f = (func_type *)fcn; + STDLIB_NDARRAY_NULLARY_8D_BLOCKED_LOOP_CLBK( bool ) + return 0; +} + +/** +* Applies a nullary callback and assigns results to elements in a nine-dimensional output ndarray. +* +* ## Notes +* +* - If successful, the functions returns `0`; otherwise, the function returns an error code. +* +* @param arrays array whose only element is a pointer to an output array +* @param fcn callback +* @return status code +* +* @example +* #include "stdlib/ndarray/base/nullary/x.h" +* #include "stdlib/ndarray/dtypes.h" +* #include "stdlib/ndarray/index_modes.h" +* #include "stdlib/ndarray/orders.h" +* #include "stdlib/ndarray/ctor.h" +* #include +* #include +* #include +* #include +* +* // Define the ndarray data type: +* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_BOOL; +* +* // Create an underlying byte array: +* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; +* +* // Define the number of dimensions: +* int64_t ndims = 9; +* +* // Define the array shape: +* int64_t shape[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; +* +* // Define the strides: +* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 4, 2, 1 }; +* +* // Define the index offset: +* int64_t ox = 0; +* +* // Define the array order: +* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; +* +* // Specify the index mode: +* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; +* +* // Specify the subscript index modes: +* int8_t submodes[] = { imode }; +* int64_t nsubmodes = 1; +* +* // Create an output ndarray: +* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shape, sx, ox, order, imode, nsubmodes, submodes ); +* if ( x == NULL ) { +* fprintf( stderr, "Error allocating memory.\n" ); +* exit( EXIT_FAILURE ); +* } +* +* // Create an array containing a pointer to the ndarray: +* struct ndarray *arrays[] = { x }; +* +* // Define a callback: +* static bool fcn( void ) { +* return true; +* } +* +* // Apply the callback: +* int8_t status = stdlib_ndarray_x_9d( arrays, (void *)fcn ); +* if ( status != 0 ) { +* fprintf( stderr, "Error during computation.\n" ); +* exit( EXIT_FAILURE ); +* } +* +* // ... +* +* // Free allocated memory: +* stdlib_ndarray_free( x ); +*/ +int8_t stdlib_ndarray_x_9d( struct ndarray *arrays[], void *fcn ) { + typedef bool func_type( void ); + func_type *f = (func_type *)fcn; + STDLIB_NDARRAY_NULLARY_9D_LOOP_CLBK( bool ) + return 0; +} + +/** +* Applies a nullary callback and assigns results to elements in a nine-dimensional output ndarray. +* +* ## Notes +* +* - If successful, the functions returns `0`; otherwise, the function returns an error code. +* +* @param arrays array whose only element is a pointer to an output array +* @param fcn callback +* @return status code +* +* @example +* #include "stdlib/ndarray/base/nullary/x.h" +* #include "stdlib/ndarray/dtypes.h" +* #include "stdlib/ndarray/index_modes.h" +* #include "stdlib/ndarray/orders.h" +* #include "stdlib/ndarray/ctor.h" +* #include +* #include +* #include +* #include +* +* // Define the ndarray data type: +* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_BOOL; +* +* // Create an underlying byte array: +* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; +* +* // Define the number of dimensions: +* int64_t ndims = 9; +* +* // Define the array shape: +* int64_t shape[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 }; +* +* // Define the strides: +* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 4, 2, 1 }; +* +* // Define the index offset: +* int64_t ox = 0; +* +* // Define the array order: +* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; +* +* // Specify the index mode: +* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; +* +* // Specify the subscript index modes: +* int8_t submodes[] = { imode }; +* int64_t nsubmodes = 1; +* +* // Create an output ndarray: +* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shape, sx, ox, order, imode, nsubmodes, submodes ); +* if ( x == NULL ) { +* fprintf( stderr, "Error allocating memory.\n" ); +* exit( EXIT_FAILURE ); +* } +* +* // Create an array containing a pointer to the ndarray: +* struct ndarray *arrays[] = { x }; +* +* // Define a callback: +* static bool fcn( void ) { +* return true; +* } +* +* // Apply the callback: +* int8_t status = stdlib_ndarray_x_9d_blocked( arrays, (void *)fcn ); +* if ( status != 0 ) { +* fprintf( stderr, "Error during computation.\n" ); +* exit( EXIT_FAILURE ); +* } +* +* // ... +* +* // Free allocated memory: +* stdlib_ndarray_free( x ); +*/ +int8_t stdlib_ndarray_x_9d_blocked( struct ndarray *arrays[], void *fcn ) { + typedef bool func_type( void ); + func_type *f = (func_type *)fcn; + STDLIB_NDARRAY_NULLARY_9D_BLOCKED_LOOP_CLBK( bool ) + return 0; +} + +/** +* Applies a nullary callback and assigns results to elements in a ten-dimensional output ndarray. +* +* ## Notes +* +* - If successful, the functions returns `0`; otherwise, the function returns an error code. +* +* @param arrays array whose only element is a pointer to an output array +* @param fcn callback +* @return status code +* +* @example +* #include "stdlib/ndarray/base/nullary/x.h" +* #include "stdlib/ndarray/dtypes.h" +* #include "stdlib/ndarray/index_modes.h" +* #include "stdlib/ndarray/orders.h" +* #include "stdlib/ndarray/ctor.h" +* #include +* #include +* #include +* #include +* +* // Define the ndarray data type: +* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_BOOL; +* +* // Create an underlying byte array: +* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; +* +* // Define the number of dimensions: +* int64_t ndims = 10; +* +* // Define the array shape: +* int64_t shape[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; +* +* // Define the strides: +* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 8, 4, 2, 1 }; +* +* // Define the index offset: +* int64_t ox = 0; +* +* // Define the array order: +* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; +* +* // Specify the index mode: +* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; +* +* // Specify the subscript index modes: +* int8_t submodes[] = { imode }; +* int64_t nsubmodes = 1; +* +* // Create an output ndarray: +* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shape, sx, ox, order, imode, nsubmodes, submodes ); +* if ( x == NULL ) { +* fprintf( stderr, "Error allocating memory.\n" ); +* exit( EXIT_FAILURE ); +* } +* +* // Create an array containing a pointer to the ndarray: +* struct ndarray *arrays[] = { x }; +* +* // Define a callback: +* static bool fcn( void ) { +* return true; +* } +* +* // Apply the callback: +* int8_t status = stdlib_ndarray_x_10d( arrays, (void *)fcn ); +* if ( status != 0 ) { +* fprintf( stderr, "Error during computation.\n" ); +* exit( EXIT_FAILURE ); +* } +* +* // ... +* +* // Free allocated memory: +* stdlib_ndarray_free( x ); +*/ +int8_t stdlib_ndarray_x_10d( struct ndarray *arrays[], void *fcn ) { + typedef bool func_type( void ); + func_type *f = (func_type *)fcn; + STDLIB_NDARRAY_NULLARY_10D_LOOP_CLBK( bool ) + return 0; +} + +/** +* Applies a nullary callback and assigns results to elements in a ten-dimensional output ndarray. +* +* ## Notes +* +* - If successful, the functions returns `0`; otherwise, the function returns an error code. +* +* @param arrays array whose only element is a pointer to an output array +* @param fcn callback +* @return status code +* +* @example +* #include "stdlib/ndarray/base/nullary/x.h" +* #include "stdlib/ndarray/dtypes.h" +* #include "stdlib/ndarray/index_modes.h" +* #include "stdlib/ndarray/orders.h" +* #include "stdlib/ndarray/ctor.h" +* #include +* #include +* #include +* #include +* +* // Define the ndarray data type: +* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_BOOL; +* +* // Create an underlying byte array: +* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; +* +* // Define the number of dimensions: +* int64_t ndims = 10; +* +* // Define the array shape: +* int64_t shape[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 }; +* +* // Define the strides: +* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 8, 4, 2, 1 }; +* +* // Define the index offset: +* int64_t ox = 0; +* +* // Define the array order: +* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; +* +* // Specify the index mode: +* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; +* +* // Specify the subscript index modes: +* int8_t submodes[] = { imode }; +* int64_t nsubmodes = 1; +* +* // Create an output ndarray: +* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shape, sx, ox, order, imode, nsubmodes, submodes ); +* if ( x == NULL ) { +* fprintf( stderr, "Error allocating memory.\n" ); +* exit( EXIT_FAILURE ); +* } +* +* // Create an array containing a pointer to the ndarray: +* struct ndarray *arrays[] = { x }; +* +* // Define a callback: +* static bool fcn( void ) { +* return true; +* } +* +* // Apply the callback: +* int8_t status = stdlib_ndarray_x_10d_blocked( arrays, (void *)fcn ); +* if ( status != 0 ) { +* fprintf( stderr, "Error during computation.\n" ); +* exit( EXIT_FAILURE ); +* } +* +* // ... +* +* // Free allocated memory: +* stdlib_ndarray_free( x ); +*/ +int8_t stdlib_ndarray_x_10d_blocked( struct ndarray *arrays[], void *fcn ) { + typedef bool func_type( void ); + func_type *f = (func_type *)fcn; + STDLIB_NDARRAY_NULLARY_10D_BLOCKED_LOOP_CLBK( bool ) + return 0; +} + +/** +* Applies a nullary callback and assigns results to elements in an n-dimensional output ndarray. +* +* ## Notes +* +* - If successful, the functions returns `0`; otherwise, the function returns an error code. +* +* @param arrays array whose only element is a pointer to an output array +* @param fcn callback +* @return status code +* +* @example +* #include "stdlib/ndarray/base/nullary/x.h" +* #include "stdlib/ndarray/dtypes.h" +* #include "stdlib/ndarray/index_modes.h" +* #include "stdlib/ndarray/orders.h" +* #include "stdlib/ndarray/ctor.h" +* #include +* #include +* #include +* #include +* +* // Define the ndarray data type: +* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_BOOL; +* +* // Create an underlying byte array: +* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; +* +* // Define the number of dimensions: +* int64_t ndims = 3; +* +* // Define the array shape: +* int64_t shape[] = { 2, 2, 2 }; +* +* // Define the strides: +* int64_t sx[] = { 4, 2, 1 }; +* +* // Define the index offset: +* int64_t ox = 0; +* +* // Define the array order: +* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; +* +* // Specify the index mode: +* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; +* +* // Specify the subscript index modes: +* int8_t submodes[] = { imode }; +* int64_t nsubmodes = 1; +* +* // Create an output ndarray: +* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shape, sx, ox, order, imode, nsubmodes, submodes ); +* if ( x == NULL ) { +* fprintf( stderr, "Error allocating memory.\n" ); +* exit( EXIT_FAILURE ); +* } +* +* // Create an array containing a pointer to the ndarray: +* struct ndarray *arrays[] = { x }; +* +* // Define a callback: +* static bool fcn( void ) { +* return true; +* } +* +* // Apply the callback: +* int8_t status = stdlib_ndarray_x_nd( arrays, (void *)fcn ); +* if ( status != 0 ) { +* fprintf( stderr, "Error during computation.\n" ); +* exit( EXIT_FAILURE ); +* } +* +* // ... +* +* // Free allocated memory: +* stdlib_ndarray_free( x ); +*/ +int8_t stdlib_ndarray_x_nd( struct ndarray *arrays[], void *fcn ) { + typedef bool func_type( void ); + func_type *f = (func_type *)fcn; + STDLIB_NDARRAY_NULLARY_ND_LOOP_CLBK( bool ) + return 0; +} + +// Define a list of nullary ndarray functions: +static ndarrayNullaryFcn functions[] = { + stdlib_ndarray_x_0d, + stdlib_ndarray_x_1d, + stdlib_ndarray_x_2d, + stdlib_ndarray_x_3d, + stdlib_ndarray_x_4d, + stdlib_ndarray_x_5d, + stdlib_ndarray_x_6d, + stdlib_ndarray_x_7d, + stdlib_ndarray_x_8d, + stdlib_ndarray_x_9d, + stdlib_ndarray_x_10d, + stdlib_ndarray_x_nd +}; + +// Define a list of nullary ndarray functions implementing loop blocking... +static ndarrayNullaryFcn blocked_functions[] = { + stdlib_ndarray_x_2d_blocked, + stdlib_ndarray_x_3d_blocked, + stdlib_ndarray_x_4d_blocked, + stdlib_ndarray_x_5d_blocked, + stdlib_ndarray_x_6d_blocked, + stdlib_ndarray_x_7d_blocked, + stdlib_ndarray_x_8d_blocked, + stdlib_ndarray_x_9d_blocked, + stdlib_ndarray_x_10d_blocked +}; + +// Create a nullary function dispatch object: +static const struct ndarrayNullaryDispatchObject obj = { + // Array containing nullary ndarray functions: + functions, + + // Number of nullary ndarray functions: + 12, + + // Array containing nullary ndarray functions using loop blocking: + blocked_functions, + + // Number of nullary ndarray functions using loop blocking: + 9 +}; + +/** +* Applies a nullary callback and assigns results to elements in an output ndarray. +* +* ## Notes +* +* - If successful, the functions returns `0`; otherwise, the function returns an error code. +* +* @param arrays array whose only element is a pointer to an output array +* @param fcn callback +* @return status code +* +* @example +* #include "stdlib/ndarray/base/nullary/x.h" +* #include "stdlib/ndarray/dtypes.h" +* #include "stdlib/ndarray/index_modes.h" +* #include "stdlib/ndarray/orders.h" +* #include "stdlib/ndarray/ctor.h" +* #include +* #include +* #include +* #include +* +* // Define the ndarray data type: +* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_BOOL; +* +* // Create an underlying byte array: +* uint8_t xbuf[] = { 0, 0, 0, 0 }; +* +* // Define the number of dimensions: +* int64_t ndims = 2; +* +* // Define the array shape: +* int64_t shape[] = { 2, 2 }; +* +* // Define the strides: +* int64_t sx[] = { 2, 1 }; +* +* // Define the index offset: +* int64_t ox = 0; +* +* // Define the array order: +* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR; +* +* // Specify the index mode: +* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR; +* +* // Specify the subscript index modes: +* int8_t submodes[] = { imode }; +* int64_t nsubmodes = 1; +* +* // Create an output ndarray: +* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shape, sx, ox, order, imode, nsubmodes, submodes ); +* if ( x == NULL ) { +* fprintf( stderr, "Error allocating memory.\n" ); +* exit( EXIT_FAILURE ); +* } +* +* // Create an array containing a pointer to the ndarray: +* struct ndarray *arrays[] = { x }; +* +* // Define a callback: +* static bool fcn( void ) { +* return true; +* } +* +* // Apply the callback: +* int8_t status = stdlib_ndarray_x( arrays, (void *)fcn ); +* if ( status != 0 ) { +* fprintf( stderr, "Error during computation.\n" ); +* exit( EXIT_FAILURE ); +* } +* +* // ... +* +* // Free allocated memory: +* stdlib_ndarray_free( x ); +*/ +int8_t stdlib_ndarray_x( struct ndarray *arrays[], void *fcn ) { + return stdlib_ndarray_nullary_dispatch( &obj, arrays, fcn ); +} diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/src/z.c b/lib/node_modules/@stdlib/ndarray/base/nullary/src/z.c index 3b90b2d540ff..a351e43fc112 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/src/z.c +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/src/z.c @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/src/z_as_b.c b/lib/node_modules/@stdlib/ndarray/base/nullary/src/z_as_b.c index 7aed68f3c52d..897e996bd9ba 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/src/z_as_b.c +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/src/z_as_b.c @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/src/z_as_c.c b/lib/node_modules/@stdlib/ndarray/base/nullary/src/z_as_c.c index 9a02a79f8b5e..d49e0c2331e3 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/src/z_as_c.c +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/src/z_as_c.c @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/src/z_as_d.c b/lib/node_modules/@stdlib/ndarray/base/nullary/src/z_as_d.c index f1406d70253d..5c6db007302a 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/src/z_as_d.c +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/src/z_as_d.c @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/src/z_as_f.c b/lib/node_modules/@stdlib/ndarray/base/nullary/src/z_as_f.c index 5a1f4ed17eac..77d45333caea 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/src/z_as_f.c +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/src/z_as_f.c @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/src/z_as_i.c b/lib/node_modules/@stdlib/ndarray/base/nullary/src/z_as_i.c index 30aaf2d2dcad..7a0fcc9c57bd 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/src/z_as_i.c +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/src/z_as_i.c @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/src/z_as_k.c b/lib/node_modules/@stdlib/ndarray/base/nullary/src/z_as_k.c index 575ad7489769..ee9abd7176f7 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/src/z_as_k.c +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/src/z_as_k.c @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/src/z_as_s.c b/lib/node_modules/@stdlib/ndarray/base/nullary/src/z_as_s.c index 10a24ccbb548..03d00591ed49 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/src/z_as_s.c +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/src/z_as_s.c @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/src/z_as_t.c b/lib/node_modules/@stdlib/ndarray/base/nullary/src/z_as_t.c index a10fba97e3f6..93569bfe0ab2 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/src/z_as_t.c +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/src/z_as_t.c @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/src/z_as_u.c b/lib/node_modules/@stdlib/ndarray/base/nullary/src/z_as_u.c index 47de5ac9e1d1..31a8a1efbe86 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/src/z_as_u.c +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/src/z_as_u.c @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2023 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. From d99ca76fb06fb4f2f080f3f0c444d01f1ab2bb7e Mon Sep 17 00:00:00 2001 From: Jaysukh-409 Date: Sat, 13 Jul 2024 19:48:07 +0530 Subject: [PATCH 2/2] docs: update example --- lib/node_modules/@stdlib/ndarray/base/nullary/README.md | 1 + lib/node_modules/@stdlib/ndarray/base/nullary/scripts/loops.js | 3 +++ 2 files changed, 4 insertions(+) diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/README.md b/lib/node_modules/@stdlib/ndarray/base/nullary/README.md index d04aecc268f1..f0b5023ed2bc 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/README.md +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/README.md @@ -3038,6 +3038,7 @@ Applies a nullary callback and assigns results to elements in an output ndarray. #include "stdlib/ndarray/index_modes.h" #include "stdlib/ndarray/orders.h" #include "stdlib/ndarray/ctor.h" +#include #include #include #include diff --git a/lib/node_modules/@stdlib/ndarray/base/nullary/scripts/loops.js b/lib/node_modules/@stdlib/ndarray/base/nullary/scripts/loops.js index 8737540e8948..d2bbe68ffb6d 100644 --- a/lib/node_modules/@stdlib/ndarray/base/nullary/scripts/loops.js +++ b/lib/node_modules/@stdlib/ndarray/base/nullary/scripts/loops.js @@ -641,6 +641,9 @@ function createDoc( signature ) { if ( /z/.test( tmp ) ) { inc.push( '#include "stdlib/complex/float64/ctor.h"' ); } + if ( /x/.test( tmp ) ) { + inc.push( '#include '); + } if ( inc.length ) { doc = replace( doc, '{{EXAMPLE_INCLUDES}}', '\n'+inc.join( '\n' ) ); } else {