You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Licensed under the Apache License, Version 2.0 (the "License");
212
+
* you may not use this file except in compliance with the License.
213
+
* You may obtain a copy of the License at
214
+
*
215
+
* http://www.apache.org/licenses/LICENSE-2.0
216
+
*
217
+
* Unless required by applicable law or agreed to in writing, software
218
+
* distributed under the License is distributed on an "AS IS" BASIS,
219
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
220
+
* See the License for the specific language governing permissions and
221
+
* limitations under the License.
222
+
*/
223
+
224
+
'use strict';
225
+
226
+
// MODULES //
227
+
228
+
var stride2offset = require('@stdlib/strided/base/stride2offset');
229
+
var ndarray = require('./ndarray.js');
230
+
231
+
232
+
// MAIN //
233
+
234
+
/**
235
+
* Scales a single-precision complex floating-point vector by a single-precision complex floating-point constant and adds the result to a single-precision complex floating-point vector.
236
+
*
237
+
* @param {PositiveInteger} N - number of indexed elements
238
+
* @param {Complex64} ca - scalar constant
239
+
* @param {Complex64Array} cx - first input array
240
+
* @param {integer} strideX - `cx` stride length
241
+
* @param {Complex64Array} cy - second input array
242
+
* @param {integer} strideY - `cy` stride length
243
+
* @returns {Complex64Array} second input array
244
+
*
245
+
* @example
246
+
* var Complex64Array = require( '@stdlib/array/complex64' );
247
+
* var Complex64 = require( '@stdlib/complex/float32/ctor' );
248
+
* var realf = require( '@stdlib/complex/realf' );
249
+
* var imagf = require( '@stdlib/complex/imagf' );
250
+
*
251
+
* var cx = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
252
+
* var cy = new Complex64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] );
253
+
* var ca = new Complex64( 2.0, 2.0 );
254
+
*
255
+
* caxpy( 3, ca, cx, 1, cy, 1 );
256
+
*
257
+
* var z = cy.get( 0 );
258
+
* // returns <Complex64>
259
+
*
260
+
* var re = realf( z );
261
+
* // returns -1.0
262
+
*
263
+
* var im = imagf( z );
264
+
* // returns 7.0
265
+
*/
266
+
function caxpy( N, ca, cx, strideX, cy, strideY ) {
267
+
var ix = stride2offset( N, strideX );
268
+
var iy = stride2offset( N, strideY );
269
+
return ndarray( N, ca, cx, strideX, ix, cy, strideY, iy );
270
+
}
271
+
272
+
273
+
// EXPORTS //
274
+
275
+
module.exports = caxpy;
276
+
</pre></td></tr></table></pre>
277
+
278
+
<divclass='push'></div><!-- for sticky footer -->
279
+
</div><!-- /wrapper -->
280
+
<divclass='footer quiet pad2 space-top1 center small'>
0 commit comments