1
      2
      3
      4
      5
      6
      7
      8
      9
     10
     11
     12
     13
     14
     15
     16
     17
     18
     19
     20
     21
     22
     23
     24
     25
     26
     27
     28
     29
     30
     31
     32
     33
     34
     35
     36
     37
     38
     39
     40
     41
     42
     43
     44
     45
     46
     47
     48
     49
     50
     51
     52
     53
     54
     55
     56
     57
     58
     59
     60
     61
     62
     63
     64
     65
     66
     67
#include <algorithm>
#include <cctype>
#include BLAS_HEADER
#include <interfaces/blas/F77/xerbla.h>
#include <ulmblas/level2/ger.h>

#include <cstdio>
#include <ulmblas/auxiliary/printmatrix.h>

extern "C" {

void
F77BLAS(dger)(const int         *m_,
              const int         *n_,
              const double      *alpha_,
              const double      *x,
              const int         *incX_,
              const double      *y,
              const int         *incY_,
              double            *A,
              const int         *ldA_)
{
//
//  Dereference scalar parameters
//
    int m        = *m_;
    int n        = *n_;
    double alpha = *alpha_;
    int incX     = *incX_;
    int incY     = *incY_;
    int ldA      = *ldA_;

//
//  Test the input parameters
//
    int info = 0;

    if (m<0) {
        info = 1;
    } else if (n<0) {
            info = 2;
    } else if (incX==0) {
            info = 5;
    } else if (incY==0) {
            info = 7;
    } else if (ldA<std::max(1,m)) {
            info = 9;
    }

    if (info!=0) {
        F77BLAS(xerbla)("DGER  ", &info);
    }

//
//  Start the operations.
//
    if (incX<0) {
        x -= incX*(m-1);
    }
    if (incY<0) {
        y -= incY*(n-1);
    }

    ulmBLAS::ger(m, n, alpha, x, incX, y, incY, A, 1, ldA);
}

// extern "C"