repl.txt (4107B)
1 2 {{alias}}( N, x, strideX, y, strideY ) 3 Copies values from one complex single-precision floating-point vector to 4 another complex single-precision floating-point vector. 5 6 The `N` and `stride` parameters determine how values from `x` are copied 7 into `y`. 8 9 Indexing is relative to the first index. To introduce an offset, use typed 10 array views. 11 12 If `N` is less than or equal to `0`, the function returns `y` unchanged. 13 14 Parameters 15 ---------- 16 N: integer 17 Number of values to copy. 18 19 x: Complex64Array 20 Input array. 21 22 strideX: integer 23 Index increment for `x`. 24 25 y: Complex64Array 26 Destination array. 27 28 strideY: integer 29 Index increment for `y`. 30 31 Returns 32 ------- 33 y: Complex64Array 34 Input array `y`. 35 36 Examples 37 -------- 38 // Standard usage: 39 > var x = new {{alias:@stdlib/array/complex64}}( [ 1.0, 2.0, 3.0, 4.0 ] ); 40 > var y = new {{alias:@stdlib/array/complex64}}( [ 6.0, 7.0, 8.0, 9.0 ] ); 41 > {{alias}}( x.length, x, 1, y, 1 ); 42 > var z = y.get( 0 ); 43 > var re = {{alias:@stdlib/complex/real}}( z ) 44 1.0 45 > var im = {{alias:@stdlib/complex/imag}}( z ) 46 2.0 47 48 // Advanced indexing: 49 > x = new {{alias:@stdlib/array/complex64}}( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); 50 > y = new {{alias:@stdlib/array/complex64}}( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); 51 > var N = {{alias:@stdlib/math/base/special/floor}}( x.length / 2 ); 52 > {{alias}}( N, x, -2, y, 1 ); 53 > z = y.get( 0 ); 54 > re = {{alias:@stdlib/complex/real}}( z ) 55 5.0 56 > im = {{alias:@stdlib/complex/imag}}( z ) 57 6.0 58 59 // Using typed array views: 60 > var x0 = new {{alias:@stdlib/array/complex64}}( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); 61 > var y0 = new {{alias:@stdlib/array/complex64}}( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); 62 > var x1 = new {{alias:@stdlib/array/complex64}}( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); 63 > var y1 = new {{alias:@stdlib/array/complex64}}( y0.buffer, y0.BYTES_PER_ELEMENT*2 ); 64 > N = {{alias:@stdlib/math/base/special/floor}}( x0.length / 2 ); 65 > {{alias}}( N, x1, -2, y1, 1 ); 66 > z = y0.get( 2 ); 67 > re = {{alias:@stdlib/complex/real}}( z ) 68 7.0 69 > im = {{alias:@stdlib/complex/imag}}( z ) 70 8.0 71 72 73 {{alias}}.ndarray( N, x, strideX, offsetX, y, strideY, offsetY ) 74 Copies values from one complex single-precision floating-point vector to 75 another complex single-precision floating-point vector using alternative 76 indexing semantics. 77 78 While typed array views mandate a view offset based on the underlying 79 buffer, the `offset` parameters support indexing semantics based on starting 80 indices. 81 82 Parameters 83 ---------- 84 N: integer 85 Number of values to copy. 86 87 x: Complex64Array 88 Input array. 89 90 strideX: integer 91 Index increment for `x`. 92 93 offsetX: integer 94 Starting index for `x`. 95 96 y: Complex64Array 97 Destination array. 98 99 strideY: integer 100 Index increment for `y`. 101 102 offsetY: integer 103 Starting index for `y`. 104 105 Returns 106 ------- 107 y: Complex64Array 108 Input array `y`. 109 110 Examples 111 -------- 112 // Standard usage: 113 > var x = new {{alias:@stdlib/array/complex64}}( [ 1.0, 2.0, 3.0, 4.0 ] ); 114 > var y = new {{alias:@stdlib/array/complex64}}( [ 6.0, 7.0, 8.0, 9.0 ] ); 115 > {{alias}}.ndarray( x.length, x, 1, 0, y, 1, 0 ); 116 > var z = y.get( 0 ); 117 > var re = {{alias:@stdlib/complex/real}}( z ) 118 1.0 119 > var im = {{alias:@stdlib/complex/imag}}( z ) 120 2.0 121 122 // Advanced indexing: 123 > x = new {{alias:@stdlib/array/complex64}}( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); 124 > y = new {{alias:@stdlib/array/complex64}}( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); 125 > var N = {{alias:@stdlib/math/base/special/floor}}( x.length / 2 ); 126 > {{alias}}.ndarray( N, x, 2, 1, y, -1, y.length-1 ); 127 > z = y.get( y.length-1 ); 128 > re = {{alias:@stdlib/complex/real}}( z ) 129 3.0 130 > im = {{alias:@stdlib/complex/imag}}( z ) 131 4.0 132 133 See Also 134 -------- 135