return the larges component of vector and its index
function maxi input Real A[:]; output Real Y; output Integer index; end maxi;