From 3d5d15461bf9ffa4bc28275c6e115d645937df34 Mon Sep 17 00:00:00 2001 From: Jaysukh-409 Date: Wed, 29 May 2024 17:20:44 +0530 Subject: [PATCH 1/4] docs: Added repl.txt to array/complex64 --- .../@stdlib/array/complex64/docs/repl.txt | 1412 +++++++++++++++++ 1 file changed, 1412 insertions(+) create mode 100644 lib/node_modules/@stdlib/array/complex64/docs/repl.txt diff --git a/lib/node_modules/@stdlib/array/complex64/docs/repl.txt b/lib/node_modules/@stdlib/array/complex64/docs/repl.txt new file mode 100644 index 000000000000..a5c81c505d38 --- /dev/null +++ b/lib/node_modules/@stdlib/array/complex64/docs/repl.txt @@ -0,0 +1,1412 @@ + +{{alias}}() + A 64-bit complex number array. + + Returns + ------- + out: Complex64Array + A typed array. + + Examples + -------- + > var arr = new {{alias}}() + + + +{{alias}}( length ) + Creates a 64-bit complex number array having a specified length. + + Parameters + ---------- + length: integer + Complex array length. + + Returns + ------- + out: Complex64Array + A typed array. + + Examples + -------- + > var arr = new {{alias}}( 10 ) + + > var len = arr.length + 10 + + +{{alias}}( complexarray ) + Creates a 64-bit complex number array from another complex number array. + + Parameters + ---------- + complexarray: Complex64Array + Complex array from which to generate another complex array. + + Returns + ------- + out: Complex64Array + A typed array. + + Examples + -------- + > var arr1 = new {{alias}}( [ 1.0, -1.0, 2.0, -2.0 ] ) + + > var arr2 = new {{alias}}( arr1 ) + + > var len = arr2.length + 2 + + +{{alias}}( typedarray ) + Creates a 64-bit complex number array from a typed array + containing interleaved real and imaginary components. + + Parameters + ---------- + typedarray: TypedArray + Typed array from which to generate complex array. + + Returns + ------- + out: Complex64Array + A typed array. + + Examples + -------- + > var buf = new {{alias:@stdlib/array/float32}}( [ 1.0, -1.0, 2.0, -2.0 ] ) + + > var arr = new {{alias}}( buf ) + + > var len = arr.length + 2 + + +{{alias}}( obj ) + Creates a 64-bit complex number array from an array-like object or iterable. + + Parameters + ---------- + obj: Object + Array-like object or iterable from which to generate a complex array. + + Returns + ------- + out: Complex64Array + A typed array. + + Examples + -------- + > var arr1 = new {{alias}}( [ 1.0, -1.0, 2.0, -2.0 ] ) + + > var len = arr1.length + 2 + > var buf = [ new {{alias:@stdlib/complex/float32}}( 1.0, -1.0 ), new {{alias:@stdlib/complex/float32}}( 2.0, -2.0 )] + > var arr2 = new {{alias}}( buf ) + + > len = arr2.length + 2 + + +{{alias}}( buffer[, byteOffset[, length]] ) + Returns a 64-bit complex number array view of an ArrayBuffer. + + Parameters + ---------- + buffer: ArrayBuffer + Underlying ArrayBuffer. + + byteOffset: integer (optional) + Integer byte offset specifying the location of the first typed array + element. Default: 0. + + length: integer (optional) + View length. If not provided, the view spans from the byteOffset to + the end of the underlying ArrayBuffer. + + Returns + ------- + out: Complex64Array + A typed array. + + Examples + -------- + > var buf = new {{alias:@stdlib/array/buffer}}( 240 ); + > var arr1 = new {{alias}}( buf ) + + > var len = arr1.length + 30 + > var arr2 = new {{alias}}( buf, 8 ) + + > len = arr2.length + 29 + > var arr3 = new {{alias}}( buf, 8, 20 ) + + > len = arr3.length + 20 + + +{{alias}}.from( src[, clbk[, thisArg]] ) + Creates a new 64-bit complex number array from an array-like object or an + iterable. + + A callback function is provided two arguments: + + - value: source value. + - index: source index. + + Parameters + ---------- + src: ArrayLike|Iterable + Source of array elements. + + clbk: Function (optional) + Callback to invoke for each source element. + + thisArg: Any (optional) + Callback execution context. + + Returns + ------- + out: Complex64Array + A typed array. + + Examples + -------- + > function clbkFcn( v ) { return v * 2.0 }; + > var arr = {{alias}}.from( [ 1.0, -1.0, 2.0, -2.0 ], clbkFcn ) + + > var len = arr.length + 2 + > var z = arr.get( 0 ) + + > var re = {{alias:@stdlib/complex/realf}}( z ) + 2.0 + > var im = {{alias:@stdlib/complex/imagf}}( z ) + -2.0 + + +{{alias}}.of( element0[, element1[, ...elementN]] ) + Creates a new 64-bit complex number array from a variable number of + arguments. + + Parameters + ---------- + element0: number + Array element. + + element1: number (optional) + Array element. + + elementN: number (optional) + Array elements. + + Returns + ------- + out: Complex64Array + A typed array. + + Examples + -------- + > var arr = {{alias}}.of( 1.0, -1.0, 2.0, -2.0 ) + + > var len = arr.length + 2 + > var z1 = new {{alias:@stdlib/complex/float32}}( 1.0, -1.0 ) + > var z2 = new {{alias:@stdlib/complex/float32}}( 2.0, -2.0 ) + > arr = {{alias}}.of( z1, z2 ) + + > len = arr.length + 2 + > var z = arr.get( 0 ) + + > var re = {{alias:@stdlib/complex/realf}}( z ) + 1.0 + > var im = {{alias:@stdlib/complex/imagf}}( z ) + -1.0 + + +{{alias}}.BYTES_PER_ELEMENT + The size of each array element in bytes. + + Examples + -------- + > var nbytes = {{alias}}.BYTES_PER_ELEMENT + 8 + + +{{alias}}.name + Typed array constructor name. + + Examples + -------- + > var str = {{alias}}.name + 'Complex64Array' + + +{{alias}}.prototype.buffer + Pointer to the underlying data buffer. + + Examples + -------- + > var arr = new {{alias}}( 2 ) + + > var buf = arr.buffer + + + +{{alias}}.prototype.byteLength + Length of the array in bytes. + + Examples + -------- + > var arr = new {{alias}}( 10 ) + + > var nbytes = arr.byteLength + 80 + + +{{alias}}.prototype.byteOffset + Offset (in bytes) of the array from the start of its underlying + ArrayBuffer. + + Examples + -------- + > var arr = new {{alias}}( 5 ) + + > var offset = arr.byteOffset + 0 + > var buf = new {{alias:@stdlib/array/buffer}}( 240 ) + > arr = new {{alias}}( buf, 64 ) + + > offset = arr.byteOffset + 64 + + +{{alias}}.prototype.BYTES_PER_ELEMENT + Size (in bytes) of each array element. + + Examples + -------- + > var arr = new {{alias}}( 10 ) + + > arr.BYTES_PER_ELEMENT + 8 + + +{{alias}}.prototype.length + The number of array elements. + + Examples + -------- + > var arr = new {{alias}}( 10 ) + + > var len = arr.length + 10 + + +{{alias}}.prototype.at( i ) + Returns an array element located at integer position (index) `i`, with + support for noth nonnegative and negative integer position. + + If provided an index outside the array index range, the method returns + `undefined`. + + Parameters + ---------- + i: number + Element index. + + Returns + ------- + out: Complex64|void + An array element. + + Examples + -------- + > var arr = new {{alias}}( [ 1.0, -1.0, 2.0, -2.0 ] ) + + > var z = arr.at( 1 ) + + > var re = {{alias:@stdlib/complex/realf}}( z ) + 2.0 + > var im = {{alias:@stdlib/complex/imagf}}( z ) + -2.0 + + +{{alias}}.prototype.copyWithin( target, start[, end] ) + Copies a sequence of elements within the array starting at `start` and + ending at `end` (non-inclusive) to the position starting at `target`. + + Parameters + ---------- + target: integer + Target start index position. + + start: integer + Source start index position. + + end: integer (optional) + Source end index position. Default: out.length. + + Returns + ------- + out: Complex64Array + Modified array. + + Examples + -------- + > var arr = new {{alias}}( [ 1.0, -1.0, 2.0, -2.0, 3.0, -3.0, 4.0, -4.0 ] ) + + > arr.copyWithin( 0, 2 ) + + > var z = arr.get( 0 ) + + > var re = {{alias:@stdlib/complex/realf}}( z ) + 3.0 + > var im = {{alias:@stdlib/complex/imagf}}( z ) + -3.0 + + +{{alias}}.prototype.entries() + Returns an iterator for iterating over array key-value pairs. + + Returns + ------- + iterator: Iterator + Iterator for iterating over array key-value pairs. + + Examples + -------- + > var arr = new {{alias}}( [ 1.0, -1.0, 2.0, -2.0, 3.0, -3.0 ] ) + + > var it = arr.entries(); + > var v = it.next().value + [ 0, ] + > var re = {{alias:@stdlib/complex/realf}}( v[ 1 ] ) + 1.0 + > var im = {{alias:@stdlib/complex/imagf}}( v[ 1 ] ) + -1.0 + > v = it.next().value + [ 1, ] + > re = {{alias:@stdlib/complex/realf}}( v[ 1 ] ) + 2.0 + > im = {{alias:@stdlib/complex/imagf}}( v[ 1 ] ) + -2.0 + > v = it.next().value + [ 2, ] + > re = {{alias:@stdlib/complex/realf}}( v[ 1 ] ) + 3.0 + > im = {{alias:@stdlib/complex/imagf}}( v[ 1 ] ) + -3.0 + > var bool = it.next().done + true + + +{{alias}}.prototype.every( predicate[, thisArg] ) + Returns a boolean indicating whether all elements in the array pass a test. + + A predicate function is provided the following arguments: + + - value: current array element. + - index: current array element index. + - arr: the array on which the method was called. + + Parameters + ---------- + predicate: Function + Predicate function which tests array elements. If a predicate function + returns a truthy value, an array element passes; otherwise, an array + element fails. + + thisArg: Any (optional) + Execution context. + + Returns + ------- + bool: boolean + Boolean indicating whether all elements pass the test. + + Examples + -------- + > function predicate( v ) { return ( v.re > 0.0 ); } + > var arr = new {{alias}}( [ 1.0, -1.0, 2.0, -2.0 ] ) + + > var bool = arr.every( predicate ) + true + + +{{alias}}.prototype.fill( value[, start[, end]] ) + Returns a modified typed array filled with a fill value. + + Parameters + ---------- + value: Complex64 + Fill value. + + start: integer (optional) + Start index. If less than zero, the start index is resolved relative to + the last array element. Default: 0. + + end: integer (optional) + End index (non-inclusive). If less than zero, the end index is resolved + relative to the last array element. Default: out.length. + + Returns + ------- + out: Complex64Array + Modified array. + + Examples + -------- + > var arr = new {{alias}}( 3 ) + + > arr.fill( new {{alias:@stdlib/complex/float32}}( 1.0, 1.0 ) ); + > var z = arr.get( 0 ) + + > var re = {{alias:@stdlib/complex/realf}}( z ) + 1.0 + > var im = {{alias:@stdlib/complex/imagf}}( z ) + 1.0 + > z = arr.get( 1 ) + + > re = {{alias:@stdlib/complex/realf}}( z ) + 1.0 + > im = {{alias:@stdlib/complex/imagf}}( z ) + 1.0 + > z = arr.get( 2 ) + + > re = {{alias:@stdlib/complex/realf}}( z ) + 1.0 + > im = {{alias:@stdlib/complex/imagf}}( z ) + 1.0 + + +{{alias}}.prototype.filter( predicate[, thisArg] ) + Returns a new array containing the elements of an array which pass a test + implemented by a predicate function. + + A predicate function is provided the following arguments: + - value: current array element. + - index: current array element index. + - arr: the array on which the method was called. + + The returned array has the same data type as the host array. + + If a predicate function does not return a truthy value for any array + element, the method returns `null`. + + Parameters + ---------- + predicate: Function + Predicate function which filters array elements. If a predicate function + returns a truthy value, an array element is included in the output + array; otherwise, an array element is not included in the output array. + + thisArg: Any (optional) + Execution context. + + Returns + ------- + out: Complex64Array + A new typed array. + + Examples + -------- + > function predicate( v ) { return ( {{alias:@stdlib/complex/realf}}( v ) === {{alias:@stdlib/complex/imagf}}( v ) ); } + > var arr = new {{alias}}( [ 1.0, -1.0, 2.0, 2.0, 3.0, -3.0 ] ) + + > var out = arr.filter( predicate ) + + > var len = out.length + 1 + > var z = out.get( 0 ) + + > var re = {{alias:@stdlib/complex/realf}}( z ) + 2.0 + > var im = {{alias:@stdlib/complex/imagf}}( z ) + 2.0 + + +{{alias}}.prototype.find( predicate[, thisArg] ) + Returns the first element in an array for which a predicate function + returns a truthy value. + + A predicate function is provided the following arguments: + - value: current array element. + - index: current array element index. + - arr: the array on which the method was called. + + If a predicate function never returns a truthy value, the method returns + `undefined`. + + Parameters + ---------- + predicate: Function + Predicate function which tests array elements. + + thisArg: Any (optional) + Execution context. + + Returns + ------- + out: Complex64|void + Array element or `undefined`. + + Examples + -------- + > function predicate( v ) { return ( {{alias:@stdlib/complex/realf}}( v ) === {{alias:@stdlib/complex/imagf}}( v ) ); } + > var arr = new {{alias}}( [ 1.0, 1.0, 2.0, 2.0, 3.0, -3.0 ] ) + + > var z = arr.find( predicate ) + + > var re = {{alias:@stdlib/complex/realf}}( z ) + 1.0 + > var im = {{alias:@stdlib/complex/imagf}}( z ) + 1.0 + + +{{alias}}.prototype.findIndex( predicate[, thisArg] ) + Returns the index of the first element in an array for which a predicate + function returns a truthy value. + + A predicate function is provided the following arguments: + - value: current array element. + - index: current array element index. + - arr: the array on which the method was called. + + If a predicate function never returns a truthy value, the method returns + `-1`. + + Parameters + ---------- + predicate: Function + Predicate function which tests array elements. + + thisArg: Any (optional) + Execution context. + + Returns + ------- + out: integer + Array index or `-1`. + + Examples + -------- + > function predicate( v ) { return ( {{alias:@stdlib/complex/realf}}( v ) === {{alias:@stdlib/complex/imagf}}( v ) ); } + > var arr = new {{alias}}( [ 1.0, 1.0, 2.0, 2.0, 3.0, -3.0 ] ) + + > var idx = arr.findIndex( predicate ) + 0 + + +{{alias}}.prototype.findLast( predicate[, thisArg] ) + Returns the last element in an array for which a predicate function returns + a truthy value. + + A predicate function is provided the following arguments: + - value: current array element. + - index: current array element index. + - arr: the array on which the method was called. + + If a predicate function never returns a truthy value, the method returns + `undefined`. + + Parameters + ---------- + predicate: Function + Predicate function which tests array elements. + + thisArg: Any (optional) + Execution context. + + Returns + ------- + out: Complex64|void + Array element or `undefined`. + + Examples + -------- + > function predicate( v ) { return ( {{alias:@stdlib/complex/realf}}( v ) === {{alias:@stdlib/complex/imagf}}( v ) ); } + > var arr = new {{alias}}( [ 1.0, 1.0, 2.0, 2.0, 3.0, -3.0 ] ) + + > var z = arr.findLast( predicate ) + + > var re = {{alias:@stdlib/complex/realf}}( z ) + 2.0 + > var im = {{alias:@stdlib/complex/imagf}}( z ) + 2.0 + + +{{alias}}.prototype.findLastIndex( predicate[, thisArg] ) + Returns the index of the last element in an array for which a predicate + function returns a truthy value. + + A predicate function is provided the following arguments: + - value: current array element. + - index: current array element index. + - arr: the array on which the method was called. + + If a predicate function never returns a truthy value, the method returns + `-1`. + + Parameters + ---------- + predicate: Function + Predicate function which tests array elements. + + thisArg: Any (optional) + Execution context. + + Returns + ------- + out: integer + Array index or `-1`. + + Examples + -------- + > function predicate( v ) { return ( {{alias:@stdlib/complex/realf}}( v ) === {{alias:@stdlib/complex/imagf}}( v ) ); } + > var arr = new {{alias}}( [ 1.0, 1.0, 2.0, 2.0, 3.0, -3.0 ] ) + + > var idx = arr.findLastIndex( predicate ) + 1 + + +{{alias}}.prototype.forEach( clbk[, thisArg] ) + Invokes a function once for each array element. + + A callback function is provided the following arguments: + - value: current array element. + - index: current array element index. + - arr: the array on which the method was called. + + Parameters + ---------- + clbk: Function + Function to invoke for each array element. + + thisArg: Any (optional) + Execution context. + + Examples + -------- + > var str = ''; + > function clbk( v ) { str += v.toString() + ' '; } + > var arr = new {{alias}}( [ 1.0, -1.0, 2.0, -2.0 ] ) + + > arr.forEach( clbk ) + > str + '1 - 1i 2 - 2i ' + + +{{alias}}.prototype.get( i ) + Returns an array element located at integer position (index) `i`. + + If provided an index outside the array index range, the method returns + `undefined`. + + Parameters + ---------- + i: integer + Element index. + + Returns + ------- + out: Complex64|void + Array element or `undefined`. + + Examples + -------- + > var arr = new {{alias}}( [ 1.0, -1.0, 2.0, -2.0 ] ) + + > var z = arr.get( 1 ) + + > var re = {{alias:@stdlib/complex/realf}}( z ) + 2.0 + > var im = {{alias:@stdlib/complex/imagf}}( z ) + -2.0 + + +{{alias}}.prototype.includes( searchElement[, fromIndex] ) + Returns a boolean indicating whether an array includes a provided value. + + Parameters + ---------- + searchElement: Complex64 + Search element. + + fromIndex: integer (optional) + Array index at which to start the search. If provided a negative value, + the method resolves the start index relative to the last array element. + Default: 0. + + Returns + ------- + bool: boolean + Boolean indicating whether an array includes a search element. + + Examples + -------- + > var arr = new {{alias}}( [ 1.0, -1.0, 2.0, -2.0, 3.0, -3.0, 4.0, -4.0 ] ) + + > var bool = arr.includes( new {{alias:@stdlib/complex/float32}}( 3.0, -3.0 ) ) + true + > bool = arr.includes( new {{alias:@stdlib/complex/float32}}( 3.0, -3.0 ), 3 ) + false + + +{{alias}}.prototype.indexOf( searchElement[, fromIndex] ) + Returns the first index at which a given element can be found. + + If method does not find a search element, the method returns `-1`. + + Parameters + ---------- + searchElement: Complex64 + Search element. + + fromIndex: integer (optional) + Array index at which to start the search. If provided a negative value, + the method resolves the start index relative to the last array element. + Default: 0. + + Returns + ------- + out: integer + Array index or `-1`. + + Examples + -------- + > var arr = new {{alias}}( [ 1.0, -1.0, 2.0, -2.0, 3.0, -3.0, 4.0, -4.0 ] ) + + > var idx = arr.indexOf( new {{alias:@stdlib/complex/float32}}( 3.0, -3.0 ) ) + 2 + > idx = arr.indexOf( new {{alias:@stdlib/complex/float32}}( 3.0, -3.0 ), 3 ) + -1 + + +{{alias}}.prototype.join( [separator] ) + Returns a new string by concatenating all array elements separated by a + separator string. + + Parameters + ---------- + separator: string (optional) + Separator string. Default: ','. + + Returns + ------- + out: string + Array serialized as a string. + + Examples + -------- + > var arr = new {{alias}}( [ 1.0, -1.0, 2.0, -2.0 ] ) + + > var str = arr.join() + '1 - 1i,2 - 2i' + > str = arr.join( '/' ) + '1 - 1i/2 - 2i' + + +{{alias}}.prototype.keys() + Returns an iterator for iterating over each index key in a typed array. + + Returns + ------- + iterator: Iterator + Iterator for iterating over array index keys. + + Examples + -------- + > var arr = new {{alias}}( [ 1.0, -1.0, 2.0, -2.0 ] ) + + > var it = arr.keys(); + > var v = it.next().value + 0 + > v = it.next().value + 1 + > v = it.next().done + true + + +{{alias}}.prototype.lastIndexOf( searchElement[, fromIndex] ) + Returns the last index at which a given element can be found. + + If method does not find a search element, the method returns `-1`. + + Parameters + ---------- + searchElement: Complex64 + Search element. + + fromIndex: integer (optional) + Array index at which to start the search. If provided a negative value, + the method resolves the start index relative to the last array element. + Default: out.length-1. + + Returns + ------- + out: integer + Array index or `-1`. + + Examples + -------- + > var arr = new {{alias}}( [ 1.0, -1.0, 2.0, -2.0, 3.0, -3.0, 1.0, -1.0 ] ) + + > var idx = arr.lastIndexOf( new {{alias:@stdlib/complex/float32}}( 1.0, -1.0 ) ) + 3 + > idx = arr.lastIndexOf( new {{alias:@stdlib/complex/float32}}( 1.0, -1.0 ), 2 ) + 0 + + +{{alias}}.prototype.map( clbk[, thisArg] ) + Returns a new array with each element being the result of a provided + callback function. + + A callback function is provided the following arguments: + - value: current array element. + - index: current array element index. + - arr: the array on which the method was called. + + The returned array has the same data type as the host array. + + Parameters + ---------- + clbk: Function + Function which maps array elements to elements in the new array. + + thisArg: Any (optional) + Execution context. + + Returns + ------- + out: Complex64Array + A new typed array. + + Examples + -------- + > function clbk( v ) { return new {{alias:@stdlib/complex/float32}}( {{alias:@stdlib/complex/realf}}( v ) * 2.0, {{alias:@stdlib/complex/imagf}}( v ) * 2.0 ); } + > var arr = new {{alias}}( [ 1.0, -1.0, 2.0, -2.0 ] ) + + > var out = arr.map( clbk ) + + > var z = out.get( 0 ) + + > var re = {{alias:@stdlib/complex/realf}}( z ) + 2.0 + > var im = {{alias:@stdlib/complex/imagf}}( z ) + -2.0 + > z = out.get( 1 ) + + > re = {{alias:@stdlib/complex/realf}}( z ) + 4.0 + > im = {{alias:@stdlib/complex/imagf}}( z ) + -4.0 + + +{{alias}}.prototype.reduce( reducerFn[, initialValue] ) + Applies a provided function to each element of the array, in order, passing + in the return value from the calculation on the preceding element and + returning the accumulated result upon completion. + + A reducer function is provided the following arguments: + - acc: accumulated result. + - value: current array element. + - index: current array element index. + - arr: the array on which the method was called. + + If provided an initial value, the method invokes a provided function with + the initial value as the first argument and the first array element as the + second argument. + + If not provided an initial value, the method invokes a provided function + with the first array element as the first argument and the second array + element as the second argument. + + Parameters + ---------- + reducerFn: Function + Function to apply to each array element. + + initialValue: any (optional) + Initial accumulation value. + + Returns + ------- + out: any + Accumulated result. + + Examples + -------- + > var arr = new {{alias}}( [ 1.0, -1.0, 2.0, -2.0 ] ) + + > var z = arr.reduce( {{alias:@stdlib/math/base/ops/caddf}} ) + + > var re = {{alias:@stdlib/complex/realf}}( z ) + 3.0 + > var im = {{alias:@stdlib/complex/imagf}}( z ) + -3.0 + + +{{alias}}.prototype.reduceRight( reducerFn[, initialValue] ) + Applies a provided function to each element of the array, in reverse order, + passing in the return value from the calculation on the preceding element + and returning the accumulated result upon completion. + + A reducer function is provided the following arguments: + - acc: accumulated result. + - value: current array element. + - index: current array element index. + - arr: the array on which the method was called. + + If provided an initial value, the method invokes a provided function with + the initial value as the first argument and the last array element as the + second argument. + + If not provided an initial value, the method invokes a provided function + with the last array element as the first argument and the second-to-last + array element as the second argument. + + Parameters + ---------- + reducerFn: Function + Function to apply to each array element. + + initialValue: any (optional) + Initial accumulation value. + + Returns + ------- + out: any + Accumulated result. + + Examples + -------- + > var arr = new {{alias}}( [ 1.0, -1.0, 2.0, -2.0 ] ) + + > var z = arr.reduceRight( {{alias:@stdlib/math/base/ops/caddf}} ) + + > var re = {{alias:@stdlib/complex/realf}}( z ) + 3.0 + > var im = {{alias:@stdlib/complex/imagf}}( z ) + -3.0 + + +{{alias}}.prototype.reverse() + Reverses the array *in-place*. + + This method mutates the array on which the method is invoked. + + Returns + ------- + out: Complex64Array + Modified array. + + Examples + -------- + > var arr = new {{alias}}( [ 1.0, -1.0, 2.0, -2.0, 3.0, -3.0 ] ) + + > arr.reverse(); + > var z = arr.get( 0 ) + + > var re = {{alias:@stdlib/complex/realf}}( z ) + 3.0 + > var im = {{alias:@stdlib/complex/imagf}}( z ) + -3.0 + > z = arr.get( 1 ) + + > re = {{alias:@stdlib/complex/realf}}( z ) + 2.0 + > im = {{alias:@stdlib/complex/imagf}}( z ) + -2.0 + > z = arr.get( 2 ) + + > re = {{alias:@stdlib/complex/realf}}( z ) + 1.0 + > im = {{alias:@stdlib/complex/imagf}}( z ) + -1.0 + + +{{alias}}.prototype.set( z[, i] ) + Sets one or more array elements. + + If provided a single argument, the method sets array elements starting at + position (index) `i = 0`. To set elements starting elsewhere in the array, + provide an index argument `i`. + + To set one or more array elements, provide an array-like object containing + either complex numbers or interleaved real and imaginary components. + + Parameters + ---------- + z: Complex64|Complex64Array + Complex number or complex number array. + + i: integer (optional) + Array index at which to start setting elements. Default: 0. + + Examples + -------- + > var arr = new {{alias}}( 2 ) + + > arr.set( new {{alias:@stdlib/complex/float32}}( 1.0, -1.0 ) ); + > var z = arr.get( 0 ) + + > var re = {{alias:@stdlib/complex/realf}}( z ) + 1.0 + > var im = {{alias:@stdlib/complex/imagf}}( z ) + -1.0 + > arr.set( new {{alias:@stdlib/complex/float32}}( 2.0, -2.0 ), 1 ); + > z = arr.get( 1 ) + + > re = {{alias:@stdlib/complex/realf}}( z ) + 2.0 + > im = {{alias:@stdlib/complex/imagf}}( z ) + -2.0 + + +{{alias}}.prototype.slice( [start[, end]] ) + Copies a portion of a typed array to a new typed array. + + Parameters + ---------- + start: integer (optional) + Start index. If less than zero, the start index is resolved relative to + the last array element. Default: 0. + + end: integer (optional) + End index (non-inclusive). If less than zero, the end index is resolved + relative to the last array element. Default: out.length. + + Returns + ------- + out: Complex64Array + New typed array. + + Examples + -------- + > var arr = new {{alias}}( [ 1.0, -1.0, 2.0, -2.0, 3.0, -3.0 ] ) + + > var out = arr.slice( 1 ) + + > var len = out.length + 2 + > var z = out.get( 0 ) + + > var re = {{alias:@stdlib/complex/realf}}( z ) + 2.0 + > var im = {{alias:@stdlib/complex/imagf}}( z ) + -2.0 + > z = out.get( 1 ) + + > re = {{alias:@stdlib/complex/realf}}( z ) + 3.0 + > im = {{alias:@stdlib/complex/imagf}}( z ) + -3.0 + + +{{alias}}.prototype.some( predicate[, thisArg] ) + Returns a boolean indicating whether at least one element passes a test. + + A predicate function is provided the following arguments: + - value: current array element. + - index: current array element index. + - arr: the array on which the method was called. + + Parameters + ---------- + predicate: Function + Predicate function which tests array elements. If a predicate function + returns a truthy value, an array element passes; otherwise, an array + element fails. + + thisArg: Any (optional) + Execution context. + + Returns + ------- + bool: boolean + Boolean indicating whether at least one element passes the test. + + Examples + -------- + > function predicate( v ) { return ( {{alias:@stdlib/complex/realf}}( v ) === {{alias:@stdlib/complex/imagf}}( v ) ); } + > var arr = new {{alias}}( [ 1.0, -1.0, 2.0, 2.0, 3.0, -3.0 ] ) + + > var bool = arr.some( predicate ) + true + + +{{alias}}.prototype.sort( compareFunction ) + Sorts an array in-place. + + A comparison function determines the order of the array elements. The + function is provided two arguments: + - a: first element for comparison. + - b: second element for comparison. + + The function should return a value less than zero if `a` comes before `b`, + a value greater than zero if `a` comes after `b`, and zero if `a` and `b` + are equivalent. + + Parameters + ---------- + compareFunction: Function + Comparison function. + + Returns + ------- + out: Complex64Array + Modified array. + + Examples + -------- + > function compare( a, b ) { return ( {{alias:@stdlib/complex/realf}}( a ) - {{alias:@stdlib/complex/realf}}( b ) ); } + > var arr = new {{alias}}( [ 2.0, -2.0, 3.0, -3.0, 1.0, -1.0 ] ) + + > arr.sort( compare ); + > var z = arr.get( 0 ) + + > var re = {{alias:@stdlib/complex/realf}}( z ) + 1.0 + > var im = {{alias:@stdlib/complex/imagf}}( z ) + -1.0 + > z = arr.get( 1 ) + + > re = {{alias:@stdlib/complex/realf}}( z ) + 2.0 + > im = {{alias:@stdlib/complex/imagf}}( z ) + -2.0 + > z = arr.get( 2 ) + + > re = {{alias:@stdlib/complex/realf}}( z ) + 3.0 + > im = {{alias:@stdlib/complex/imagf}}( z ) + -3.0 + + +{{alias}}.prototype.subarray( [begin[, end]] ) + Creates a new typed array view over the same underlying `ArrayBuffer` and + with the same underlying data type as the host array. + + Parameters + ---------- + begin: integer (optional) + Start index. If less than zero, the start index is resolved relative to + the last array element. Default: 0. + + end: integer (optional) + End index (non-inclusive). If less than zero, the end index is resolved + relative to the last array element. Default: out.length. + + Returns + ------- + out: Complex64Array + New typed array view. + + Examples + -------- + > var arr = new {{alias}}( [ 1.0, -1.0, 2.0, -2.0, 3.0, -3.0, 4.0, -4.0 ] ) + + > var out = arr.subarray( 1, 3 ) + + > var len = out.length + 2 + > var z = out.get( 0 ) + + > var re = {{alias:@stdlib/complex/realf}}( z ) + 2.0 + > var im = {{alias:@stdlib/complex/imagf}}( z ) + -2.0 + > z = out.get( 1 ) + + > re = {{alias:@stdlib/complex/realf}}( z ) + 3.0 + > im = {{alias:@stdlib/complex/imagf}}( z ) + -3.0 + + +{{alias}}.prototype.toLocaleString( [locales[, options]] ) + Serializes an array as a locale-specific string. + + Parameters + ---------- + locales: string|array (optional) + Locale identifier(s). + + options: Object (optional) + An object literal containing serialization options. + + Returns + ------- + str: string + Local-specific string. + + Examples + -------- + > var arr = new {{alias}}( [ 1.0, 1.0, 2.0, 2.0 ] ) + + > var str = arr.toLocaleString() + '1 + 1i,2 + 2i' + + +{{alias}}.prototype.toReversed() + Returns a new typed array containing the elements in reversed order. + + Returns + ------- + out: Complex64Array + New typed array. + + Examples + -------- + > var arr = new {{alias}}( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] ) + + > var out = arr.toReversed() + + > var z = out.get( 0 ) + + > var re = {{alias:@stdlib/complex/realf}}( z ) + 3.0 + > var im = {{alias:@stdlib/complex/imagf}}( z ) + 3.0 + > z = out.get( 1 ) + + > re = {{alias:@stdlib/complex/realf}}( z ) + 2.0 + > im = {{alias:@stdlib/complex/imagf}}( z ) + 2.0 + > z = out.get( 2 ) + + > re = {{alias:@stdlib/complex/realf}}( z ) + 1.0 + > im = {{alias:@stdlib/complex/imagf}}( z ) + 1.0 + + +{{alias}}.prototype.toSorted( compareFcn ) + Returns a new typed array containing the elements in sorted order. + + A comparison function determines the order of the array elements. The + function is provided two arguments: + - a: first element for comparison. + - b: second element for comparison. + + The function should return a value less than zero if `a` comes before `b`, + a value greater than zero if `a` comes after `b`, and zero if `a` and `b` + are equivalent. + + Parameters + ---------- + compareFcn: Function + Comparison function. + + Returns + ------- + out: Complex64Array + New typed array. + + Examples + -------- + > function compare( a, b ) { return ( {{alias:@stdlib/complex/realf}}( a ) - {{alias:@stdlib/complex/realf}}( b ) ); } + > var arr = new {{alias}}( [ 2.0, -2.0, 3.0, -3.0, 1.0, -1.0 ] ) + + > var out = arr.toSorted( compare ); + > var z = out.get( 0 ) + + > var re = {{alias:@stdlib/complex/realf}}( z ) + 1.0 + > var im = {{alias:@stdlib/complex/imagf}}( z ) + -1.0 + > z = out.get( 1 ) + + > re = {{alias:@stdlib/complex/realf}}( z ) + 2.0 + > im = {{alias:@stdlib/complex/imagf}}( z ) + -2.0 + > z = out.get( 2 ) + + > re = {{alias:@stdlib/complex/realf}}( z ) + 3.0 + > im = {{alias:@stdlib/complex/imagf}}( z ) + -3.0 + + +{{alias}}.prototype.toString() + Serializes an array as a string. + + Returns + ------- + str: string + String serialization of the array. + + Examples + -------- + > var arr = new {{alias}}( [ 1.0, 1.0, 2.0, -2.0, 3.0, 3.0 ] ) + + > var str = arr.toString() + '1 + 1i,2 - 2i,3 + 3i' + + +{{alias}}.prototype.values() + Returns an iterator for iterating over each value in a typed array. + + Returns + ------- + iterator: Iterator + Iterator for iterating over array values. + + Examples + -------- + > var arr = new {{alias}}( [ 1.0, -1.0, 2.0, -2.0 ] ) + + > var it = arr.values(); + > var v = it.next().value + + > var re = {{alias:@stdlib/complex/realf}}( v ) + 1.0 + > var im = {{alias:@stdlib/complex/imagf}}( v ) + -1.0 + > v = it.next().value + + > re = {{alias:@stdlib/complex/realf}}( v ) + 2.0 + > im = {{alias:@stdlib/complex/imagf}}( v ) + -2.0 + > var bool = it.next().done + true + + +{{alias}}.prototype.with( index, value ) + Returns a new typed array with the element at a provided index replaced + with a provided value. + + Parameters + ---------- + index: integer + Element index. + + value: Complex64 + Element value. + + Returns + ------- + out: Complex64Array + New typed array. + + Examples + -------- + > var arr = new {{alias}}( [ 1.0, -1.0, 2.0, -2.0 ] ) + + > var out = arr.with( 1, new {{alias:@stdlib/complex/float32}}( 3.0, -3.0 ) ) + + > var z = out.get( 1 ) + + > var re = {{alias:@stdlib/complex/realf}}( z ) + 3.0 + > var im = {{alias:@stdlib/complex/imagf}}( z ) + -3.0 + + + See Also + -------- From da2ec1dd9666e982e12754b33d94dcb95b73326a Mon Sep 17 00:00:00 2001 From: Athan Date: Wed, 29 May 2024 10:31:25 -0700 Subject: [PATCH 2/4] Apply suggestions from code review Signed-off-by: Athan --- .../@stdlib/array/complex64/docs/repl.txt | 70 ++++++++++--------- 1 file changed, 38 insertions(+), 32 deletions(-) diff --git a/lib/node_modules/@stdlib/array/complex64/docs/repl.txt b/lib/node_modules/@stdlib/array/complex64/docs/repl.txt index a5c81c505d38..fe63ba4ba9f8 100644 --- a/lib/node_modules/@stdlib/array/complex64/docs/repl.txt +++ b/lib/node_modules/@stdlib/array/complex64/docs/repl.txt @@ -19,7 +19,7 @@ Parameters ---------- length: integer - Complex array length. + Typed array length. Returns ------- @@ -100,7 +100,7 @@ > var len = arr1.length 2 - > var buf = [ new {{alias:@stdlib/complex/float32}}( 1.0, -1.0 ), new {{alias:@stdlib/complex/float32}}( 2.0, -2.0 )] + > var buf = [ new {{alias:@stdlib/complex/float32/ctor}}( 1.0, -1.0 ), new {{alias:@stdlib/complex/float32/ctor}}( 2.0, -2.0 )] > var arr2 = new {{alias}}( buf ) > len = arr2.length @@ -197,7 +197,7 @@ element1: number (optional) Array element. - elementN: number (optional) + elementN: ...number (optional) Array elements. Returns @@ -211,8 +211,8 @@ > var len = arr.length 2 - > var z1 = new {{alias:@stdlib/complex/float32}}( 1.0, -1.0 ) - > var z2 = new {{alias:@stdlib/complex/float32}}( 2.0, -2.0 ) + > var z1 = new {{alias:@stdlib/complex/float32/ctor}}( 1.0, -1.0 ) + > var z2 = new {{alias:@stdlib/complex/float32/ctor}}( 2.0, -2.0 ) > arr = {{alias}}.of( z1, z2 ) > len = arr.length @@ -306,14 +306,14 @@ {{alias}}.prototype.at( i ) Returns an array element located at integer position (index) `i`, with - support for noth nonnegative and negative integer position. + support for noth nonnegative and negative integer positions. If provided an index outside the array index range, the method returns `undefined`. Parameters ---------- - i: number + i: integer Element index. Returns @@ -428,7 +428,7 @@ Examples -------- - > function predicate( v ) { return ( v.re > 0.0 ); } + > function predicate( v ) { return ( {{alias:@stdlib/complex/realf}}( v ) > 0.0 ); } > var arr = new {{alias}}( [ 1.0, -1.0, 2.0, -2.0 ] ) > var bool = arr.every( predicate ) @@ -460,7 +460,7 @@ -------- > var arr = new {{alias}}( 3 ) - > arr.fill( new {{alias:@stdlib/complex/float32}}( 1.0, 1.0 ) ); + > arr.fill( new {{alias:@stdlib/complex/float32/ctor}}( 1.0, 1.0 ) ); > var z = arr.get( 0 ) > var re = {{alias:@stdlib/complex/realf}}( z ) @@ -486,15 +486,13 @@ implemented by a predicate function. A predicate function is provided the following arguments: + - value: current array element. - index: current array element index. - arr: the array on which the method was called. The returned array has the same data type as the host array. - If a predicate function does not return a truthy value for any array - element, the method returns `null`. - Parameters ---------- predicate: Function @@ -532,6 +530,7 @@ returns a truthy value. A predicate function is provided the following arguments: + - value: current array element. - index: current array element index. - arr: the array on which the method was called. @@ -570,6 +569,7 @@ function returns a truthy value. A predicate function is provided the following arguments: + - value: current array element. - index: current array element index. - arr: the array on which the method was called. @@ -642,6 +642,7 @@ function returns a truthy value. A predicate function is provided the following arguments: + - value: current array element. - index: current array element index. - arr: the array on which the method was called. @@ -675,6 +676,7 @@ Invokes a function once for each array element. A callback function is provided the following arguments: + - value: current array element. - index: current array element index. - arr: the array on which the method was called. @@ -690,12 +692,12 @@ Examples -------- > var str = ''; - > function clbk( v ) { str += v.toString() + ' '; } + > function clbk( v ) { str += v.toString() + ', '; } > var arr = new {{alias}}( [ 1.0, -1.0, 2.0, -2.0 ] ) - > arr.forEach( clbk ) + > arr.forEach( clbk ); > str - '1 - 1i 2 - 2i ' + '1 - 1i, 2 - 2i ' {{alias}}.prototype.get( i ) @@ -748,9 +750,9 @@ -------- > var arr = new {{alias}}( [ 1.0, -1.0, 2.0, -2.0, 3.0, -3.0, 4.0, -4.0 ] ) - > var bool = arr.includes( new {{alias:@stdlib/complex/float32}}( 3.0, -3.0 ) ) + > var bool = arr.includes( new {{alias:@stdlib/complex/float32/ctor}}( 3.0, -3.0 ) ) true - > bool = arr.includes( new {{alias:@stdlib/complex/float32}}( 3.0, -3.0 ), 3 ) + > bool = arr.includes( new {{alias:@stdlib/complex/float32/ctor}}( 3.0, -3.0 ), 3 ) false @@ -778,9 +780,9 @@ -------- > var arr = new {{alias}}( [ 1.0, -1.0, 2.0, -2.0, 3.0, -3.0, 4.0, -4.0 ] ) - > var idx = arr.indexOf( new {{alias:@stdlib/complex/float32}}( 3.0, -3.0 ) ) + > var idx = arr.indexOf( new {{alias:@stdlib/complex/float32/ctor}}( 3.0, -3.0 ) ) 2 - > idx = arr.indexOf( new {{alias:@stdlib/complex/float32}}( 3.0, -3.0 ), 3 ) + > idx = arr.indexOf( new {{alias:@stdlib/complex/float32/ctor}}( 3.0, -3.0 ), 3 ) -1 @@ -853,9 +855,9 @@ -------- > var arr = new {{alias}}( [ 1.0, -1.0, 2.0, -2.0, 3.0, -3.0, 1.0, -1.0 ] ) - > var idx = arr.lastIndexOf( new {{alias:@stdlib/complex/float32}}( 1.0, -1.0 ) ) + > var idx = arr.lastIndexOf( new {{alias:@stdlib/complex/float32/ctor}}( 1.0, -1.0 ) ) 3 - > idx = arr.lastIndexOf( new {{alias:@stdlib/complex/float32}}( 1.0, -1.0 ), 2 ) + > idx = arr.lastIndexOf( new {{alias:@stdlib/complex/float32/ctor}}( 1.0, -1.0 ), 2 ) 0 @@ -864,6 +866,7 @@ callback function. A callback function is provided the following arguments: + - value: current array element. - index: current array element index. - arr: the array on which the method was called. @@ -885,7 +888,7 @@ Examples -------- - > function clbk( v ) { return new {{alias:@stdlib/complex/float32}}( {{alias:@stdlib/complex/realf}}( v ) * 2.0, {{alias:@stdlib/complex/imagf}}( v ) * 2.0 ); } + > function clbk( v ) { return v; } > var arr = new {{alias}}( [ 1.0, -1.0, 2.0, -2.0 ] ) > var out = arr.map( clbk ) @@ -893,15 +896,15 @@ > var z = out.get( 0 ) > var re = {{alias:@stdlib/complex/realf}}( z ) - 2.0 + 1.0 > var im = {{alias:@stdlib/complex/imagf}}( z ) - -2.0 + -1.0 > z = out.get( 1 ) > re = {{alias:@stdlib/complex/realf}}( z ) - 4.0 + 2.0 > im = {{alias:@stdlib/complex/imagf}}( z ) - -4.0 + -2.0 {{alias}}.prototype.reduce( reducerFn[, initialValue] ) @@ -910,6 +913,7 @@ returning the accumulated result upon completion. A reducer function is provided the following arguments: + - acc: accumulated result. - value: current array element. - index: current array element index. @@ -1039,7 +1043,7 @@ Parameters ---------- - z: Complex64|Complex64Array + z: Complex64|Complex64Array|ArrayLikeObject Complex number or complex number array. i: integer (optional) @@ -1049,14 +1053,14 @@ -------- > var arr = new {{alias}}( 2 ) - > arr.set( new {{alias:@stdlib/complex/float32}}( 1.0, -1.0 ) ); + > arr.set( new {{alias:@stdlib/complex/float32/ctor}}( 1.0, -1.0 ) ); > var z = arr.get( 0 ) > var re = {{alias:@stdlib/complex/realf}}( z ) 1.0 > var im = {{alias:@stdlib/complex/imagf}}( z ) -1.0 - > arr.set( new {{alias:@stdlib/complex/float32}}( 2.0, -2.0 ), 1 ); + > arr.set( new {{alias:@stdlib/complex/float32/ctor}}( 2.0, -2.0 ), 1 ); > z = arr.get( 1 ) > re = {{alias:@stdlib/complex/realf}}( z ) @@ -1109,6 +1113,7 @@ Returns a boolean indicating whether at least one element passes a test. A predicate function is provided the following arguments: + - value: current array element. - index: current array element index. - arr: the array on which the method was called. @@ -1231,11 +1236,11 @@ Parameters ---------- - locales: string|array (optional) + locales: string|Array (optional) Locale identifier(s). options: Object (optional) - An object literal containing serialization options. + An object containing serialization options. Returns ------- @@ -1289,6 +1294,7 @@ A comparison function determines the order of the array elements. The function is provided two arguments: + - a: first element for comparison. - b: second element for comparison. @@ -1398,7 +1404,7 @@ -------- > var arr = new {{alias}}( [ 1.0, -1.0, 2.0, -2.0 ] ) - > var out = arr.with( 1, new {{alias:@stdlib/complex/float32}}( 3.0, -3.0 ) ) + > var out = arr.with( 1, new {{alias:@stdlib/complex/float32/ctor}}( 3.0, -3.0 ) ) > var z = out.get( 1 ) From a7bfb5f9073217a399fbdaf438c9ebf8ca06559c Mon Sep 17 00:00:00 2001 From: Athan Date: Wed, 29 May 2024 10:32:09 -0700 Subject: [PATCH 3/4] Apply suggestions from code review Signed-off-by: Athan --- lib/node_modules/@stdlib/array/complex64/docs/repl.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/node_modules/@stdlib/array/complex64/docs/repl.txt b/lib/node_modules/@stdlib/array/complex64/docs/repl.txt index fe63ba4ba9f8..c26227b4caaf 100644 --- a/lib/node_modules/@stdlib/array/complex64/docs/repl.txt +++ b/lib/node_modules/@stdlib/array/complex64/docs/repl.txt @@ -604,6 +604,7 @@ a truthy value. A predicate function is provided the following arguments: + - value: current array element. - index: current array element index. - arr: the array on which the method was called. @@ -958,6 +959,7 @@ and returning the accumulated result upon completion. A reducer function is provided the following arguments: + - acc: accumulated result. - value: current array element. - index: current array element index. @@ -1147,6 +1149,7 @@ A comparison function determines the order of the array elements. The function is provided two arguments: + - a: first element for comparison. - b: second element for comparison. From d0d2c647505786868b44ae7800ade3da4d8021fa Mon Sep 17 00:00:00 2001 From: Athan Date: Wed, 29 May 2024 10:37:01 -0700 Subject: [PATCH 4/4] Apply suggestions from code review Signed-off-by: Athan --- lib/node_modules/@stdlib/array/complex64/docs/repl.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/node_modules/@stdlib/array/complex64/docs/repl.txt b/lib/node_modules/@stdlib/array/complex64/docs/repl.txt index c26227b4caaf..aec3c26e5163 100644 --- a/lib/node_modules/@stdlib/array/complex64/docs/repl.txt +++ b/lib/node_modules/@stdlib/array/complex64/docs/repl.txt @@ -692,13 +692,13 @@ Examples -------- - > var str = ''; - > function clbk( v ) { str += v.toString() + ', '; } + > var str = '%'; + > function clbk( v ) { str += v.toString() + '%'; } > var arr = new {{alias}}( [ 1.0, -1.0, 2.0, -2.0 ] ) > arr.forEach( clbk ); > str - '1 - 1i, 2 - 2i ' + '%1 - 1i%2 - 2i%' {{alias}}.prototype.get( i )