MKL BLAS functions
==================

The `accelerate.mkl.blas` module contains a subset of BLAS functions
implemented by means of the underlying Intel MKL library.


Reference
---------

.. function:: accelerate.mkl.blas.dot(x, y)

	      Compute and return the vector dot product of `x` and `y`.

	      :param x: one-dimensional array
	      :param y: one-dimensional array
	      :rtype: result

	      :note: the input arguments may be copied to adjust their types.

.. function:: accelerate.mkl.blas.axpy(alpha, x, y)

	      :math:`y \leftarrow alpha*x + y`

	      :param alpha: a scalar
	      :param x: one-dimensional array
	      :param y: one-dimensional array
	      :rtype: one-dimensional array

	      :note: the input arguments may be copied to adjust their types.
	      :note: `y` is modified in-place only if it has the appropriate type.
		     See this example_.


.. function:: accelerate.mkl.blas.gemv(trans, alpha, A, x, beta=0., y=None)

	      Generalized matrix-vector multiplication:

	      :math:`y \leftarrow alpha*trans(A)*x + beta*y`

	      :param trans:

		:'n', 'N': :math:`trans(A)=A`
		:'t', 'T': :math:`trans(A)=A^T` (transpose of A)
		:'c', 'C': :math:`trans(A)=A^*` (Hermitian transpose of A)

	      :param alpha: a scalar
	      :param x: one-dimensional array
	      :param beta: a scalar
	      :param y: one-dimensional array
	      :rtype: one-dimensional array

	      :note: the input arguments may be copied to adjust their types,
		     as well as dimension-ordering to column-major.
	      :note: `y` is modified in-place only if it has the appropriate type.
		     See this example_.
		     The result is undefined if `y` aliases `A` or `x`.


.. function:: accelerate.mkl.blas.gemm(transa, transb, alpha, A, B, beta=0., C=None)

	      Generalized matrix-matrix multiplication:

	      :math:`C \leftarrow alpha*transa(A)*transb(B) + beta*C`

	      :param transa:

		:'n', 'N': :math:`transa(A)=A`
		:'t', 'T': :math:`transa(A)=A^T` (transpose of A)
		:'c', 'C': :math:`transa(A)=A^*` (Hermitian transpose of A)

	      :param transb:

		:'n', 'N': :math:`transb(B)=B`
		:'t', 'T': :math:`transb(B)=B^T` (transpose of B)
		:'c', 'C': :math:`transb(B)=B^*` (Hermitian transpose of B)

	      :param alpha: a scalar
	      :param A: two-dimensional array
	      :param B: two-dimensional array
	      :param beta: a scalar
	      :param C: two-dimensional array
	      :rtype: two-dimensional array

	      :note: the input arguments may be copied to adjust their types,
		     as well as dimension-ordering to column-major.
	      :note: `C` is modified in-place only if it has the appropriate type.
		     See this example_.
		     The result is undefined if `C` aliases `A` or `B`.

.. _example:

Example
-------

::

   alpha = 1.+1.j
   A = np.arange(16, dtype=np.float64).reshape(4,4)
   x = np.arange(4, dtype=np.float64)
   beta = 0.
   y = np.arange(4, dtype=np.float64)
   result = blas.gemv('N', alpha, A, x, beta, y)

As `alpha` is complex, the result of :math:`alpha*A*x + beta*y` will be complex, too, and thus can't be stored in `y`. Therefore `y` can't be modified in-place.
