@stdlib/ndarray-base-bytes-per-element 0.0.7 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE +1 -1
- package/README.md +21 -2
- package/package.json +1 -1
- package/src/main.c +12 -0
package/NOTICE
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Copyright (c) 2016-
|
|
1
|
+
Copyright (c) 2016-2022 The Stdlib Authors.
|
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@ limitations under the License.
|
|
|
20
20
|
|
|
21
21
|
# Bytes per Element
|
|
22
22
|
|
|
23
|
-
[![NPM version][npm-image]][npm-url] [![Build Status][test-image]][test-url] [![Coverage Status][coverage-image]][coverage-url] [![dependencies][dependencies-image]][dependencies-url]
|
|
23
|
+
[![NPM version][npm-image]][npm-url] [![Build Status][test-image]][test-url] [![Coverage Status][coverage-image]][coverage-url] <!-- [![dependencies][dependencies-image]][dependencies-url] -->
|
|
24
24
|
|
|
25
25
|
> Return the number of bytes per element provided an underlying [array data type][@stdlib/ndarray/dtypes].
|
|
26
26
|
|
|
@@ -132,6 +132,14 @@ for ( i = 0; i < dtypes.length; i++ ) {
|
|
|
132
132
|
|
|
133
133
|
<!-- /.references -->
|
|
134
134
|
|
|
135
|
+
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
|
|
136
|
+
|
|
137
|
+
<section class="related">
|
|
138
|
+
|
|
139
|
+
</section>
|
|
140
|
+
|
|
141
|
+
<!-- /.related -->
|
|
142
|
+
|
|
135
143
|
<!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
|
|
136
144
|
|
|
137
145
|
|
|
@@ -158,7 +166,7 @@ See [LICENSE][stdlib-license].
|
|
|
158
166
|
|
|
159
167
|
## Copyright
|
|
160
168
|
|
|
161
|
-
Copyright © 2016-
|
|
169
|
+
Copyright © 2016-2022. The Stdlib [Authors][stdlib-authors].
|
|
162
170
|
|
|
163
171
|
</section>
|
|
164
172
|
|
|
@@ -177,9 +185,20 @@ Copyright © 2016-2021. The Stdlib [Authors][stdlib-authors].
|
|
|
177
185
|
[coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/ndarray-base-bytes-per-element/main.svg
|
|
178
186
|
[coverage-url]: https://codecov.io/github/stdlib-js/ndarray-base-bytes-per-element?branch=main
|
|
179
187
|
|
|
188
|
+
<!--
|
|
189
|
+
|
|
180
190
|
[dependencies-image]: https://img.shields.io/david/stdlib-js/ndarray-base-bytes-per-element.svg
|
|
181
191
|
[dependencies-url]: https://david-dm.org/stdlib-js/ndarray-base-bytes-per-element/main
|
|
182
192
|
|
|
193
|
+
-->
|
|
194
|
+
|
|
195
|
+
[umd]: https://github.com/umdjs/umd
|
|
196
|
+
[es-module]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules
|
|
197
|
+
|
|
198
|
+
[deno-url]: https://github.com/stdlib-js/ndarray-base-bytes-per-element/tree/deno
|
|
199
|
+
[umd-url]: https://github.com/stdlib-js/ndarray-base-bytes-per-element/tree/umd
|
|
200
|
+
[esm-url]: https://github.com/stdlib-js/ndarray-base-bytes-per-element/tree/esm
|
|
201
|
+
|
|
183
202
|
[chat-image]: https://img.shields.io/gitter/room/stdlib-js/stdlib.svg
|
|
184
203
|
[chat-url]: https://gitter.im/stdlib-js/stdlib/
|
|
185
204
|
|
package/package.json
CHANGED
package/src/main.c
CHANGED
|
@@ -44,28 +44,40 @@ int64_t stdlib_ndarray_bytes_per_element( enum STDLIB_NDARRAY_DTYPE dtype ) {
|
|
|
44
44
|
return STDLIB_NDARRAY_FLOAT64_BYTES_PER_ELEMENT;
|
|
45
45
|
case STDLIB_NDARRAY_FLOAT32:
|
|
46
46
|
return STDLIB_NDARRAY_FLOAT32_BYTES_PER_ELEMENT;
|
|
47
|
+
|
|
47
48
|
case STDLIB_NDARRAY_INT8:
|
|
48
49
|
return STDLIB_NDARRAY_INT8_BYTES_PER_ELEMENT;
|
|
49
50
|
case STDLIB_NDARRAY_UINT8:
|
|
50
51
|
return STDLIB_NDARRAY_UINT8_BYTES_PER_ELEMENT;
|
|
51
52
|
case STDLIB_NDARRAY_UINT8C:
|
|
52
53
|
return STDLIB_NDARRAY_UINT8C_BYTES_PER_ELEMENT;
|
|
54
|
+
|
|
53
55
|
case STDLIB_NDARRAY_INT16:
|
|
54
56
|
return STDLIB_NDARRAY_INT16_BYTES_PER_ELEMENT;
|
|
55
57
|
case STDLIB_NDARRAY_UINT16:
|
|
56
58
|
return STDLIB_NDARRAY_UINT16_BYTES_PER_ELEMENT;
|
|
59
|
+
|
|
57
60
|
case STDLIB_NDARRAY_INT32:
|
|
58
61
|
return STDLIB_NDARRAY_INT32_BYTES_PER_ELEMENT;
|
|
59
62
|
case STDLIB_NDARRAY_UINT32:
|
|
60
63
|
return STDLIB_NDARRAY_UINT32_BYTES_PER_ELEMENT;
|
|
64
|
+
|
|
61
65
|
case STDLIB_NDARRAY_INT64:
|
|
62
66
|
return STDLIB_NDARRAY_INT64_BYTES_PER_ELEMENT;
|
|
63
67
|
case STDLIB_NDARRAY_UINT64:
|
|
64
68
|
return STDLIB_NDARRAY_UINT64_BYTES_PER_ELEMENT;
|
|
69
|
+
|
|
65
70
|
case STDLIB_NDARRAY_BOOL:
|
|
66
71
|
return STDLIB_NDARRAY_BOOL_BYTES_PER_ELEMENT;
|
|
72
|
+
|
|
67
73
|
case STDLIB_NDARRAY_BINARY:
|
|
68
74
|
return STDLIB_NDARRAY_BINARY_BYTES_PER_ELEMENT;
|
|
75
|
+
|
|
76
|
+
case STDLIB_NDARRAY_COMPLEX64:
|
|
77
|
+
return STDLIB_NDARRAY_COMPLEX64_BYTES_PER_ELEMENT;
|
|
78
|
+
case STDLIB_NDARRAY_COMPLEX128:
|
|
79
|
+
return STDLIB_NDARRAY_COMPLEX128_BYTES_PER_ELEMENT;
|
|
80
|
+
|
|
69
81
|
default:
|
|
70
82
|
return 0; // data type is not currently supported
|
|
71
83
|
}
|