/* * @license Apache-2.0 * * Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // TypeScript Version: 4.1 /** * Interface describing `idamax`. */ interface Routine { /** * Finds the index of the first element having the maximum absolute value. * * @param N - number of indexed elements * @param x - input array * @param strideX - stride length for `x` * @returns index value * * @example * var Float64Array = require( '@stdlib/array/float64' ); * * var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); * * var idx = idamax( x.length, x, 1 ); * // returns 3 */ ( N: number, x: Float64Array, strideX: number ): number; /** * Finds the index of the first element having the maximum absolute value using alternative indexing semantics. * * @param N - number of indexed elements * @param x - input array * @param strideX - stride length for `x` * @param offsetX - starting index for `x` * @returns index value * * @example * var Float64Array = require( '@stdlib/array/float64' ); * * var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); * * var idx = idamax.ndarray( x.length, x, 1, 0 ); * // returns 3 */ ndarray( N: number, x: Float64Array, strideX: number, offsetX: number ): number; } /** * Finds the index of the first element having the maximum absolute value. * * @param N - number of indexed elements * @param x - input array * @param strideX - stride length for `x` * @returns index value * * @example * var Float64Array = require( '@stdlib/array/float64' ); * * var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); * * var idx = idamax( 4, x, 2 ); * // returns 2 * * @example * var Float64Array = require( '@stdlib/array/float64' ); * * var x = new Float64Array( [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ] ); * * var idx = idamax.ndarray( x.length, x, 1, 0 ); * // returns 3 */ declare var idamax: Routine; // EXPORTS // export = idamax;