Skip to content

Commit 54cafbf

Browse files
committed
docs: add notes
1 parent 3c02553 commit 54cafbf

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

lib/node_modules/@stdlib/ndarray/base/broadcast-scalar/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ var v = x.get( 0, 0 );
6969
## Notes
7070

7171
- If `value` is a number and [`dtype`][@stdlib/ndarray/dtypes] is a complex [data type][@stdlib/ndarray/dtypes], the function returns an [`ndarray`][@stdlib/ndarray/base/ctor] containing a complex number whose real component equals the provided scalar `value` and whose imaginary component is zero.
72+
- The returned [ndarray][@stdlib/ndarray/base/ctor] is a view on an [ndarray][@stdlib/ndarray/base/ctor] data buffer containing a single element. The view is **not** contiguous. As more than one element of a returned view may refer to the same memory location, writing to the view may affect multiple elements. If you need to write to the returned [ndarray][@stdlib/ndarray/base/ctor], copy the [ndarray][@stdlib/ndarray/base/ctor] **before** performing operations which may mutate elements.
73+
- The returned [ndarray][@stdlib/ndarray/base/ctor] is a "base" [ndarray][@stdlib/ndarray/base/ctor], and, thus, the returned [ndarray][@stdlib/ndarray/base/ctor] does not perform bounds checking or afford any of the guarantees of the non-base [ndarray][@stdlib/ndarray/ctor] constructor. The primary intent of this function is to broadcast a scalar value as an [`ndarray`][@stdlib/ndarray/base/ctor] within internal implementations and to do so with minimal overhead.
7274

7375
</section>
7476

@@ -124,6 +126,8 @@ for ( i = 0; i < dt.length; i++ ) {
124126

125127
[@stdlib/ndarray/base/ctor]: https://github.com/stdlib-js/stdlib
126128

129+
[@stdlib/ndarray/ctor]: https://github.com/stdlib-js/stdlib
130+
127131
[@stdlib/ndarray/dtypes]: https://github.com/stdlib-js/stdlib
128132

129133
</section>

lib/node_modules/@stdlib/ndarray/base/broadcast-scalar/docs/repl.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,18 @@
66
function returns an ndarray containing a complex number whose real component
77
equals the provided scalar value and whose imaginary component is zero.
88

9+
The returned array is a view on an ndarray data buffer. The view is *not*
10+
contiguous. As more than one element of a returned view may refer to the
11+
same memory location, writing to the view may affect multiple elements. If
12+
you need to write to the returned array, copy the array before performing
13+
operations which may mutate elements.
14+
15+
The returned array is a "base" ndarray, and, thus, the returned array does
16+
not perform bounds checking or afford any of the guarantees of the non-base
17+
ndarray constructor. The primary intent of this function is to broadcast a
18+
scalar value as an ndarray within internal implementations and to do so with
19+
minimal overhead.
20+
921
Parameters
1022
----------
1123
value: any

0 commit comments

Comments
 (0)