repl.txt (3985B)
1 2 {{alias}}( N, x, sx, m, sm, y, sy ) 3 Computes the reciprocal square root for each element in a double-precision 4 floating-point strided array `x` according to a strided mask array and 5 assigns the results to elements in a double-precision floating-point strided 6 array `y`. 7 8 The `N` and stride parameters determine which strided array elements are 9 accessed at runtime. 10 11 Indexing is relative to the first index. To introduce an offset, use typed 12 array views. 13 14 Parameters 15 ---------- 16 N: integer 17 Number of indexed elements. 18 19 x: Float64Array 20 Input array. 21 22 sx: integer 23 Index increment for `x`. 24 25 m: Uint8Array 26 Mask array. 27 28 sm: integer 29 Index increment for `m`. 30 31 y: Float64Array 32 Destination array. 33 34 sy: integer 35 Index increment for `y`. 36 37 Returns 38 ------- 39 y: Float64Array 40 Input array `y`. 41 42 Examples 43 -------- 44 // Standard usage: 45 > var x = new {{alias:@stdlib/array/float64}}( [ 0.0, 4.0, 9.0, 12.0 ] ); 46 > var m = new {{alias:@stdlib/array/uint8}}( [ 0, 0, 1, 0 ] ); 47 > var y = new {{alias:@stdlib/array/float64}}( [ 0.0, 0.0, 0.0, 0.0 ] ); 48 > {{alias}}( x.length, x, 1, m, 1, y, 1 ) 49 <Float64Array>[ Infinity, 0.5, 0.0, ~0.289 ] 50 51 // Using `N` and stride parameters: 52 > y = new {{alias:@stdlib/array/float64}}( [ 0.0, 0.0, 0.0, 0.0 ] ); 53 > {{alias}}( 2, x, 2, m, 2, y, -1 ) 54 <Float64Array>[ 0.0, Infinity, 0.0, 0.0 ] 55 56 // Using view offsets: 57 > var x0 = new {{alias:@stdlib/array/float64}}( [ 0.0, 4.0, 9.0, 12.0 ] ); 58 > var m0 = new {{alias:@stdlib/array/uint8}}( [ 0, 0, 1, 0 ] ); 59 > var y0 = new {{alias:@stdlib/array/float64}}( [ 0.0, 0.0, 0.0, 0.0 ] ); 60 > var x1 = new {{alias:@stdlib/array/float64}}( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); 61 > var m1 = new {{alias:@stdlib/array/uint8}}( m0.buffer, m0.BYTES_PER_ELEMENT*1 ); 62 > var y1 = new {{alias:@stdlib/array/float64}}( y0.buffer, y0.BYTES_PER_ELEMENT*2 ); 63 > {{alias}}( 2, x1, -2, m1, -2, y1, 1 ) 64 <Float64Array>[ ~0.289, 0.5 ] 65 > y0 66 <Float64Array>[ 0.0, 0.0, ~0.289, 0.5 ] 67 68 69 {{alias}}.ndarray( N, x, sx, ox, m, sm, om, y, sy, oy ) 70 Computes the reciprocal square root for each element in a double-precision 71 floating-point strided array `x` according to a strided mask array and 72 assigns the results to elements in a double-precision floating-point strided 73 array `y` using alternative indexing semantics. 74 75 While typed array views mandate a view offset based on the underlying 76 buffer, the offset parameters support indexing semantics based on starting 77 indices. 78 79 Parameters 80 ---------- 81 N: integer 82 Number of indexed elements. 83 84 x: Float64Array 85 Input array. 86 87 sx: integer 88 Index increment for `x`. 89 90 ox: integer 91 Starting index for `x`. 92 93 m: Float64Array 94 Mask array. 95 96 sm: integer 97 Index increment for `m`. 98 99 om: integer 100 Starting index for `m`. 101 102 y: Float64Array 103 Destination array. 104 105 sy: integer 106 Index increment for `y`. 107 108 oy: integer 109 Starting index for `y`. 110 111 Returns 112 ------- 113 y: Float64Array 114 Input array `y`. 115 116 Examples 117 -------- 118 // Standard usage: 119 > var x = new {{alias:@stdlib/array/float64}}( [ 0.0, 4.0, 9.0, 12.0 ] ); 120 > var m = new {{alias:@stdlib/array/uint8}}( [ 0, 0, 1, 0 ] ); 121 > var y = new {{alias:@stdlib/array/float64}}( [ 0.0, 0.0, 0.0, 0.0 ] ); 122 > {{alias}}.ndarray( x.length, x, 1, 0, m, 1, 0, y, 1, 0 ) 123 <Float64Array>[ Infinity, 0.5, 0.0, ~0.289 ] 124 125 // Advanced indexing: 126 > x = new {{alias:@stdlib/array/float64}}( [ 0.0, 4.0, 9.0, 12.0 ] ); 127 > m = new {{alias:@stdlib/array/uint8}}( [ 0, 0, 1, 0 ] ); 128 > y = new {{alias:@stdlib/array/float64}}( [ 0.0, 0.0, 0.0, 0.0 ] ); 129 > {{alias}}.ndarray( 2, x, 2, 1, m, 2, 1, y, -1, y.length-1 ) 130 <Float64Array>[ 0.0, 0.0, ~0.289, 0.5 ] 131 132 See Also 133 -------- 134