User manual
647
mikoPascal PRO for dsPIC30/33 and PIC24
MikroElektronika
Vector_Max
Prototype
function Vector_Max(var Vector: array[1024] of word; numElems: word; var
MaxIndex: word): word;
Description This function nd maximal value in vector.
maxVal = max (srcV[n]), n є [0, numElems-1]
If srcV[i] = srcV[j] = maxVal, and i < j, then maxIndex = j.
Parameters - Vector: original vector
- numElems: number of elements in vector(s)
- MaxIndex: index of maximum value
Returns Minimum value (maxVal).
Requires Nothing.
Example
var vec1 : array[3] of word;
index, rslt : word;
rslt = Vector_Max(vec1, 3, index);
Notes - [W0..W5] used, not restored
Vector_Dot
Prototype
function Vector_Dot(var v1, v2: array[1024] of word; numElems: word):
word;
Description Function calculates vector dot product.
Parameters - v1: rst vector
- v2: second vector
- numElems: number of elements in vector(s)
Returns Dot product value:
Requires Nothing.
Example
var vec1 : array[3] of word;
rslt = Vector_Dot(vec1,vec1,3);
Notes - [W0..W2] used, not restored
- [W4..W5] used, not restored
- AccuA used, not restored
- CORCON saved, used, restored