LinearAlgebra`BLAS`
LinearAlgebra`BLAS`

IAMAX

IAMAX[x]

gives the position of the element with the maximum absolute value in a vector x.

Details and Options

  • To use IAMAX, you first need to load the BLAS Package using Needs["LinearAlgebra`BLAS`"].
  • The following argument must be given:
  • xinput expressionvector
  • For complex vectors x, IAMAX locates the element with the greatest sum of absolute values of the real and imaginary parts.
  • If x contains non-numeric elements, then IAMAX[x] always returns $Failed.
  • For duplicate entries the first position found is returned.

Examples

open allclose all

Basic Examples  (1)

Load the BLAS package:

Find the position of the element with the largest absolute value in a vector:

Scope  (4)

A real vector:

A complex vector:

An arbitrary-precision vector:

Vectors with symbolic entries will return $Failed:

Properties & Relations  (1)

IAMAX[x] is equivalent to Part[Position[Abs[x],Max[Abs[x]]],1,1] for real-valued vectors:

A similar relation is true for complex-valued vectors :

Possible Issues  (2)

If there are multiple elements with the same maximum absolute value, the position of the first one is returned:

If a vector contains a symbol, IAMAX returns $Failed:

Wolfram Research (2017), IAMAX, Wolfram Language function, https://reference.wolfram.com/language/LowLevelLinearAlgebra/ref/IAMAX.html.

Text

Wolfram Research (2017), IAMAX, Wolfram Language function, https://reference.wolfram.com/language/LowLevelLinearAlgebra/ref/IAMAX.html.

CMS

Wolfram Language. 2017. "IAMAX." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/LowLevelLinearAlgebra/ref/IAMAX.html.

APA

Wolfram Language. (2017). IAMAX. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/LowLevelLinearAlgebra/ref/IAMAX.html

BibTeX

@misc{reference.wolfram_2023_iamax, author="Wolfram Research", title="{IAMAX}", year="2017", howpublished="\url{https://reference.wolfram.com/language/LowLevelLinearAlgebra/ref/IAMAX.html}", note=[Accessed: 28-March-2024 ]}

BibLaTeX

@online{reference.wolfram_2023_iamax, organization={Wolfram Research}, title={IAMAX}, year={2017}, url={https://reference.wolfram.com/language/LowLevelLinearAlgebra/ref/IAMAX.html}, note=[Accessed: 28-March-2024 ]}