Skip to content

Commit 164a96b

Browse files
committed
Merge branch 'develop' of https://github.com/stdlib-js/stdlib into develop
2 parents d06165b + 6ea880c commit 164a96b

Some content is hidden

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

114 files changed

+3532
-1296
lines changed

lib/node_modules/@stdlib/ndarray/base/assign/README.md

+85
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ Character codes for data types:
172172

173173
<!-- charcodes -->
174174

175+
- **x**: `bool` (boolean).
175176
- **c**: `complex64` (single-precision floating-point complex number).
176177
- **z**: `complex128` (double-precision floating-point complex number).
177178
- **f**: `float32` (single-precision floating-point number).
@@ -4503,6 +4504,90 @@ The function accepts the following arguments:
45034504
int8_t stdlib_ndarray_assign_u_z( struct ndarray *arrays[] );
45044505
```
45054506

4507+
#### stdlib_ndarray_assign_x_x( \*arrays\[] )
4508+
4509+
Assigns elements in an input ndarray to elements in an output ndarray.
4510+
4511+
```c
4512+
#include "stdlib/ndarray/dtypes.h"
4513+
#include "stdlib/ndarray/index_modes.h"
4514+
#include "stdlib/ndarray/orders.h"
4515+
#include "stdlib/ndarray/ctor.h"
4516+
#include <stdint.h>
4517+
#include <stdlib.h>
4518+
#include <stdio.h>
4519+
4520+
// Define the ndarray data types:
4521+
enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_BOOL;
4522+
enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_BOOL;
4523+
4524+
// Create underlying byte arrays:
4525+
uint8_t xbuf[] = { 0, 0, 0, 0 };
4526+
uint8_t ybuf[] = { 0, 0, 0, 0 };
4527+
4528+
// Define the number of dimensions:
4529+
int64_t ndims = 2;
4530+
4531+
// Define the array shapes:
4532+
int64_t shape[] = { 2, 2 };
4533+
4534+
// Define the strides:
4535+
int64_t sx[] = { 2, 1 };
4536+
int64_t sy[] = { 2, 1 };
4537+
4538+
// Define the offsets:
4539+
int64_t ox = 0;
4540+
int64_t oy = 0;
4541+
4542+
// Define the array order:
4543+
enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
4544+
4545+
// Specify the index mode:
4546+
enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
4547+
4548+
// Specify the subscript index modes:
4549+
int8_t submodes[] = { imode };
4550+
int64_t nsubmodes = 1;
4551+
4552+
// Create an input ndarray:
4553+
struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shape, sx, ox, order, imode, nsubmodes, submodes );
4554+
if ( x == NULL ) {
4555+
fprintf( stderr, "Error allocating memory.\n" );
4556+
exit( EXIT_FAILURE );
4557+
}
4558+
4559+
// Create an output ndarray:
4560+
struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shape, sy, oy, order, imode, nsubmodes, submodes );
4561+
if ( y == NULL ) {
4562+
fprintf( stderr, "Error allocating memory.\n" );
4563+
exit( EXIT_FAILURE );
4564+
}
4565+
4566+
// Create an array containing the ndarrays:
4567+
struct ndarray *arrays[] = { x, y };
4568+
4569+
// Copy elements:
4570+
int8_t status = stdlib_ndarray_assign_x_x( arrays );
4571+
if ( status != 0 ) {
4572+
fprintf( stderr, "Error during computation.\n" );
4573+
exit( EXIT_FAILURE );
4574+
}
4575+
4576+
// ...
4577+
4578+
// Free allocated memory:
4579+
stdlib_ndarray_free( x );
4580+
stdlib_ndarray_free( y );
4581+
```
4582+
4583+
The function accepts the following arguments:
4584+
4585+
- **arrays**: `[inout] struct ndarray**` array whose first element is a pointer to an input ndarray and whose second element is a pointer to an output ndarray.
4586+
4587+
```c
4588+
int8_t stdlib_ndarray_assign_x_x( struct ndarray *arrays[] );
4589+
```
4590+
45064591
#### stdlib_ndarray_assign_z_c( \*arrays\[] )
45074592

45084593
Assigns elements in an input ndarray to elements in an output ndarray.

lib/node_modules/@stdlib/ndarray/base/assign/include/stdlib/ndarray/base/assign.h

+2
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@
9292
#include "assign/u_u.h"
9393
#include "assign/u_z.h"
9494

95+
#include "assign/x_x.h"
96+
9597
#include "assign/z_c.h"
9698
#include "assign/z_z.h"
9799
// END LOOPS

lib/node_modules/@stdlib/ndarray/base/assign/include/stdlib/ndarray/base/assign/b_b.h

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

lib/node_modules/@stdlib/ndarray/base/assign/include/stdlib/ndarray/base/assign/b_c.h

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

lib/node_modules/@stdlib/ndarray/base/assign/include/stdlib/ndarray/base/assign/b_d.h

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

lib/node_modules/@stdlib/ndarray/base/assign/include/stdlib/ndarray/base/assign/b_f.h

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

lib/node_modules/@stdlib/ndarray/base/assign/include/stdlib/ndarray/base/assign/b_i.h

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

lib/node_modules/@stdlib/ndarray/base/assign/include/stdlib/ndarray/base/assign/b_k.h

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

lib/node_modules/@stdlib/ndarray/base/assign/include/stdlib/ndarray/base/assign/b_t.h

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

lib/node_modules/@stdlib/ndarray/base/assign/include/stdlib/ndarray/base/assign/b_u.h

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

lib/node_modules/@stdlib/ndarray/base/assign/include/stdlib/ndarray/base/assign/b_z.h

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

lib/node_modules/@stdlib/ndarray/base/assign/include/stdlib/ndarray/base/assign/c_c.h

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

lib/node_modules/@stdlib/ndarray/base/assign/include/stdlib/ndarray/base/assign/c_z.h

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

lib/node_modules/@stdlib/ndarray/base/assign/include/stdlib/ndarray/base/assign/d_c.h

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

lib/node_modules/@stdlib/ndarray/base/assign/include/stdlib/ndarray/base/assign/d_d.h

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

lib/node_modules/@stdlib/ndarray/base/assign/include/stdlib/ndarray/base/assign/d_f.h

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

lib/node_modules/@stdlib/ndarray/base/assign/include/stdlib/ndarray/base/assign/d_z.h

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

lib/node_modules/@stdlib/ndarray/base/assign/include/stdlib/ndarray/base/assign/f_c.h

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

lib/node_modules/@stdlib/ndarray/base/assign/include/stdlib/ndarray/base/assign/f_d.h

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

lib/node_modules/@stdlib/ndarray/base/assign/include/stdlib/ndarray/base/assign/f_f.h

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

lib/node_modules/@stdlib/ndarray/base/assign/include/stdlib/ndarray/base/assign/f_z.h

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

lib/node_modules/@stdlib/ndarray/base/assign/include/stdlib/ndarray/base/assign/i_d.h

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

lib/node_modules/@stdlib/ndarray/base/assign/include/stdlib/ndarray/base/assign/i_i.h

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

lib/node_modules/@stdlib/ndarray/base/assign/include/stdlib/ndarray/base/assign/i_u.h

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

lib/node_modules/@stdlib/ndarray/base/assign/include/stdlib/ndarray/base/assign/i_z.h

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

lib/node_modules/@stdlib/ndarray/base/assign/include/stdlib/ndarray/base/assign/k_c.h

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

lib/node_modules/@stdlib/ndarray/base/assign/include/stdlib/ndarray/base/assign/k_d.h

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

lib/node_modules/@stdlib/ndarray/base/assign/include/stdlib/ndarray/base/assign/k_f.h

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

lib/node_modules/@stdlib/ndarray/base/assign/include/stdlib/ndarray/base/assign/k_i.h

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

lib/node_modules/@stdlib/ndarray/base/assign/include/stdlib/ndarray/base/assign/k_k.h

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

lib/node_modules/@stdlib/ndarray/base/assign/include/stdlib/ndarray/base/assign/k_t.h

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

lib/node_modules/@stdlib/ndarray/base/assign/include/stdlib/ndarray/base/assign/k_u.h

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

lib/node_modules/@stdlib/ndarray/base/assign/include/stdlib/ndarray/base/assign/k_z.h

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

lib/node_modules/@stdlib/ndarray/base/assign/include/stdlib/ndarray/base/assign/s_b.h

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

0 commit comments

Comments
 (0)