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
     70
     71
     72
     73
     74
     75
#ifndef ULMBLAS_CXXBLAS_LEVEL3_TRMM_TCC
#define ULMBLAS_CXXBLAS_LEVEL3_TRMM_TCC 1

#include <ulmblas/cxxblas/level3/trmm.h>
#include <ulmblas/ulmblas.h>

namespace cxxblas {

template <typename IndexType, typename Alpha, typename TA, typename TB>
void
trmm(bool         left,
     IndexType    m,
     IndexType    n,
     const Alpha  &alpha,
     bool         lowerA,
     bool         transA,
     bool         conjA,
     bool         unitDiagA,
     const TA     *A,
     IndexType    incRowA,
     IndexType    incColA,
     TB           *B,
     IndexType    incRowB,
     IndexType    incColB)
{
    if (left) {
        if (lowerA) {
            if (!transA) {
                ulmBLAS::trlmm(m, n, alpha, conjA, unitDiagA,
                               A, incRowA, incColA,
                               B, incRowB, incColB);
            } else {
                ulmBLAS::trumm(m, n, alpha, conjA, unitDiagA,
                               A, incColA, incRowA,
                               B, incRowB, incColB);
            }
        } else {
            if (!transA) {
                ulmBLAS::trumm(m, n, alpha, conjA, unitDiagA,
                               A, incRowA, incColA,
                               B, incRowB, incColB);
            } else {
                ulmBLAS::trlmm(m, n, alpha, conjA, unitDiagA,
                               A, incColA, incRowA,
                               B, incRowB, incColB);
            }
        }
    } else {
        if (lowerA) {
            if (!transA) {
                ulmBLAS::trumm(n, m, alpha, conjA, unitDiagA,
                               A, incColA, incRowA,
                               B, incColB, incRowB);
            } else {
                ulmBLAS::trlmm(n, m, alpha, conjA, unitDiagA,
                               A, incRowA, incColA,
                               B, incColB, incRowB);
            }
        } else {
            if (!transA) {
                ulmBLAS::trlmm(n, m, alpha, conjA, unitDiagA,
                               A, incColA, incRowA,
                               B, incColB, incRowB);
            } else {
                ulmBLAS::trumm(n, m, alpha, conjA, unitDiagA,
                               A, incRowA, incColA,
                               B, incColB, incRowB);
            }
        }
    }
}

// namespace cxxblas

#endif // ULMBLAS_CXXBLAS_LEVEL3_TRMM_TCC