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
     68
     69
#ifndef ULMBLAS_CXXBLAS_LEVEL1_ROT_TCC
#define ULMBLAS_CXXBLAS_LEVEL1_ROT_TCC 1

#include <ulmblas/cxxblas/level1/rot.h>
#include <ulmblas/impl/level1/rot.h>

namespace cxxblas {

template <typename A, typename B, typename T>
void
rotg(A &a,
     B &b,
     T &c,
     T &s)
{
    ulmBLAS::rotg(a, b, c, s);
}

template <typename TA, typename TB, typename T>
void
rotg(std::complex<TA>   &a,
     std::complex<TB>   &b,
     T                  &c,
     std::complex<T>    &s)
{
    ulmBLAS::rotg(a, b, c, s);
}

template <typename IndexType, typename VX, typename VY, typename T>
void
rot(IndexType   n,
    VX          *x,
    IndexType   incX,
    VY          *y,
    IndexType   incY,
    T           c,
    T           s)
{
    if (incX<0) {
        x -= incX*(n-1);
    }
    if (incY<0) {
        y -= incY*(n-1);
    }
    ulmBLAS::rot(n, x, incX, y, incY, c, s);
}

template <typename IndexType, typename X, typename Y, typename T>
void
rot(IndexType              n,
    std::complex<X>        *x,
    IndexType              incX,
    std::complex<Y>        *y,
    IndexType              incY,
    T                      c,
    const std::complex<T>  &s)
{
    if (incX<0) {
        x -= incX*(n-1);
    }
    if (incY<0) {
        y -= incY*(n-1);
    }
    ulmBLAS::rot(n, x, incX, y, incY, c, s);
}

// namespace cxxblas

#endif // ULMBLAS_CXXBLAS_LEVEL1_ROT_TCC