2.3.6 VectorMax

Description

VectorMax returns the value and index of the last element in the source vector whose value is greater than or equal to any previous vector element.

Prototype

fractional VectorMax (int numElems, fractional* srcV, int* maxIndex);

Arguments

Parameters

Description

numElems

Number of elements in the source vector

srcV

Pointer to the source vector

maxIndex

Pointer to the holder for the index of (last) maximum element

Returns

Maximum value in the vector.

Remarks

If srcV[i] = srcV[j] = maxVal, and i < j, then *maxIndex = j.

Source File

  • vmax_aa.s

Function Profile

DeviceProgram WordsCycles

PIC32A

10

32 + 4*(numElems - 1),

System resource usage

  • W0…W6 - used, not restored
  • REPEAT instruction(s) usage – None