index.js (1859B)
1 /** 2 * @license Apache-2.0 3 * 4 * Copyright (c) 2021 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 * Compute the inverse half-value versed sine of each element retrieved from an input strided array `x` via a callback function and assign each result to an element in an output strided array `y`. 23 * 24 * @module @stdlib/math/strided/special/ahaversin-by 25 * 26 * @example 27 * var ahaversinBy = require( '@stdlib/math/strided/special/ahaversin-by' ); 28 * 29 * function accessor( v ) { 30 * return v; 31 * } 32 * 33 * var x = [ 0.0, 0.5, 1.0, 0.25, 0.75 ]; 34 * var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; 35 * 36 * ahaversinBy( x.length, x, 1, y, 1, accessor ); 37 * 38 * console.log( y ); 39 * // => [ 0.0, ~1.571, ~3.142, ~1.047, ~2.094 ] 40 * 41 * @example 42 * var ahaversinBy = require( '@stdlib/math/strided/special/ahaversin-by' ); 43 * 44 * function accessor( v ) { 45 * return v; 46 * } 47 * 48 * var x = [ 0.0, 0.5, 1.0, 0.25, 0.75 ]; 49 * var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; 50 * 51 * ahaversinBy.ndarray( x.length, x, 1, 0, y, 1, 0, accessor ); 52 * 53 * console.log( y ); 54 * // => [ 0.0, ~1.571, ~3.142, ~1.047, ~2.094 ] 55 */ 56 57 // MODULES // 58 59 var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); 60 var main = require( './main.js' ); 61 var ndarray = require( './ndarray.js' ); 62 63 64 // MAIN // 65 66 setReadOnly( main, 'ndarray', ndarray ); 67 68 69 // EXPORTS // 70 71 module.exports = main;