time-to-botec

Benchmark sampling in different programming languages
Log | Files | Refs | README

index.js (2199B)


      1 /**
      2 * @license Apache-2.0
      3 *
      4 * Copyright (c) 2020 The Stdlib Authors.
      5 *
      6 * Licensed under the Apache License, Version 2.0 (the "License");
      7 * you may not use this file except in compliance with the License.
      8 * You may obtain a copy of the License at
      9 *
     10 *    http://www.apache.org/licenses/LICENSE-2.0
     11 *
     12 * Unless required by applicable law or agreed to in writing, software
     13 * distributed under the License is distributed on an "AS IS" BASIS,
     14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     15 * See the License for the specific language governing permissions and
     16 * limitations under the License.
     17 */
     18 
     19 'use strict';
     20 
     21 /**
     22 * BLAS level 1 routine to copy values from one complex single-precision floating-point vector to another complex single-precision floating-point vector.
     23 *
     24 * @module @stdlib/blas/base/ccopy
     25 *
     26 * @example
     27 * var Complex64Array = require( '@stdlib/array/complex64' );
     28 * var real = require( '@stdlib/complex/real' );
     29 * var imag = require( '@stdlib/complex/imag' );
     30 * var ccopy = require( '@stdlib/blas/base/ccopy' );
     31 *
     32 * var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
     33 * var y = new Complex64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );
     34 *
     35 * ccopy( x.length, x, 1, y, 1 );
     36 *
     37 * var z = y.get( 0 );
     38 * // returns <Complex64>
     39 *
     40 * var re = real( z );
     41 * // returns 1.0
     42 *
     43 * var im = imag( z );
     44 * // returns 2.0
     45 *
     46 * @example
     47 * var Complex64Array = require( '@stdlib/array/complex64' );
     48 * var real = require( '@stdlib/complex/real' );
     49 * var imag = require( '@stdlib/complex/imag' );
     50 * var ccopy = require( '@stdlib/blas/base/ccopy' );
     51 *
     52 * var x = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] );
     53 * var y = new Complex64Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );
     54 *
     55 * ccopy.ndarray( x.length, x, 1, 0, y, 1, 0 );
     56 *
     57 * var z = y.get( 0 );
     58 * // returns <Complex64>
     59 *
     60 * var re = real( z );
     61 * // returns 1.0
     62 *
     63 * var im = imag( z );
     64 * // returns 2.0
     65 */
     66 
     67 // MODULES //
     68 
     69 var join = require( 'path' ).join;
     70 var tryRequire = require( '@stdlib/utils/try-require' );
     71 var ccopy = require( './main.js' );
     72 
     73 
     74 // MAIN //
     75 
     76 var tmp = tryRequire( join( __dirname, './native.js' ) );
     77 if ( !(tmp instanceof Error) ) {
     78 	ccopy = tmp;
     79 }
     80 
     81 
     82 // EXPORTS //
     83 
     84 module.exports = ccopy;