def dot(a, b)
    a = NArray.asarray(a)
    b = NArray.asarray(b)
    case a.ndim
    when 1
      case b.ndim
      when 1
        func = blas_char(a, b) =~ /c|z/ ? :dotu : :dot
        Blas.call(func, a, b)
      else
        if b.contiguous?
          trans = 't'
        else
          if b.fortran_contiguous?
            trans = 'n'
            b = b.transpose
          else
            trans = 't'
            b = b.dup
          end
        end
        Blas.call(:gemv, b, a, trans:trans)
      end
    else
      case b.ndim
      when 1
        if a.contiguous?
          trans = 'n'
        else
          if a.fortran_contiguous?
            trans = 't'
            a = a.transpose
          else
            trans = 'n'
            a = a.dup
          end
        end
        Blas.call(:gemv, a, b, trans:trans)
      else
        if a.contiguous?
          transa = 'n'
        else
          if a.fortran_contiguous?
            transa = 't'
            a = a.transpose
          else
            transa = 'n'
            a = a.dup
          end
        end
        if b.contiguous?
          transb = 'n'
        else
          if b.fortran_contiguous?
            transb='t'
            b = b.transpose
          else
            transb='n'
            b = b.dup
          end
        end
        Blas.call(:gemm, a, b, transa:transa, transb:transb)
      end
    end
  end
def dot(a, b)
    a = NArray.asarray(a)
    b = NArray.asarray(b)
    case a.ndim
    when 1
      case b.ndim
      when 1
        func = blas_char(a, b) =~ /c|z/ ? :dotu : :dot
        Blas.call(func, a, b)
      else
        if b.contiguous?
          trans = 't'
        else
          if b.fortran_contiguous?
            trans = 'n'
            b = b.transpose
          else
            trans = 't'
            b = b.dup
          end
        end
        Blas.call(:gemv, b, a, trans:trans)
      end
    else
      case b.ndim
      when 1
        if a.contiguous?
          trans = 'n'
        else
          if a.fortran_contiguous?
            trans = 't'
            a = a.transpose
          else
            trans = 'n'
            a = a.dup
          end
        end
        Blas.call(:gemv, a, b, trans:trans)
      else
        if a.contiguous?
          transa = 'n'
        else
          if a.fortran_contiguous?
            transa = 't'
            a = a.transpose
          else
            transa = 'n'
            a = a.dup
          end
        end
        if b.contiguous?
          transb = 'n'
        else
          if b.fortran_contiguous?
            transb='t'
            b = b.transpose
          else
            transb='n'
            b = b.dup
          end
        end
        Blas.call(:gemm, a, b, transa:transa, transb:transb)
      end
    end
  end
module methods
 Matrix and vector products
 Dot product.
 @param a [Numo::NArray] matrix or vector (>= 1-dimensinal NArray)
 @param b [Numo::NArray] matrix or vector (>= 1-dimensinal NArray)
 @return [Numo::NArray] result of dot product