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