Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/node_modules/@stdlib/math/base/special/cinv/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ stdlib_complex128_t stdlib_base_cinv( const stdlib_complex128_t z );
#include "stdlib/complex/float64/reim.h"
#include <stdio.h>

int main() {
int main( void ) {
const stdlib_complex128_t x[] = {
stdlib_complex128( 3.14, 1.5 ),
stdlib_complex128( -3.14, -1.5 ),
Expand Down
4 changes: 3 additions & 1 deletion lib/node_modules/@stdlib/math/base/special/cinvf/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,9 @@ var logEachMap = require( '@stdlib/console/log-each-map' );
var cinvf = require( '@stdlib/math/base/special/cinvf' );

// Create an array of random numbers:
var arr = new Complex64Array( uniform( 200, -100.0, 100.0 ) );
var arr = new Complex64Array( uniform( 200, -100.0, 100.0, {
'dtype': 'float32'
}));

// Compute the inverse of each number in the array:
logEachMap( '1.0 / (%s) = %s', arr, cinvf );
Expand Down
4 changes: 1 addition & 3 deletions lib/node_modules/@stdlib/ndarray/from-arraybuffer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,7 @@ v = arr.get( 1, 2, 1, 2 );

[@stdlib/ndarray/dtypes]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/dtypes

[@stdlib/ndarray/orders]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/orders

[@stdlib/ndarray/index-modes]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/index-modes
[@stdlib/array/buffer]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/buffer

<!-- <related-links> -->

Expand Down
6 changes: 4 additions & 2 deletions lib/node_modules/@stdlib/ndarray/from-arraybuffer/lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ function arraybuffer2ndarray( dtype, buffer, shape, strides, byteOffset, order,
var ndims;
var buf;
var idx;
var len;
var N;

if ( !isDataType( dtype ) ) {
Expand Down Expand Up @@ -179,7 +180,8 @@ function arraybuffer2ndarray( dtype, buffer, shape, strides, byteOffset, order,
// Compute the number of underlying elements across which the ndarray view will span:
offset = strides2offset( shape, strides );
idx = minmaxViewBufferIndex( shape, strides, offset );
N = idx[ 1 ] - idx[ 0 ] + 1;
len = numel( shape );
N = ( len === 0 ) ? 0 : idx[ 1 ] - idx[ 0 ] + 1;

// Create the underlying ndarray buffer:
if ( isBinaryDataType( dtype ) ) {
Expand All @@ -189,7 +191,7 @@ function arraybuffer2ndarray( dtype, buffer, shape, strides, byteOffset, order,
} else {
buf = typedarray( buffer, byteOffset, N, dtype );
}
if ( ndims > 0 && !isBufferLengthCompatible( buf.length, shape, strides, offset ) && numel( shape ) > 0 ) { // eslint-disable-line max-len
if ( ndims > 0 && len > 0 && !isBufferLengthCompatible( buf.length, shape, strides, offset ) ) { // eslint-disable-line max-len
throw new Error( 'invalid arguments. Input buffer is incompatible with the specified meta data. Ensure that the offset is valid with regard to the strides array and that the buffer has enough elements to satisfy the desired array shape.' );
}
// Return a new ndarray instance:
Expand Down
Loading