index.js (2157B)
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 * Round each element in a single-precision floating-point strided array `x` toward negative infinity according to a strided mask array and assign the results to elements in a single-precision floating-point strided array `y`. 23 * 24 * @module @stdlib/math/strided/special/smskfloor 25 * 26 * @example 27 * var Float32Array = require( '@stdlib/array/float32' ); 28 * var Uint8Array = require( '@stdlib/array/uint8' ); 29 * var smskfloor = require( '@stdlib/math/strided/special/smskfloor' ); 30 * 31 * var x = new Float32Array( [ 1.1, 2.5, -3.5, 4.0, -5.9 ] ); 32 * var m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); 33 * var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); 34 * 35 * smskfloor( x.length, x, 1, m, 1, y, 1 ); 36 * // y => <Float32Array>[ 1.0, 2.0, 0.0, 4.0, 0.0 ] 37 * 38 * @example 39 * var Float32Array = require( '@stdlib/array/float32' ); 40 * var Uint8Array = require( '@stdlib/array/uint8' ); 41 * var smskfloor = require( '@stdlib/math/strided/special/smskfloor' ); 42 * 43 * var x = new Float32Array( [ 1.1, 2.5, -3.5, 4.0, -5.9 ] ); 44 * var m = new Uint8Array( [ 0, 0, 1, 0, 1 ] ); 45 * var y = new Float32Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] ); 46 * 47 * smskfloor.ndarray( x.length, x, 1, 0, m, 1, 0, y, 1, 0 ); 48 * // y => <Float32Array>[ 1.0, 2.0, 0.0, 4.0, 0.0 ] 49 */ 50 51 // MODULES // 52 53 var join = require( 'path' ).join; 54 var tryRequire = require( '@stdlib/utils/try-require' ); 55 var main = require( './main.js' ); 56 57 58 // MAIN // 59 60 var tmp = tryRequire( join( __dirname, './native.js' ) ); 61 if ( !(tmp instanceof Error) ) { 62 main = tmp; 63 } 64 65 66 // EXPORTS // 67 68 module.exports = main;