main.js (1835B)
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 // MODULES // 22 23 var mapBy = require( '@stdlib/strided/base/map-by' ); 24 var bessely1 = require( './../../../../base/special/bessely1' ); 25 26 27 // MAIN // 28 29 /** 30 * Computes the Bessel function of the second kind of order one for each element retrieved from an input strided array `x` via a callback function and assigns each result to an element in an output strided array `y`. 31 * 32 * @param {NonNegativeInteger} N - number of indexed elements 33 * @param {Collection} x - input array/collection 34 * @param {integer} strideX - `x` stride length 35 * @param {Collection} y - destination array/collection 36 * @param {integer} strideY - `y` stride length 37 * @param {Callback} clbk - callback 38 * @param {*} [thisArg] - callback execution context 39 * @returns {Collection} `y` 40 * 41 * @example 42 * function accessor( v ) { 43 * return v; 44 * } 45 * 46 * var x = [ 0.0, 1.0, 0.1, 0.25, 0.5 ]; 47 * var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; 48 * 49 * bessely1By( x.length, x, 1, y, 1, accessor ); 50 * 51 * console.log( y ); 52 * // => [ -Infinity, ~-0.781, ~-6.459, ~-2.704, ~-1.471 ] 53 */ 54 function bessely1By( N, x, strideX, y, strideY, clbk, thisArg ) { 55 return mapBy( N, x, strideX, y, strideY, bessely1, clbk, thisArg ); 56 } 57 58 59 // EXPORTS // 60 61 module.exports = bessely1By;