1
      2
      3
      4
      5
      6
      7
      8
      9
     10
     11
     12
     13
     14
     15
     16
     17
     18
     19
     20
     21
     22
     23
     24
#include BLAS_HEADER
#include <ulmblas/level1/iamax.h>

extern "C" {

void
F77BLAS(idamax_sub)(const int       *n_,
                    const double    *x,
                    const int       *incX_,
                    int             *result_)
{
//
//  Dereference scalar parameters
//
    int n    = *n_;
    int incX = *incX_;

    if (incX<0) {
        x -= incX*(n-1);
    }
    *result_ = ulmBLAS::iamax(n, x, incX)+1;
}

// extern "C"