# Source code for naginterfaces.library.blas

# -*- coding: utf-8 -*-
r"""
Module Summary
--------------
Interfaces for the NAG Mark 30.1 blas Chapter.

blas - Linear Algebra Support Routines

This module is concerned with basic linear algebra functions which perform elementary algebraic operations involving scalars, vectors and matrices.
It includes functions which conform to the specifications of the BLAS (Basic Linear Algebra Subprograms).

Functionality Index
-------------------

**Level 0 (Scalar) operations**

complex numbers

apply similarity rotation to :math:2\times 2 Hermitian matrix: :meth:zrot2

generate a plane rotation, storing the tangent, real cosine: :meth:zrotgc

generate a plane rotation, storing the tangent, real sine: :meth:zrotgs

quotient of two numbers, with overflow flag: :meth:zdiv

recover cosine and sine from given tangent, real cosine: :meth:zcsg

recover cosine and sine from given tangent, real sine: :meth:zcsgs

real numbers

apply similarity rotation to :math:2\times 2 symmetric matrix: :meth:drot2

compute :math:\sqrt{\left(a^2+b^2\right)}: :meth:dpyth

compute Euclidean norm from scaled form: :meth:dnorm

eigenvalue of :math:2\times 2 symmetric matrix: :meth:deig2

generate a Jacobi plane rotation: :meth:drotj

generate a plane rotation: :meth:drotg

generate a plane rotation storing the tangent: :meth:drotgc

quotient of two numbers, with overflow flag: :meth:ddiv

recover cosine and sine from given tangent: :meth:dcsg

**Level 1 (Vector) operations**

complex vector(s)

add scalar times a vector to another vector: :meth:zaxpy

apply a complex plane rotation: :meth:zcrot

apply an elementary reflection to a vector: :meth:zhous

apply a real plane rotation: :meth:zdrot

apply plane rotation

real cosine, complex sine: :meth:zrot

broadcast a scalar into a vector: :meth:zload

copy a real vector to a complex vector: :meth:zdcopy

copy a vector: :meth:zcopy

dot product of two vectors, conjugated: :meth:zdotc

dot product of two vectors, unconjugated: :meth:zdotu

Euclidean norm of a vector: :meth:dznrm2

generate an elementary reflection: :meth:zhousg

generate a sequence of plane rotations: :meth:zsrotg

index of element of largest absolute value: :meth:izamax

multiply vector by a complex scalar: :meth:zscal

multiply vector by a complex scalar, preserving input vector: :meth:zaxpzy

multiply vector by a real scalar: :meth:zdscal

multiply vector by a real scalar, preserving input vector: :meth:zdaxpzy

multiply vector by complex diagonal matrix: :meth:zdscl

multiply vector by real diagonal matrix: :meth:zddscl

multiply vector by reciprocal of a real scalar: :meth:zdrscl

negate a vector: :meth:znegv

sum of absolute values of vector-elements: :meth:dzasum

swap two vectors: :meth:zswap

update Euclidean norm in scaled form: :meth:dzssq

integer vector(s)

broadcast a scalar into a vector: :meth:iload

copy a vector: :meth:icopy

real vector(s)

add scalar times a vector to another vector: :meth:daxpy

apply an elementary reflection to a vector (Linpack style): :meth:dlhous

apply an elementary reflection to a vector (NAG style): :meth:dnhous

apply a symmetric plane rotation to two vectors: :meth:drots

apply plane rotation: :meth:drot

broadcast a scalar into a vector: :meth:dload

copy a vector: :meth:dcopy

cosine of angle between two vectors: :meth:dvcos

dot product of two vectors: :meth:ddot

elements of largest and smallest absolute value: :meth:darang

Euclidean norm of a vector: :meth:dnrm2

generate an elementary reflection (Linpack style): :meth:dlhousg

generate an elementary reflection (NAG style): :meth:dnhousg

generate a sequence of plane rotations: :meth:dsrotg

index of element of largest absolute value: :meth:idamax

index of last non-negligible element: :meth:idrank

multiply vector by a scalar: :meth:dscal

multiply vector by a scalar, preserving input vector: :meth:axpzy

multiply vector by diagonal matrix: :meth:ddscl

multiply vector by reciprocal of a scalar: :meth:drscl

negate a vector: :meth:dnegv

sum of absolute values of vector-elements: :meth:dasum

swap two vectors: :meth:dswap

update Euclidean norm in scaled form: :meth:dssq

weighted Euclidean norm of a vector: :meth:dnrm2w

**Level 2 (Matrix-vector and matrix) operations**

complex matrix and vector(s)

apply sequence of plane rotations to a rectangular matrix

complex cosine, real sine: :meth:zgesrs

real cosine, complex sine: :meth:zgesrc

real cosine and sine: :meth:zsgesr

compute a norm or the element of largest absolute value

band matrix: :meth:zlangb

general matrix: :meth:zlange

Hermitian band matrix: :meth:zlanhb

Hermitian matrix: :meth:zlanhe

Hermitian matrix, packed form: :meth:zlanhp

Hermitian matrix, RFP format: :meth:zlanhf

Hermitian tridiagonal matrix: :meth:zlanht

Hessenberg matrix: :meth:zlanhs

symmetric band matrix: :meth:zlansb

symmetric matrix: :meth:zlansy

symmetric matrix, packed form: :meth:zlansp

trapezoidal matrix: :meth:zlantr

triangular band matrix: :meth:zlantb

triangular matrix, packed form: :meth:zlantp

tridiagonal matrix: :meth:zlangt

compute upper Hessenberg matrix by applying sequence of plane rotations to an upper triangular matrix: :meth:zutsrh

compute upper spiked matrix by applying sequence of plane rotations to an upper triangular matrix: :meth:zutsrs

matrix initialization: :meth:zmload

matrix-vector product

Hermitian band matrix: :meth:zhbmv

Hermitian matrix: :meth:zhemv

Hermitian packed matrix: :meth:zhpmv

rectangular band matrix: :meth:zgbmv

rectangular matrix: :meth:zgemv

symmetric matrix: :meth:zsymv

symmetric packed matrix: :meth:zspmv

triangular band matrix: :meth:ztbmv

triangular matrix: :meth:ztrmv

triangular packed matrix: :meth:ztpmv

permute rows or columns of a matrix

permutations represented by an integer array: :meth:zgeap

permutations represented by a real array: :meth:zgeapr

:math:QR factorization by sequence of plane rotations

of rank-1 update of upper triangular matrix: :meth:zutr1

of upper triangular matrix augmented by a full row: :meth:zutupd

:math:QR factorization of :math:UZ or :math:RQ factorization of :math:ZU, where :math:U is upper triangular and :math:Z is a sequence of plane rotations: :meth:zutsqr

:math:QR or :math:RQ factorization by sequence of plane rotations

of upper Hessenberg matrix: :meth:zuhqr

of upper spiked matrix: :meth:zusqr

rank-1 update

Hermitian matrix: :meth:zher

Hermitian packed matrix: :meth:zhpr

rectangular matrix, conjugated vector: :meth:zgerc

rectangular matrix, unconjugated vector: :meth:zgeru

symmetric matrix: :meth:zsyr

symmetric packed matrix: :meth:zspr

rank-2 update

Hermitian matrix: :meth:zher2

Hermitian packed matrix: :meth:zhpr2

matrix copy, rectangular or trapezoidal: :meth:zmcopy

solution of a system of equations

triangular band matrix: :meth:ztbsv

triangular matrix: :meth:ztrsv

triangular packed matrix: :meth:ztpsv

unitary similarity transformation of a Hermitian matrix

as sequence of plane rotations: :meth:zhesrc

real matrix and vector(s)

apply sequence of plane rotations to a rectangular matrix: :meth:dgesrc

compute a norm or the element of largest absolute value

band matrix: :meth:dlangb

general matrix: :meth:dlange

Hessenberg matrix: :meth:dlanhs

matrix initialization: :meth:dmload

symmetric band matrix: :meth:dlansb

symmetric matrix: :meth:dlansy

symmetric matrix, packed form: :meth:dlansp

symmetric matrix, RFP format: :meth:dlansf

symmetric tridiagonal matrix: :meth:dlanst

trapezoidal matrix: :meth:dlantr

triangular band matrix: :meth:dlantb

triangular matrix, packed form: :meth:dlantp

tridiagonal matrix: :meth:dlangt

compute upper Hessenberg matrix by applying sequence of plane rotations to an upper triangular matrix: :meth:dutsrh

compute upper spiked matrix by applying sequence of plane rotations to an upper triangular matrix: :meth:dutsrs

matrix-vector product

rectangular band matrix: :meth:dgbmv

rectangular matrix: :meth:dgemv

symmetric band matrix: :meth:dsbmv

symmetric matrix: :meth:dsymv

symmetric packed matrix: :meth:dspmv

triangular band matrix: :meth:dtbmv

triangular matrix: :meth:dtrmv

triangular packed matrix: :meth:dtpmv

orthogonal similarity transformation of a symmetric matrix

as sequence of plane rotations: :meth:dsysrc

permute rows or columns of a matrix

permutations represented by an integer array: :meth:dgeap

permutations represented by a real array: :meth:dgeapr

:math:QR factorization by sequence of plane rotations

of rank-1 update of upper triangular matrix: :meth:dutr1

of upper triangular matrix augmented by a full row: :meth:dutupd

:math:QR factorization of :math:UZ or :math:RQ factorization of :math:ZU, where :math:U is upper triangular and :math:Z is a sequence of plane rotations: :meth:dutsqr

:math:QR or :math:RQ factorization by sequence of plane rotations

of upper Hessenberg matrix: :meth:duhqr

of upper spiked matrix: :meth:dusqr

rank-1 update

rectangular matrix: :meth:dger

symmetric matrix: :meth:dsyr

symmetric packed matrix: :meth:dspr

rank-2 update

matrix copy, rectangular or trapezoidal: :meth:dmcopy

symmetric matrix: :meth:dsyr2

symmetric packed matrix: :meth:dspr2

solution of a system of equations

triangular band matrix: :meth:dtbsv

triangular matrix: :meth:dtrsv

triangular packed matrix: :meth:dtpsv

**Level 3 (Matrix-matrix) operations**

complex matrices

matrix-matrix product

one matrix Hermitian: :meth:zhemm

one matrix symmetric: :meth:zsymm

one matrix triangular: :meth:ztrmm

two rectangular matrices: :meth:zgemm

rank-:math:2k update

of a Hermitian matrix: :meth:zher2k

of a symmetric matrix: :meth:zsyr2k

rank-:math:k update

of a Hermitian matrix: :meth:zherk

of a Hermitian matrix, RFP format: :meth:zhfrk

of a symmetric matrix: :meth:zsyrk

solution of triangular systems of equations: :meth:ztrsm

solution of triangular systems of equations, RFP format: :meth:ztfsm

real matrices

matrix-matrix product

one matrix symmetric: :meth:dsymm

one matrix triangular: :meth:dtrmm

rectangular matrices: :meth:dgemm

rank-:math:2k update of a symmetric matrix: :meth:dsyr2k

rank-:math:k update

of a symmetric matrix: :meth:dsyrk

of a symmetric matrix, RFP format: :meth:dsfrk

solution of triangular systems of equations: :meth:dtrsm

solution of triangular systems of equations, RFP format: :meth:dtfsm

**Sparse level 1 (vector) operations**

complex vector(s)

add scalar times sparse vector to a full vector: :meth:zaxpyi

dot product of a sparse and a full vector (conjugated): :meth:zdotci

dot product of a sparse and a full vector (unconjugated): :meth:zdotui

gather and set to zero a sparse vector: :meth:zgthrz

gather sparse vector: :meth:zgthr

scatter sparse vector: :meth:zsctr

real vector(s)

add scalar times sparse vector to a full vector: :meth:daxpyi

apply plane rotation to a sparse and a full vector: :meth:droti

dot product of a sparse and a full vector: :meth:ddoti

gather and set to zero a sparse vector: :meth:dgthrz

gather sparse vector: :meth:dgthr

scatter sparse vector: :meth:dsctr

For full information please refer to the NAG Library document

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06intro.html
"""

[docs]def drotg(a, b):
r"""
drotg generates a real Givens plane rotation.

.. _f06aa-py2-py-doc:

For full information please refer to the NAG Library document for f06aa

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06aaf.html

.. _f06aa-py2-py-parameters:

**Parameters**
**a** : float
The value :math:a, the first element of the vector which determines the rotation.

**b** : float
The value :math:b, the second element of the vector which determines the rotation.

**Returns**
**a** : float
The value :math:d.

**b** : float
The value :math:z, from which :math:c and :math:s can be reconstructed.

**c** : float
The value :math:c, the cosine of the rotation.

**s** : float
The value :math:s, the sine of the rotation.

.. _f06aa-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

drotg generates a real Givens plane rotation with parameters :math:c and :math:s, such that, given real :math:a and :math:b:

.. math::
\begin{pmatrix}c&s\\-s&c\end{pmatrix}\begin{pmatrix}a\\b\end{pmatrix} = \begin{pmatrix}d\\0\end{pmatrix}\text{.}

The function computes :math:c, :math:s and :math:d as follows:

.. math::
d = \sigma \sqrt{a^2+b^2}\text{;}

.. math::
c = \left\{\begin{array}{ll}a/d\text{,}&\text{if } d\neq 0\text{,}\\1\text{,}&\text{if } d = 0\text{,}\end{array}\right. \quad \text{ }\quad s = \left\{\begin{array}{ll}b/d\text{,}&\text{if } d\neq 0\text{,}\\0\text{,}&\text{if } d = 0\text{,}\end{array}\right.

.. math::
\text{where }\quad \sigma = \left\{\begin{array}{ll}\mathrm{sign}\left(a\right)\text{,}&\text{if }\left\lvert a\right\rvert > \left\lvert b\right\rvert \text{,}\\\mathrm{sign}\left(b\right)\text{,}&\text{if }\left\lvert a\right\rvert \leq \left\lvert b\right\rvert \text{.}\end{array}\right.

The function also computes the value :math:z defined as

.. math::
z = \left\{\begin{array}{ll}s\text{,}&\text{if }\left\lvert s\right\rvert < c\text{ or }c = 0\text{,}\\1/c\text{,}&\text{if }0 < \left\lvert c\right\rvert \leq s\text{.}\end{array}\right.

This enables :math:c and :math:s to be reconstructed from the single value :math:z as

.. math::
c = \left\{\begin{array}{ll}\sqrt{1-z^2}\text{,}&\text{if }\left\lvert z\right\rvert \leq 1\text{,}\\1/z\text{,}&\text{if }\left\lvert z\right\rvert > 1\text{,}\end{array}\right. \quad \text{ }\quad s = \left\{\begin{array}{ll}z\text{,}&\text{if }\left\lvert z\right\rvert \leq 1\text{,}\\\sqrt{1-c^2}\text{,}&\text{if }\left\lvert z\right\rvert > 1\text{.}\end{array}\right.

To apply the plane rotation to a pair of real vectors, call :meth:drot; to apply it to a pair of complex vectors, call :meth:zdrot.
"""
raise NotImplementedError

[docs]def drotgc(a, b):
r"""
drotgc generates a real Givens plane rotation and the tangent of that rotation.

.. _f06ba-py2-py-doc:

For full information please refer to the NAG Library document for f06ba

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06baf.html

.. _f06ba-py2-py-parameters:

**Parameters**
**a** : float
The value :math:a, the first element of the vector which determines the rotation.

**b** : float
The value :math:b, the second element of the vector which determines the rotation.

**Returns**
**a** : float
The value :math:d.

**b** : float
The value :math:t, the tangent of the rotation.

**c** : float
The value :math:c, the cosine of the rotation.

**s** : float
The value :math:s, the sine of the rotation.

.. _f06ba-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

drotgc generates a real Givens plane rotation with parameters :math:c (:math:\text{}\geq 0) and :math:s, such that, given real :math:a and :math:b:

.. math::
\begin{pmatrix}c&s\\-s&c\end{pmatrix}\begin{pmatrix}a\\b\end{pmatrix} = \begin{pmatrix}d\\0\end{pmatrix}\text{.}

On exit, :math:b is overwritten by :math:t, the tangent of the rotation; :math:c and :math:s can be reconstructed from the single stored value :math:t, by a subsequent call to :meth:dcsg.

If :math:\left\lvert b\right\rvert < \sqrt{\epsilon }\left\lvert a\right\rvert, where :math:\epsilon is the machine precision, the function sets :math:c = 1 and :math:s = 0; if :math:\left\lvert a\right\rvert < \sqrt{\epsilon }\left\lvert b\right\rvert, the function sets :math:c = 0 and :math:s = \mathrm{sign}\left(b\right)/a.

Note that :math:t is always set to :math:b/a, unless this would overflow, in which case the value :math:\textit{flmax}\times \mathrm{sign}\left(b\right)/a is returned, where :math:\textit{flmax} is the value given by :math:1/\left(\texttt{machine.real_safe}\right).

To apply the plane rotation to a pair of real vectors, call :meth:drot; to apply it to a pair of complex vectors, call :meth:zdrot.
"""
raise NotImplementedError

[docs]def dcsg(t):
r"""
dcsg reconstructs the parameters :math:c and :math:s of a real plane rotation from the tangent of that rotation.

.. _f06bc-py2-py-doc:

For full information please refer to the NAG Library document for f06bc

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06bcf.html

.. _f06bc-py2-py-parameters:

**Parameters**
**t** : float
The value :math:t, the tangent of the rotation.

**Returns**
**c** : float
The value :math:c, the cosine of the rotation.

**s** : float
The value :math:s, the sine of the rotation.

.. _f06bc-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

dcsg reconstructs the parameters :math:c and :math:s of a real plane rotation from the value of the tangent :math:t, as returned by :meth:drotgc:

.. math::
c = \frac{1}{{\sqrt{1+t^2}}}\text{, }\quad s = ct\text{,}

so that :math:c\geq 0 and :math:s has the same sign as :math:t.

If :math:\left\lvert t\right\rvert < \sqrt{\epsilon }, where :math:\epsilon is the machine precision, the function sets :math:c = 1 and :math:s = t; if :math:\left\lvert t\right\rvert > 1/\sqrt{\epsilon }, the function sets :math:c = \frac{1}{{\left\lvert t\right\rvert }} and :math:s = \mathrm{sign}\left(t\right).
"""
raise NotImplementedError

[docs]def drotj(job, x, y, z):
r"""
drotj generates a real Jacobi plane rotation.

.. _f06be-py2-py-doc:

For full information please refer to the NAG Library document for f06be

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06bef.html

.. _f06be-py2-py-parameters:

**Parameters**
**job** : str, length 1
Specifies the property which determines the precise form of the rotation.

:math:\mathrm{job} = \texttt{'B'}

:math:c\geq 1/\sqrt{2}.

:math:\mathrm{job} = \texttt{'S'}

:math:0\leq c\leq 1/\sqrt{2}.

:math:\mathrm{job} = \texttt{'M'}

:math:\left\lvert a\right\rvert \geq \left\lvert b\right\rvert.

**x** : float
The value :math:x, the :math:\left(1, 1\right) element of the input matrix.

**y** : float
The value :math:y, the :math:\left(1, 2\right) or :math:\left(2, 1\right) element of the input matrix.

**z** : float
The value :math:z. the :math:\left(2, 2\right) element of the input matrix.

**Returns**
**x** : float
The value :math:a.

**y** : float
The value :math:t, the tangent of the rotation.

**z** : float
The value :math:b.

**c** : float
The value :math:c, the cosine of the rotation.

**s** : float
The value :math:s, the sine of the rotation.

.. _f06be-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{job}.

Constraint: :math:\mathrm{job} = \texttt{'B'}, :math:\texttt{'S'} or :math:\texttt{'M'}.

.. _f06be-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

drotj generates a real Jacobi plane rotation with parameters :math:c and :math:s, which diagonalizes a given :math:2\times 2 real symmetric matrix:

.. math::
\begin{pmatrix}c&s\\-s&c\end{pmatrix}\begin{pmatrix}x&y\\y&z\end{pmatrix}\begin{pmatrix}c&-s\\s&c\end{pmatrix} = \begin{pmatrix}a&0\\0&b\end{pmatrix}\text{.}
"""
raise NotImplementedError

[docs]def drot2(x, y, z, c, s):
r"""
drot2 applies a real similarity rotation to a :math:2\times 2 real symmetric matrix.

.. _f06bh-py2-py-doc:

For full information please refer to the NAG Library document for f06bh

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06bhf.html

.. _f06bh-py2-py-parameters:

**Parameters**
**x** : float
The value :math:x, the :math:\left(1, 1\right) element of the input matrix.

**y** : float
The value :math:y, the :math:\left(1, 2\right) or :math:\left(2, 1\right) element of the input matrix.

**z** : float
The value :math:z, the :math:\left(2, 2\right) element of the input matrix.

**c** : float
The value :math:c, the cosine of the rotation.

**s** : float
The value :math:s, the sine of the rotation.

**Returns**
**x** : float
The transformed value :math:x.

**y** : float
The transformed value :math:y.

**z** : float
The transformed value :math:z.

.. _f06bh-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

drot2 applies a real similarity rotation, with parameters :math:c and :math:s, to a given :math:2\times 2 real symmetric matrix; that is, it performs the operation:

.. math::
\begin{pmatrix}x&y\\y&z\end{pmatrix}←\begin{pmatrix}c&s\\-s&c\end{pmatrix}\begin{pmatrix}x&y\\y&z\end{pmatrix}\begin{pmatrix}c&-s\\s&c\end{pmatrix}\text{.}
"""
raise NotImplementedError

[docs]def ddiv(a, b):
r"""
ddiv computes the quotient of two real scalars.

.. _f06bl-py2-py-doc:

For full information please refer to the NAG Library document for f06bl

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06blf.html

.. _f06bl-py2-py-parameters:

**Parameters**
**a** : float
The value :math:a.

**b** : float
The value :math:b.

**Returns**
**div** : float
The quotient of the two real scalars.

**fail** : bool
:math:\mathbf{True} if :math:a/b would overflow (in which case :math:\left\lvert q\right\rvert = \textit{flmax}) or :math:a = b = 0 (in which case :math:q = 0); otherwise :math:\mathbf{False}.

.. _f06bl-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

ddiv returns the value :math:q, where

.. math::
q = \left\{\begin{array}{ll}a/b\text{,}&\text{if }a/b\text{ does not overflow,}\\0\text{,}&\text{if }a = 0\text{,}\\\textit{flmax}\times \mathrm{sign}\left(a/b\right)\text{,}&\text{if }a\neq 0\text{ and }a/b\text{ would overflow.}\end{array}\right.

Here :math:\textit{flmax} is the large value given by :math:1/\left(\texttt{machine.real_safe}\right), and :math:\mathrm{sign}\left(a/0\right) is taken as :math:\mathrm{sign}\left(a\right).
"""
raise NotImplementedError

[docs]def dnorm(scal, ssq):
r"""
dnorm completes the safe computation of the Euclidean length of a vector, following a call to :meth:dssq or :meth:dzssq.

.. _f06bm-py2-py-doc:

For full information please refer to the NAG Library document for f06bm

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06bmf.html

.. _f06bm-py2-py-parameters:

**Parameters**
**scal** : float
The scaling factor :math:\alpha, returned by :meth:dssq or :meth:dzssq.

**ssq** : float
The scaled sum of squares :math:\xi, returned by :meth:dssq or :meth:dzssq.

**Returns**
**nrm2** : float
The Euclidean length of the vector.

.. _f06bm-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{scal}.

Constraint: :math:\mathrm{scal}\geq 0.0.

(errno :math:2)
On entry, error in parameter :math:\mathrm{ssq}.

Constraint: :math:\mathrm{ssq}\geq 1.0.

.. _f06bm-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

dnorm completes the safe computation of the Euclidean length of a vector, following a call to :meth:dssq or :meth:dzssq which return values :math:\alpha and :math:\xi such that

.. math::
\left\lVert x\right\rVert_2^2 = \alpha^2\xi \text{.}

dnorm returns the value

.. math::
\mathrm{min}\left({\alpha \sqrt{\xi }}, \textit{flmax}\right)\text{,}

where :math:\textit{flmax} is the value given by :math:1/\left(\texttt{machine.real_safe}\right).
"""
raise NotImplementedError

[docs]def dpyth(a, b):
r"""
dpyth returns the value :math:\sqrt{a^2+b^2}.

.. _f06bn-py2-py-doc:

For full information please refer to the NAG Library document for f06bn

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06bnf.html

.. _f06bn-py2-py-parameters:

**Parameters**
**a** : float
The value :math:a.

**b** : float
The value :math:b.

**Returns**
**p** : float
The value :math:\sqrt{a^2+b^2}.

.. _f06bn-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.
"""
raise NotImplementedError

[docs]def deig2(a, b, c):
r"""
deig2 returns an eigenvalue of a :math:2\times 2 real symmetric matrix.

.. _f06bp-py2-py-doc:

For full information please refer to the NAG Library document for f06bp

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06bpf.html

.. _f06bp-py2-py-parameters:

**Parameters**
**a** : float
The value :math:a, the :math:\left(1, 1\right) element of the input matrix.

**b** : float
The value :math:b, the :math:\left(1, 2\right) or :math:\left(2, 1\right) element of the input matrix.

**c** : float
The value :math:c, the :math:\left(2, 2\right) element of the input matrix.

**Returns**
**ev** : float
The eigenvalue.

.. _f06bp-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

deig2 returns an eigenvalue of the :math:2\times 2 real symmetric matrix

.. math::
\begin{pmatrix}a&b\\b&c\end{pmatrix}\text{,}\text{.}

The result is intended for use as a shift in symmetric eigenvalue functions.

The eigenvalue is computed as

.. math::
c-\frac{b}{{f+\mathrm{sign}\left(f\right)\times \sqrt{1+f^2}}}\text{,}

where :math:f = \frac{{a-c}}{{2b}}.

This is the eigenvalue nearer to :math:c if :math:a\neq c, and is equal to :math:c-b if :math:a = c.
"""
raise NotImplementedError

[docs]def zrotgc(a, b):
r"""
zrotgc generates a complex Givens plane rotation having real cosine.

.. _f06ca-py2-py-doc:

For full information please refer to the NAG Library document for f06ca

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06caf.html

.. _f06ca-py2-py-parameters:

**Parameters**
**a** : complex
The value :math:a, the first element of the vector which determines the rotation.

**b** : complex
The value :math:b, the second element of the vector which determines the rotation.

**Returns**
**a** : complex
The value :math:d.

**b** : complex
The value :math:t, the tangent of the rotation.

**c** : float
The value :math:c, the cosine of the rotation.

**s** : complex
The value :math:s, the sine of the rotation.

.. _f06ca-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

zrotgc generates a complex Givens plane rotation with parameters :math:c (real :math:\text{}\geq 0) and :math:s (complex), such that, given complex :math:a and :math:b:

.. math::
\begin{pmatrix}c&\bar{s}\\-s&c\end{pmatrix}\begin{pmatrix}a\\b\end{pmatrix} = \begin{pmatrix}d\\0\end{pmatrix}\text{.}

If :math:a is real, then :math:d is also real.
On exit, :math:b is overwritten by :math:t, the tangent of the rotation; :math:c and :math:s can be reconstructed from the single stored value :math:t, by a subsequent call to :meth:zcsg.

If :math:\left\lvert b\right\rvert < \epsilon \left\lvert a\right\rvert, where :math:\epsilon is the machine precision, the function sets :math:c = 1 and :math:s = t.

Note that :math:t is always set to :math:b/a, unless overflow would occur, in which case the function returns the value of the complex expression

.. math::
\left({\textit{flmax}\times \mathrm{sign}\left(\mathrm{Re}\left(b\right)/a\right)}, {\textit{flmax}\times \mathrm{sign}\left(\mathrm{Im}\left(b\right)/a\right)}\right)\text{;}

:math:\textit{flmax} is the float value given by :math:1/\left(\texttt{machine.real_safe}\right).
"""
raise NotImplementedError

[docs]def zrotgs(a, b):
r"""
zrotgs generates a complex Givens plane rotation having real sine.

.. _f06cb-py2-py-doc:

For full information please refer to the NAG Library document for f06cb

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06cbf.html

.. _f06cb-py2-py-parameters:

**Parameters**
**a** : complex
The value :math:a, the first element of the vector which determines the rotation.

**b** : complex
The value :math:b, the second element of the vector which determines the rotation.

**Returns**
**a** : complex
The value :math:d.

**b** : complex
The value :math:t, the tangent of the rotation.

**c** : complex
The value :math:c, the cosine of the rotation.

**s** : float
The value :math:s, the sine of the rotation.

.. _f06cb-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

zrotgs generates a complex Givens plane rotation with parameters :math:c (complex) and :math:s (real), such that, given complex :math:a and :math:b:

.. math::
\begin{pmatrix}\bar{c}&s\\-s&c\end{pmatrix}\begin{pmatrix}a\\b\end{pmatrix} = \begin{pmatrix}d\\0\end{pmatrix}\text{,}

If :math:b is real, then :math:d is also real.
On exit, :math:b is overwritten by :math:t, the tangent of the rotation; :math:c and :math:s can be reconstructed from the single stored value :math:t, by a subsequent call to :meth:zcsgs.

If :math:\left\lvert b\right\rvert < \epsilon \left\lvert a\right\rvert and :math:\mathrm{Im}\left(a\right) = 0, where :math:\epsilon is the machine precision, the function sets :math:c = 1 and :math:s = \left\lvert t\right\rvert.

If :math:\left\lvert b\right\rvert < \epsilon \left\lvert a\right\rvert and :math:\mathrm{Im}\left(a\right)\neq 0, the function sets

.. math::
c = \frac{{\mathrm{sign}\left(\mathrm{Re}\left(a\right)\right)a}}{{\left\lvert a\right\rvert }}\quad \text{ and }\quad s = \left\lvert t\right\rvert

Note that :math:t is always set to :math:b/a, unless overflow would occur, in which case the function returns the value of the complex expression

.. math::
\left({\textit{flmax}\times \mathrm{sign}\left(\mathrm{Re}\left(b\right)/a\right)}, {\textit{flmax}\times \mathrm{sign}\left(\mathrm{Im}\left(b\right)/a\right)}\right)\text{;}

:math:\textit{flmax} is the float value given by :math:1/\left(\texttt{machine.real_safe}\right).
"""
raise NotImplementedError

[docs]def zcsg(t):
r"""
zcsg reconstructs the parameters :math:c (real) and :math:s (complex) of a complex plane rotation from the tangent of that rotation.

.. _f06cc-py2-py-doc:

For full information please refer to the NAG Library document for f06cc

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06ccf.html

.. _f06cc-py2-py-parameters:

**Parameters**
**t** : complex
The value :math:t, the tangent of the rotation.

**Returns**
**c** : float
The value :math:c, the cosine of the rotation.

**s** : complex
The value :math:s, the sine of the rotation.

.. _f06cc-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

zcsg reconstructs the parameters :math:c (real) and :math:s (complex) of a complex plane rotation, from the value of the tangent :math:t, as returned by :meth:zrotgc:

.. math::
c = \frac{1}{{\sqrt{1+\left\lvert t\right\rvert^2}}}\text{, }\quad s = ct\text{,}

so that :math:c is always real and non-negative.

If :math:\left\lvert t\right\rvert < \sqrt{\epsilon }, where :math:\epsilon is the machine precision, the function sets :math:c = 1 and :math:s = t.
"""
raise NotImplementedError

[docs]def zcsgs(t):
r"""
zcsgs reconstructs the parameters :math:c (complex) and :math:s (real) of a complex plane rotation from the tangent of that rotation.

.. _f06cd-py2-py-doc:

For full information please refer to the NAG Library document for f06cd

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06cdf.html

.. _f06cd-py2-py-parameters:

**Parameters**
**t** : complex
The value :math:t, the tangent of the rotation.

**Returns**
**c** : complex
The value :math:c, the cosine of the rotation.

**s** : float
The value :math:s, the sine of the rotation.

.. _f06cd-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

zcsgs reconstructs the parameters :math:c (complex) and :math:s (real) of a complex plane rotation, from the value of the tangent :math:t, as returned by :meth:zrotgs:

.. math::
c = \frac{{\mathrm{sign}\left(\mathrm{Re}\left(t\right)\right)\left\lvert t\right\rvert }}{{t\sqrt{1+\left\lvert t\right\rvert^2}}}\text{, }\quad s = ct\text{.}

If :math:\left\lvert t\right\rvert < \sqrt{\epsilon }, where :math:\epsilon is the machine precision, the function sets:

.. math::
c = \frac{{\mathrm{sign}\left(\mathrm{Re}\left(t\right)\right)\left\lvert t\right\rvert }}{t}\text{, }\quad s = \mathrm{sign}\left(\mathrm{Re}\left(t\right)\right)\left\lvert t\right\rvert \text{.}
"""
raise NotImplementedError

[docs]def zrot2(x, y, z, c, s):
r"""
zrot2 applies a complex similarity rotation having real cosine and complex sine to a :math:2\times 2 complex Hermitian matrix.

.. _f06ch-py2-py-doc:

For full information please refer to the NAG Library document for f06ch

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06chf.html

.. _f06ch-py2-py-parameters:

**Parameters**
**x** : complex
The value :math:x, the :math:\left(1, 1\right) element of the input matrix.

**y** : complex
The value :math:y, the :math:\left(1, 2\right) element of the input matrix.

**z** : complex
The value :math:z, the :math:\left(2, 2\right) element of the input matrix.

**c** : float
The value :math:c, the cosine of the rotation.

**s** : complex
The value :math:s, the sine of the rotation.

**Returns**
**x** : complex
The transformed value :math:x.

**y** : complex
The transformed value :math:y.

**z** : complex
The transformed value :math:z.

.. _f06ch-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

zrot2 applies a complex similarity rotation, with parameters :math:c (real) and :math:s (complex), to a given :math:2\times 2 complex Hermitian matrix; that is, it performs the operation:

.. math::
\begin{pmatrix}x&y\\\bar{y}&z\end{pmatrix}←\begin{pmatrix}c&\bar{s}\\-s&c\end{pmatrix}\begin{pmatrix}x&y\\\bar{y}&z\end{pmatrix}\begin{pmatrix}c&-\bar{s}\\s&c\end{pmatrix}\text{,}

where :math:x and :math:z are real.

The argument :math:\mathrm{x} and :math:\mathrm{z} which hold :math:x and :math:z are declared complex for convenience when using the function to operate on submatrices of larger Hermitian matrices.

Note that:

.. math::
\begin{pmatrix}z&\bar{y}\\y&x\end{pmatrix}←\begin{pmatrix}c&\bar{w}\\-w&c\end{pmatrix}\begin{pmatrix}z&\bar{y}\\y&x\end{pmatrix}\begin{pmatrix}c&-\bar{w}\\w&c\end{pmatrix}\text{,}

where :math:w = -\bar{s}, so to use zrot2 when :math:y is the :math:\left(2, 1\right) element of the matrix, you can make the call to zrot2 using :math:\mathrm{s} = w
"""
raise NotImplementedError

[docs]def zdiv(a, b):
r"""
zdiv computes the quotient of two complex scalars.

.. _f06cl-py2-py-doc:

For full information please refer to the NAG Library document for f06cl

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06clf.html

.. _f06cl-py2-py-parameters:

**Parameters**
**a** : complex
The value :math:a.

**b** : complex
The value :math:b.

**Returns**
**sdiv** : complex
The value :math:q.

**fail** : bool
:math:\mathbf{True} if :math:a/b would overflow (in which case :math:\left\lvert \mathrm{Re}\left(q\right)\right\rvert = \left\lvert \mathrm{Im}\left(q\right)\right\rvert = \textit{flmax}) or :math:a = b = 0 (in which case :math:q = 0); otherwise :math:\mathbf{False}.

.. _f06cl-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

zdiv returns the value :math:q, where

.. math::
q = \left\{\begin{array}{ll}a/b\text{,}&\text{if }a/b\text{ does not overflow,}\\0\text{,}&\text{if }a = 0\text{,}\\\textit{cflmax}\text{,}&\text{if }a\neq 0\text{ and }a/b\text{ would overflow.}\end{array}\right.

Here :math:\textit{cflmax} is a large complex value, given by

.. math::
\textit{cflmax} = \left({\textit{flmax}\times \mathrm{sign}\left(\mathrm{Re}\left(a\right)/b\right)}, {\textit{flmax}\times \mathrm{sign}\left(\mathrm{Im}\left(a\right)/b\right)}\right)\text{;}

:math:\textit{flmax} is the float value given by :math:1/\left(\texttt{machine.real_safe}\right), and for float :math:x, :math:\mathrm{sign}\left(x/0\right) is taken as :math:\mathrm{sign}\left(x\right).
"""
raise NotImplementedError

r"""
iload broadcasts an integer scalar into an integer vector.

.. _f06db-py2-py-doc:

For full information please refer to the NAG Library document for f06db

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06dbf.html

.. _f06db-py2-py-parameters:

**Parameters**
**n** : int
:math:n, the number of elements in :math:x.

**con** : int
The scalar :math:\alpha.

**Returns**
**x** : int, ndarray, shape :math:\left(\mathrm{n}\right)
The elements :math:x_i of the vector :math:x.

.. _f06db-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:4)
On entry, error in parameter :math:\textit{incx}.

Constraint: :math:\textit{incx} > 0.

.. _f06db-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

iload performs the operation

.. math::
x←\left(\alpha, \alpha, \ldots, \alpha \right)^\mathrm{T}\text{,}

where :math:x is an :math:n-element integer vector.
"""
raise NotImplementedError

[docs]def icopy(x):
r"""
icopy copies an integer vector.

.. _f06df-py2-py-doc:

For full information please refer to the NAG Library document for f06df

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06dff.html

.. _f06df-py2-py-parameters:

**Parameters**
**x** : int, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:x.

**Returns**
**y** : int, ndarray, shape :math:\left(n\right)
The elements :math:y_i of the vector :math:y.

.. _f06df-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

icopy performs the operation

.. math::
y←x

where :math:x and :math:y are :math:n-element integer vectors.
"""
raise NotImplementedError

[docs]def ddot(x, y):
r"""
ddot computes the scalar product of two real vectors.

.. _f06ea-py2-py-doc:

For full information please refer to the NAG Library document for f06ea

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06eaf.html

.. _f06ea-py2-py-parameters:

**Parameters**
**x** : float, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:x.

**y** : float, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:y.

**Returns**
**d** : float
The scalar product.

.. _f06ea-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

ddot returns the value of the scalar product

.. math::
x^\mathrm{T}y

where :math:x and :math:y are :math:n-element real vectors.

.. _f06ea-py2-py-references:

**References**
Lawson, C L, Hanson, R J, Kincaid, D R and Krogh, F T, 1979, Basic linear algebra supbrograms for Fortran usage, ACM Trans. Math. Software (5), 308--325
"""
raise NotImplementedError

[docs]def daxpy(alpha, x, y):
r"""
daxpy adds a scaled real vector to an unscaled real vector.

.. _f06ec-py2-py-doc:

For full information please refer to the NAG Library document for f06ec

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06ecf.html

.. _f06ec-py2-py-parameters:

**Parameters**
**alpha** : float
The scalar :math:\alpha.

**x** : float, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:x.

**y** : float, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:y.

**Returns**
**y** : float, ndarray, shape :math:\left(n\right)
The updated vector :math:y.

.. _f06ec-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

daxpy performs the operation

.. math::
y←\alpha x+y

where :math:x and :math:y are :math:n-element real vectors, and :math:\alpha is a real scalar.

.. _f06ec-py2-py-references:

**References**
Lawson, C L, Hanson, R J, Kincaid, D R and Krogh, F T, 1979, Basic linear algebra supbrograms for Fortran usage, ACM Trans. Math. Software (5), 308--325
"""
raise NotImplementedError

[docs]def dscal(alpha, x):
r"""
dscal multiplies a real vector by a real scalar.

.. _f06ed-py2-py-doc:

For full information please refer to the NAG Library document for f06ed

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06edf.html

.. _f06ed-py2-py-parameters:

**Parameters**
**alpha** : float
The scalar :math:\alpha.

**x** : float, ndarray, shape :math:\left(n\right), modified in place
On entry: the :math:n-element vector :math:x.

On exit: the vector :math:\alpha x.

.. _f06ed-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:4)
On entry, error in parameter :math:\textit{incx}.

Constraint: :math:\textit{incx} > 0.

.. _f06ed-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

dscal performs the operation

.. math::
x←\alpha x

where :math:x is an :math:n-element real vector, and :math:\alpha is a real scalar.

.. _f06ed-py2-py-references:

**References**
Lawson, C L, Hanson, R J, Kincaid, D R and Krogh, F T, 1979, Basic linear algebra supbrograms for Fortran usage, ACM Trans. Math. Software (5), 308--325
"""
raise NotImplementedError

[docs]def dcopy(x):
r"""
dcopy makes a copy of a real vector.

.. _f06ef-py2-py-doc:

For full information please refer to the NAG Library document for f06ef

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06eff.html

.. _f06ef-py2-py-parameters:

**Parameters**
**x** : float, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:x.

**Returns**
**y** : float, ndarray, shape :math:\left(n\right)
The elements :math:y_i of the vector :math:y.

.. _f06ef-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

dcopy performs the operation

.. math::
y←x

where :math:x and :math:y are :math:n-element real vectors.

.. _f06ef-py2-py-references:

**References**
Lawson, C L, Hanson, R J, Kincaid, D R and Krogh, F T, 1979, Basic linear algebra supbrograms for Fortran usage, ACM Trans. Math. Software (5), 308--325
"""
raise NotImplementedError

[docs]def dswap(x, y):
r"""
dswap interchanges two :math:n-element real vectors :math:x and :math:y.

.. _f06eg-py2-py-doc:

For full information please refer to the NAG Library document for f06eg

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06egf.html

.. _f06eg-py2-py-parameters:

**Parameters**
**x** : float, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:x.

**y** : float, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:y.

**Returns**
**x** : float, ndarray, shape :math:\left(n\right)
The original vector :math:y.

**y** : float, ndarray, shape :math:\left(n\right)
The original vector :math:x.

.. _f06eg-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

dswap interchanges the elements of real vectors :math:x and :math:y.

.. _f06eg-py2-py-references:

**References**
Lawson, C L, Hanson, R J, Kincaid, D R and Krogh, F T, 1979, Basic linear algebra supbrograms for Fortran usage, ACM Trans. Math. Software (5), 308--325
"""
raise NotImplementedError

[docs]def dnrm2(x):
r"""
dnrm2 returns the Euclidean norm of the :math:n-element real vector :math:x.

.. _f06ej-py2-py-doc:

For full information please refer to the NAG Library document for f06ej

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06ejf.html

.. _f06ej-py2-py-parameters:

**Parameters**
**x** : float, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:x.

**Returns**
**nrm** : float
The Euclidean norm.

.. _f06ej-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:3)
On entry, error in parameter :math:\textit{incx}.

Constraint: :math:\textit{incx} > 0.

.. _f06ej-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

dnrm2 returns the Euclidean norm

.. math::
\left\lVert x\right\rVert_2 = \sqrt{x^\mathrm{T}x}

of the :math:n-element real vector :math:x.

.. _f06ej-py2-py-references:

**References**
Lawson, C L, Hanson, R J, Kincaid, D R and Krogh, F T, 1979, Basic linear algebra supbrograms for Fortran usage, ACM Trans. Math. Software (5), 308--325
"""
raise NotImplementedError

[docs]def dasum(x):
r"""
dasum returns the :math:1-norm of the :math:n-element real vector :math:x.

.. _f06ek-py2-py-doc:

For full information please refer to the NAG Library document for f06ek

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06ekf.html

.. _f06ek-py2-py-parameters:

**Parameters**
**x** : float, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:x.

**Returns**
**sumx** : float
The :math:1-norm of the :math:n-element real vector :math:x.

.. _f06ek-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:3)
On entry, error in parameter :math:\textit{incx}.

Constraint: :math:\textit{incx} > 0.

.. _f06ek-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

dasum, returns the :math:1-norm

.. math::
\left\lvert x_1\right\rvert +\left\lvert x_2\right\rvert + \cdots +\left\lvert x_n\right\rvert

of the :math:n-element real vector :math:x.

.. _f06ek-py2-py-references:

**References**
Lawson, C L, Hanson, R J, Kincaid, D R and Krogh, F T, 1979, Basic linear algebra supbrograms for Fortran usage, ACM Trans. Math. Software (5), 308--325
"""
raise NotImplementedError

[docs]def drot(x, y, c, s):
r"""
drot applies a real plane rotation to two real vectors.

.. _f06ep-py2-py-doc:

For full information please refer to the NAG Library document for f06ep

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06epf.html

.. _f06ep-py2-py-parameters:

**Parameters**
**x** : float, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:x.

**y** : float, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:y.

**c** : float
The value :math:c, the cosine of the rotation.

**s** : float
The value :math:s, the sine of the rotation.

**Returns**
**x** : float, ndarray, shape :math:\left(n\right)
The transformed vector :math:x.

**y** : float, ndarray, shape :math:\left(n\right)
The transformed vector :math:y.

.. _f06ep-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

drot applies a real plane rotation to two :math:n-element real vectors :math:x and :math:y:

.. math::
\begin{pmatrix}x^\mathrm{T}\\y^\mathrm{T}\end{pmatrix}←\begin{pmatrix}c&s\\-s&c\end{pmatrix}\begin{pmatrix}x^\mathrm{T}\\y^\mathrm{T}\end{pmatrix}\text{.}

The plane rotation has the form generated by :meth:drotg or :meth:drotgc.

.. _f06ep-py2-py-references:

**References**
Lawson, C L, Hanson, R J, Kincaid, D R and Krogh, F T, 1979, Basic linear algebra supbrograms for Fortran usage, ACM Trans. Math. Software (5), 308--325
"""
raise NotImplementedError

[docs]def ddoti(x, indx, y):
r"""
ddoti computes the scalar product of a sparse real vector, stored in compressed form, with a real vector.

.. _f06er-py2-py-doc:

For full information please refer to the NAG Library document for f06er

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06erf.html

.. _f06er-py2-py-parameters:

**Parameters**
**x** : float, array-like, shape :math:\left(\textit{nz}\right)
The nonzero elements of the sparse vector :math:x.

**indx** : int, array-like, shape :math:\left(\textit{nz}\right)
:math:\mathrm{indx}[\textit{i}-1] must contain the index of :math:\mathrm{x}[\textit{i}-1] in the sparse vector :math:x, for :math:\textit{i} = 1,2,\ldots,\textit{nz}.

**y** : float, array-like, shape :math:\left(\max\left(\mathrm{indx}\right)\right)
The vector :math:y. Only elements corresponding to indices in :math:\mathrm{indx} are accessed.

**Returns**
**d** : float
The scalar product of the sparse real vector, :math:x, with the real vector :math:y.

.. _f06er-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

ddoti returns the value of the scalar product

.. math::
x^\mathrm{T}y = x\left(1\right)\times y\left(\textit{indx}\left(1\right)\right)+x\left(2\right)\times y\left(\textit{indy}\left(2\right)\right)+ \cdots +x\left(nz\right)\times y\left(\textit{indx}\left(nz\right)\right)

where :math:x is a sparse real vector, stored in compressed form and :math:y is a real vector in full storage format.

.. _f06er-py2-py-references:

**References**
Dodson, D S, Grimes, R G and Lewis, J G, 1991, Sparse extensions to the Fortran basic linear algebra subprograms, ACM Trans. Math. Software (17), 253--263
"""
raise NotImplementedError

[docs]def daxpyi(a, x, indx, y):
r"""
daxpyi adds a scaled sparse real vector, stored in compressed form, to an unscaled real vector.

.. _f06et-py2-py-doc:

For full information please refer to the NAG Library document for f06et

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06etf.html

.. _f06et-py2-py-parameters:

**Parameters**
**a** : float
The scalar :math:\alpha.

**x** : float, array-like, shape :math:\left(\textit{nz}\right)
The nonzero elements of the sparse vector :math:x.

**indx** : int, array-like, shape :math:\left(\textit{nz}\right)
:math:\mathrm{indx}[\textit{i}-1] must contain the index of :math:\mathrm{x}[\textit{i}-1] in the sparse vector :math:x, for :math:\textit{i} = 1,2,\ldots,\textit{nz}.

**y** : float, array-like, shape :math:\left(\max\left(\mathrm{indx}\right)\right)
The vector :math:y. Only elements corresponding to indices in :math:\mathrm{indx} are accessed.

**Returns**
**y** : float, ndarray, shape :math:\left(\max\left(\mathrm{indx}\right)\right)
The updated vector :math:y.

.. _f06et-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

daxpyi performs the operation

.. math::
y←\alpha x+y

where :math:x is a sparse real vector, stored in compressed form, and :math:y is a real vector in full storage form.

.. _f06et-py2-py-references:

**References**
Dodson, D S, Grimes, R G and Lewis, J G, 1991, Sparse extensions to the Fortran basic linear algebra subprograms, ACM Trans. Math. Software (17), 253--263
"""
raise NotImplementedError

[docs]def dgthr(y, indx):
r"""
dgthr gathers specified (usually nonzero) elements of a real vector :math:y in full storage form into a sparse real vector :math:x in compressed form.

.. _f06eu-py2-py-doc:

For full information please refer to the NAG Library document for f06eu

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06euf.html

.. _f06eu-py2-py-parameters:

**Parameters**
**y** : float, array-like, shape :math:\left(\max\left(\mathrm{indx}\right)\right)
The vector :math:y. Only elements corresponding to indices in :math:\mathrm{indx} are accessed.

**indx** : int, array-like, shape :math:\left(\textit{nz}\right)
:math:\mathrm{indx}[\textit{i}-1] must contain the index :math:\mathrm{y}[\textit{i}-1], for :math:\textit{i} = 1,2,\ldots,\textit{nz}, which is to be gathered into :math:x.

**Returns**
**x** : float, ndarray, shape :math:\left(\textit{nz}\right)
The compressed vector :math:x.

.. _f06eu-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

dgthr gathers the specified elements of a vector, :math:y, in full storage form, into :math:x, the equivalent sparse vector compressed form.

.. _f06eu-py2-py-references:

**References**
Dodson, D S, Grimes, R G and Lewis, J G, 1991, Sparse extensions to the Fortran basic linear algebra subprograms, ACM Trans. Math. Software (17), 253--263
"""
raise NotImplementedError

[docs]def dgthrz(y, indx):
r"""
dgthrz gathers specified (usually nonzero) elements of a real vector :math:y in full storage form into a sparse real vector :math:x in compressed form.
The specified elements of :math:y are set to zero.

.. _f06ev-py2-py-doc:

For full information please refer to the NAG Library document for f06ev

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06evf.html

.. _f06ev-py2-py-parameters:

**Parameters**
**y** : float, array-like, shape :math:\left(\max\left(\mathrm{indx}\right)\right)
The vector :math:y. Only elements corresponding to indices in :math:\mathrm{indx} are accessed.

**indx** : int, array-like, shape :math:\left(\textit{nz}\right)
:math:\mathrm{indx}[\textit{i}-1] must contain the index :math:\mathrm{y}[\textit{i}-1], for :math:\textit{i} = 1,2,\ldots,\textit{nz}, which is to be gathered into :math:x.

**Returns**
**y** : float, ndarray, shape :math:\left(\max\left(\mathrm{indx}\right)\right)
The elements of :math:y corresponding to indices in :math:\mathrm{indx} are set to zero.

**x** : float, ndarray, shape :math:\left(\textit{nz}\right)
The compressed vector :math:x.

.. _f06ev-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:4)
On entry, error in parameter :math:\mathrm{indx}.

Constraint: the indices must be distinct.

.. _f06ev-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

dgthrz gathers the specified elements of a vector, :math:y, in full storage form, into the equivalent sparse vector compressed form.
The gathered elements of :math:y are set to zero.

.. _f06ev-py2-py-references:

**References**
Dodson, D S, Grimes, R G and Lewis, J G, 1991, Sparse extensions to the Fortran basic linear algebra subprograms, ACM Trans. Math. Software (17), 253--263
"""
raise NotImplementedError

[docs]def dsctr(x, indx, y):
r"""
dsctr scatters the elements of a sparse real vector :math:x stored in compressed form, into a real vector :math:y in full storage form.

.. _f06ew-py2-py-doc:

For full information please refer to the NAG Library document for f06ew

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06ewf.html

.. _f06ew-py2-py-parameters:

**Parameters**
**x** : float, array-like, shape :math:\left(\textit{nz}\right)
The nonzero elements of the sparse vector :math:x.

**indx** : int, array-like, shape :math:\left(\textit{nz}\right)
:math:\mathrm{indx}[\textit{i}-1] must contain the index of :math:\mathrm{x}[\textit{i}-1] in the sparse vector :math:x, for :math:\textit{i} = 1,2,\ldots,\textit{nz}.

**y** : float, array-like, shape :math:\left(\max\left(\mathrm{indx}\right)\right)
The vector :math:y.

**Returns**
**y** : float, ndarray, shape :math:\left(\max\left(\mathrm{indx}\right)\right)
The vector :math:y, with the elements corresponding to indices in :math:\mathrm{indx} altered.

.. _f06ew-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

dsctr scatters the elements of a vector :math:x, stored in compressed form, into a vector, :math:y, in full storage form.

.. _f06ew-py2-py-references:

**References**
Dodson, D S, Grimes, R G and Lewis, J G, 1991, Sparse extensions to the Fortran basic linear algebra subprograms, ACM Trans. Math. Software (17), 253--263
"""
raise NotImplementedError

[docs]def droti(x, indx, y, c, s):
r"""
droti applies a real plane rotation to a sparse real vector and a real vector.

.. _f06ex-py2-py-doc:

For full information please refer to the NAG Library document for f06ex

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06exf.html

.. _f06ex-py2-py-parameters:

**Parameters**
**x** : float, array-like, shape :math:\left(\textit{nz}\right)
The nonzero elements of the sparse vector :math:x.

**indx** : int, array-like, shape :math:\left(\textit{nz}\right)
:math:\mathrm{indx}[\textit{i}-1] must contain the index of :math:\mathrm{x}[\textit{i}-1] in the sparse vector :math:x, for :math:\textit{i} = 1,2,\ldots,\textit{nz}.

**y** : float, array-like, shape :math:\left(\max\left(\mathrm{indx}\right)\right)
The vector :math:y. Only the elements corresponding to indices in :math:\mathrm{indx} are referenced.

**c** : float
The value :math:c, the cosine of the rotation.

**s** : float
The value :math:s, the sine of the rotation.

**Returns**
**x** : float, ndarray, shape :math:\left(\textit{nz}\right)
The transformed vector :math:x.

**y** : float, ndarray, shape :math:\left(\max\left(\mathrm{indx}\right)\right)
The transformed vector :math:y. Only elements corresponding to indices in :math:\mathrm{indx} are altered.

.. _f06ex-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

droti applies a real plane rotation to a sparse real vector :math:x stored in compressed form and a real vector :math:y in full storage form:

.. math::
\begin{pmatrix}x^\mathrm{T}\\y^\mathrm{T}\end{pmatrix}←\begin{pmatrix}c&s\\-s&c\end{pmatrix}\begin{pmatrix}x^\mathrm{T}\\y^\mathrm{T}\end{pmatrix}\text{.}

The plane rotation has the form generated by :meth:drotg or :meth:drotgc.

.. _f06ex-py2-py-references:

**References**
Dodson, D S, Grimes, R G and Lewis, J G, 1991, Sparse extensions to the Fortran basic linear algebra subprograms, ACM Trans. Math. Software (17), 253--263
"""
raise NotImplementedError

[docs]def dvcos(j, tolx, x, toly, y):
r"""
dvcos computes the cosine of the angle between two real vectors.

.. _f06fa-py2-py-doc:

For full information please refer to the NAG Library document for f06fa

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06faf.html

.. _f06fa-py2-py-parameters:

**Parameters**
**j** : int
If the vector :math:y is supplied in :math:\mathrm{y}, :math:\mathrm{j} should be set to :math:0. Otherwise, :math:\mathrm{j} specifies the index :math:j of the unit vector :math:e_j to be used as :math:y.

**tolx** : float
The value :math:\textit{tolx}, used to determine whether :math:\left\lVert x\right\rVert_2 is effectively zero.

If :math:\mathrm{tolx} is negative, the value zero is used.

**x** : float, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:x.

**toly** : float
The value :math:\textit{toly}, used to determine whether :math:\left\lVert y\right\rVert_2 is effectively zero.

If :math:\mathrm{toly} is negative, the value zero is used.

**y** : float, array-like, shape :math:\left(n\right)
If :math:1\leq \mathrm{j}\leq n, :math:\mathrm{y} is not referenced. Otherwise, :math:\mathrm{y} holds the vector :math:y.

**Returns**
**vcos** : float
The cosine of the angle between :math:x and :math:y.

.. _f06fa-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

dvcos returns the cosine of the angle between two :math:n-element real vectors :math:x and :math:y, given by the expression

.. math::
\frac{{x^\mathrm{T}y}}{{\left\lVert x\right\rVert_2\left\lVert y\right\rVert_2}}\text{.}

If :math:1\leq j\leq n, :math:y is taken to be the unit vector :math:e_j, in which case the array :math:\mathrm{y} is not referenced.

If :math:\left\lVert x\right\rVert_2\leq \textit{tolx}, the function returns :math:2.0; if :math:\left\lVert x\right\rVert_2 > \textit{tolx} but :math:\left\lVert y\right\rVert_2\leq \textit{tol}y, the function returns :math:{-2.0}; otherwise the value returned is in the range :math:\left({-1.0}, 1.0\right).
"""
raise NotImplementedError

r"""
dload broadcasts a real scalar into a real vector.

.. _f06fb-py2-py-doc:

For full information please refer to the NAG Library document for f06fb

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06fbf.html

.. _f06fb-py2-py-parameters:

**Parameters**
**n** : int
:math:n, the number of elements in :math:x.

**con** : float
The scalar :math:\alpha.

**Returns**
**x** : float, ndarray, shape :math:\left(\mathrm{n}\right)
The elements :math:x_i of the vector :math:x.

.. _f06fb-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:4)
On entry, error in parameter :math:\textit{incx}.

Constraint: :math:\textit{incx} > 0.

.. _f06fb-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

dload performs the operation

.. math::
x←\left(\alpha, \alpha, \ldots, \alpha \right)^\mathrm{T}\text{,}

where :math:x is an :math:n-element real vector.
"""
raise NotImplementedError

[docs]def ddscl(d, x):
r"""
ddscl multiplies a real vector by a real diagonal matrix.

.. _f06fc-py2-py-doc:

For full information please refer to the NAG Library document for f06fc

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06fcf.html

.. _f06fc-py2-py-parameters:

**Parameters**
**d** : float, array-like, shape :math:\left(n\right)
The vector :math:d.

**x** : float, array-like, shape :math:\left(n\right)
The array :math:\mathrm{x} must contain the :math:n-element vector :math:x.

**Returns**
**x** : float, ndarray, shape :math:\left(n\right)
The updated vector :math:x.

.. _f06fc-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

ddscl performs the operation

.. math::
x←Dx

where :math:x is an :math:n-element real vector and :math:D = \mathrm{diag}\left(d\right) is a real diagonal matrix.

Equivalently, the function performs the element-by-element product of the vectors :math:x and :math:d

.. math::
x_i = d_ix_i\text{, }\quad i = 1,2,\ldots,n\text{.}
"""
raise NotImplementedError

[docs]def axpzy(alpha, x):
r"""
axpzy multiplies a real vector by a scalar, preserving the input vector.

.. _f06fd-py2-py-doc:

For full information please refer to the NAG Library document for f06fd

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06fdf.html

.. _f06fd-py2-py-parameters:

**Parameters**
**alpha** : float
The scalar :math:\alpha.

**x** : float, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:x.

**Returns**
**y** : float, ndarray, shape :math:\left(n\right)
The elements :math:y_i of the vector :math:y.

.. _f06fd-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

axpzy performs the operation

.. math::
y←\alpha x

where :math:x and :math:y are :math:n-element real vectors, and :math:\alpha is a real scalar.
"""
raise NotImplementedError

[docs]def drscl(alpha, x):
r"""
drscl multiplies a real vector by the reciprocal of a scalar.

.. _f06fe-py2-py-doc:

For full information please refer to the NAG Library document for f06fe

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06fef.html

.. _f06fe-py2-py-parameters:

**Parameters**
**alpha** : float
The scalar :math:\alpha.

**x** : float, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:x.

**Returns**
**x** : float, ndarray, shape :math:\left(n\right)
The updated vector :math:x.

.. _f06fe-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:2)
On entry, error in parameter :math:\mathrm{alpha}.

Constraint: :math:\mathrm{alpha}\neq 0.0.

(errno :math:4)
On entry, error in parameter :math:\textit{incx}.

Constraint: :math:\textit{incx} > 0.

.. _f06fe-py2-py-notes:

**Notes**
drscl performs the operation

.. math::
x←\frac{1}{\alpha }x

where :math:x is an :math:n-element real vector and :math:\alpha is a real nonzero scalar.
"""
raise NotImplementedError

[docs]def dnegv(x):
r"""
dnegv negates a real vector.

.. _f06fg-py2-py-doc:

For full information please refer to the NAG Library document for f06fg

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06fgf.html

.. _f06fg-py2-py-parameters:

**Parameters**
**x** : float, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:x.

**Returns**
**x** : float, ndarray, shape :math:\left(n\right)
The vector :math:{-x}.

.. _f06fg-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:3)
On entry, error in parameter :math:\textit{incx}.

Constraint: :math:\textit{incx} > 0.

.. _f06fg-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

dnegv performs the operation

.. math::
x←-x

where :math:x is an :math:n-element real vector.
"""
raise NotImplementedError

[docs]def dssq(x, scal, sumsq):
r"""
dssq updates the Euclidean norm of real vector in scaled form.

.. _f06fj-py2-py-doc:

For full information please refer to the NAG Library document for f06fj

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06fjf.html

.. _f06fj-py2-py-parameters:

**Parameters**
**x** : float, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:x.

**scal** : float
The scaling factor :math:\alpha. On the first call to dssq :math:\mathrm{scal} = 0.0.

**sumsq** : float
The scaled sum of squares :math:\xi. On the first call to dssq :math:\mathrm{sumsq} = 1.0.

**Returns**
**scal** : float
The updated scaling factor :math:\tilde{\alpha } = \mathrm{max}_i\left(\alpha, {\left\lvert x_i\right\rvert }\right).

**sumsq** : float
The updated scaled sum of squares :math:\tilde{\xi }, satisfying: :math:1\leq \tilde{\xi }\leq \xi +n.

.. _f06fj-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:3)
On entry, error in parameter :math:\textit{incx}.

Constraint: :math:\textit{incx} > 0.

(errno :math:4)
On entry, error in parameter :math:\mathrm{scal}.

Constraint: :math:\mathrm{scal}\geq 0.0.

(errno :math:5)
On entry, error in parameter :math:\mathrm{sumsq}.

Constraint: :math:\mathrm{sumsq}\geq 1.0.

.. _f06fj-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

Given an :math:n-element real vector :math:x, and real scalars :math:\alpha and :math:\xi, dssq returns updated values :math:\tilde{\alpha } and :math:\tilde{\xi } such that

.. math::
\tilde{\alpha }^2\tilde{\xi } = x_1^2+x_2^2 + \cdots +x_n^2+\alpha^2\xi \text{.}

dssq is designed for use in the safe computation of the Euclidean norm of a real vector, without unnecessary overflow or destructive underflow.
An initial call to dssq (with :math:\xi = 1 and :math:\alpha = 0) may be followed by further calls to dssq and finally a call to :meth:dnorm to complete the computation.
Multiple calls of dssq may be needed if the elements of the vector cannot all be accessed in a single array :math:\mathrm{x}.
"""
raise NotImplementedError

[docs]def dnrm2w(w, x):
r"""
dnrm2w computes the weighted Euclidean norm of a real vector.

.. _f06fk-py2-py-doc:

For full information please refer to the NAG Library document for f06fk

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06fkf.html

.. _f06fk-py2-py-parameters:

**Parameters**
**w** : float, array-like, shape :math:\left(n\right)
:math:w, the vector of weights.

**x** : float, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:x.

**Returns**
**nrm** : float
The weighted Euclidean norm of the real vector, :math:x.

.. _f06fk-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:2)
On entry, error in parameter :math:\textit{w}.

Constraint: the elements of the array must not be negative.

.. _f06fk-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

dnrm2w returns the weighted Euclidean norm

.. math::
\sqrt{x^\mathrm{T}Wx}

of the :math:n-element real vector :math:x, where :math:W = \mathrm{diag}\left(w\right) and :math:w is a vector of weights.
"""
raise NotImplementedError

[docs]def darang(x):
r"""
darang returns the absolutely largest and absolutely smallest values from a real vector.

.. _f06fl-py2-py-doc:

For full information please refer to the NAG Library document for f06fl

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06flf.html

.. _f06fl-py2-py-parameters:

**Parameters**
**x** : float, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:x.

**Returns**
**xmax** : float
The value :math:x_{\mathrm{max}} = \mathrm{max}_i\left\lvert x_i\right\rvert.

**xmin** : float
The value :math:x_{\mathrm{min}} = \mathrm{min}_i\left\lvert x_i\right\rvert.

.. _f06fl-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:3)
On entry, error in parameter :math:\textit{incx}.

Constraint: :math:\textit{incx} > 0.

.. _f06fl-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

darang returns the values :math:x_{\mathrm{max}} and :math:x_{\mathrm{min}} given by

.. math::
x_{\mathrm{max}} = \mathrm{max}_i\left\lvert x_i\right\rvert \text{, }\quad x_{\mathrm{min}} = \mathrm{min}_i\left\lvert x_i\right\rvert \text{,}

where :math:x is an :math:n-element real vector.
If :math:n < 1, then :math:x_{\mathrm{max}} and :math:x_{\mathrm{min}} are returned as zero.
"""
raise NotImplementedError

[docs]def drots(x, y, c, s):
r"""
drots applies a real symmetric plane rotation to two real vectors.

.. _f06fp-py2-py-doc:

For full information please refer to the NAG Library document for f06fp

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06fpf.html

.. _f06fp-py2-py-parameters:

**Parameters**
**x** : float, array-like, shape :math:\left(n\right)
The original vector :math:x.

**y** : float, array-like, shape :math:\left(n\right)
The original vector :math:y.

**c** : float
The value :math:c, the cosine of the rotation.

**s** : float
The value :math:s, the sine of the rotation.

**Returns**
**x** : float, ndarray, shape :math:\left(n\right)
The transformed vector :math:x.

**y** : float, ndarray, shape :math:\left(n\right)
The transformed vector :math:y.

.. _f06fp-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

drots applies a symmetric real plane rotation to two :math:n-element real vectors :math:x and :math:y:

.. math::
\begin{pmatrix}x^\mathrm{T}\\y^\mathrm{T}\end{pmatrix}←\begin{pmatrix}c&s\\s&-c\end{pmatrix}\begin{pmatrix}x^\mathrm{T}\\y^\mathrm{T}\end{pmatrix}\text{.}
"""
raise NotImplementedError

[docs]def dsrotg(pivot, direct, alpha, x):
r"""
dsrotg generates a sequence of real plane rotations.

.. _f06fq-py2-py-doc:

For full information please refer to the NAG Library document for f06fq

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06fqf.html

.. _f06fq-py2-py-parameters:

**Parameters**
**pivot** : str, length 1
Specifies the plane rotated by :math:P_k.

:math:\mathrm{pivot} = \texttt{'V'} (variable pivot)

:math:P_k rotates the :math:\left(k, {k+1}\right) plane.

:math:\mathrm{pivot} = \texttt{'F'} (fixed pivot)

:math:P_k rotates the :math:\left(1, {k+1}\right) plane if :math:\mathrm{direct} = \texttt{'F'}, or the :math:\left(k, {n+1}\right) plane if :math:\mathrm{direct} = \texttt{'B'}.

**direct** : str, length 1
Specifies the sequence direction.

:math:\mathrm{direct} = \texttt{'F'} (forward sequence)

:math:P = P_n \cdots P_2P_1.

:math:\mathrm{direct} = \texttt{'B'} (backward sequence)

:math:P = P_1P_2 \cdots P_n.

**alpha** : float
The scalar :math:\alpha.

**x** : float, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:x.

**Returns**
**alpha** : float
The scalar :math:\beta.

**x** : float, ndarray, shape :math:\left(n\right)
The referenced elements are overwritten by details of the sequence of plane rotations.

**c** : float, ndarray, shape :math:\left(n\right)
The values :math:c_k, the cosines of the rotations.

**s** : float, ndarray, shape :math:\left(n\right)
The values :math:s_k, the sines of the rotations.

.. _f06fq-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{pivot}.

Constraint: :math:\mathrm{pivot} = \texttt{'V'} or :math:\texttt{'F'}.

(errno :math:2)
On entry, error in parameter :math:\mathrm{direct}.

Constraint: :math:\mathrm{direct} = \texttt{'F'} or :math:\texttt{'B'}.

(errno :math:6)
On entry, error in parameter :math:\textit{incx}.

Constraint: :math:\textit{incx} > 0.

.. _f06fq-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

dsrotg generates the parameters of a real orthogonal matrix :math:P, of order :math:n+1, chosen so as to set to zero the elements of a supplied :math:n-element real vector :math:x.

If :math:\mathrm{pivot} = \texttt{'F'} and :math:\mathrm{direct} = \texttt{'F'}, or if :math:\mathrm{pivot} = \texttt{'V'} and :math:\mathrm{direct} = \texttt{'B'},

.. math::
P\begin{pmatrix}\alpha \\x\end{pmatrix} = \begin{pmatrix}\beta \\0\end{pmatrix}\text{;}

If :math:\mathrm{pivot} = \texttt{'F'} and :math:\mathrm{direct} = \texttt{'B'}, or if :math:\mathrm{pivot} = \texttt{'V'} and :math:\mathrm{direct} = \texttt{'F'},

.. math::
P\begin{pmatrix}x\\\alpha \end{pmatrix} = \begin{pmatrix}0\\\beta \end{pmatrix}\text{.}

Here :math:\alpha and :math:\beta are real scalars.

:math:P is represented as a sequence of :math:n plane rotations :math:P_k, as specified by :math:\mathrm{pivot} and :math:\mathrm{direct}; :math:P_k is chosen to annihilate :math:x_k, and its :math:2\times 2 plane rotation part has the form

.. math::
\begin{pmatrix}c_k&s_k\\-s_k&c_k\end{pmatrix}\text{.}

The tangent of the rotation, :math:t_k, is overwritten on :math:x_k.
"""
raise NotImplementedError

[docs]def dnhousg(alpha, x, tol):
r"""
dnhousg generates a real elementary reflection in the NAG (as opposed to LINPACK) style.

.. _f06fr-py2-py-doc:

For full information please refer to the NAG Library document for f06fr

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06frf.html

.. _f06fr-py2-py-parameters:

**Parameters**
**alpha** : float
The scalar :math:\alpha.

**x** : float, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:x.

**tol** : float
The value :math:\textit{tol}.

**Returns**
**alpha** : float
The scalar :math:\beta.

**x** : float, ndarray, shape :math:\left(n\right)
The referenced elements are overwritten by details of the real elementary reflection.

**zeta** : float
The scalar :math:\zeta.

.. _f06fr-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:4)
On entry, error in parameter :math:\textit{incx}.

Constraint: :math:\textit{incx} > 0.

.. _f06fr-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

dnhousg generates details of a real elementary reflection (Householder matrix), :math:P, such that

.. math::
P\begin{pmatrix}\alpha \\x\end{pmatrix} = \begin{pmatrix}\beta \\0\end{pmatrix}

where :math:P is orthogonal, :math:\alpha and :math:\beta are real scalars, and :math:x is an :math:n-element real vector.

:math:P is given in the form

.. math::
P = I-\begin{pmatrix}\zeta \\z\end{pmatrix}\begin{pmatrix}\zeta &z^\mathrm{T}\end{pmatrix}\text{,}

where :math:z is an :math:n-element real vector and :math:\zeta is a real scalar.

If :math:x is such that

.. math::
\mathrm{max}\left(\left\lvert x_i\right\rvert \right)\leq \mathrm{max}\left(\textit{tol},\epsilon \left\lvert \alpha \right\rvert \right)

where :math:\epsilon is the machine precision and :math:\textit{tol} is a user-supplied tolerance, then :math:\zeta is set to :math:0, and :math:P can be taken to be the unit matrix.
Otherwise :math:1\leq \zeta \leq \sqrt{2}.
"""
raise NotImplementedError

[docs]def dlhousg(alpha, x, tol):
r"""
dlhousg generates a real elementary reflection in the LINPACK (as opposed to NAG) style.

.. _f06fs-py2-py-doc:

For full information please refer to the NAG Library document for f06fs

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06fsf.html

.. _f06fs-py2-py-parameters:

**Parameters**
**alpha** : float
The scalar :math:\alpha.

**x** : float, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:x.

**tol** : float
The value :math:\textit{tol}.

If :math:\mathrm{tol} is not in the range :math:\left(0, 1\right), the value :math:0 is used for :math:\textit{tol}.

**Returns**
**alpha** : float
The scalar :math:\beta.

**x** : float, ndarray, shape :math:\left(n\right)
The referenced elements are overwritten by details of the real elementary reflection.

**z1** : float
The scalar :math:\zeta.

.. _f06fs-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:4)
On entry, error in parameter :math:\textit{incx}.

Constraint: :math:\textit{incx} > 0.

.. _f06fs-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

dlhousg generates details of a real elementary reflection (Householder matrix), :math:P, such that

.. math::
P\begin{pmatrix}\alpha \\x\end{pmatrix} = \begin{pmatrix}\beta \\0\end{pmatrix}

where :math:P is orthogonal, :math:\alpha and :math:\beta are real scalars, and :math:x is an :math:n-element real vector.

:math:P is given in the form

.. math::
P = I-\frac{1}{\zeta }\begin{pmatrix}\zeta \\z\end{pmatrix}\begin{pmatrix}\zeta &z^\mathrm{T}\end{pmatrix}\text{,}

where :math:z is an :math:n-element real vector and :math:\zeta is a real scalar. (This form is compatible with that used by LINPACK.)

If the elements of :math:x are all zero, or if the elements of :math:x are all less than :math:\textit{tol}\times \left\lvert \alpha \right\rvert in absolute value, then :math:\zeta is set to :math:0 and :math:P can be taken to be the unit matrix.
Otherwise :math:\zeta always lies in the range :math:\left(1, 2\right).
"""
raise NotImplementedError

[docs]def dnhous(delta, y, zeta, z):
r"""
dnhous applies a NAG (as opposed to LINPACK) style real elementary reflection to a real vector.

.. _f06ft-py2-py-doc:

For full information please refer to the NAG Library document for f06ft

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06ftf.html

.. _f06ft-py2-py-parameters:

**Parameters**
**delta** : float
The original scalar :math:\delta.

**y** : float, array-like, shape :math:\left(n\right)
The original vector :math:y.

**zeta** : float
The scalar :math:\zeta, as returned by :meth:dnhousg.

If :math:\zeta = 0, :math:P is assumed to be the unit matrix and the transformation is skipped.

**z** : float, array-like, shape :math:\left(n\right)
The vector :math:z, as returned by :meth:dnhousg.

**Returns**
**delta** : float
The transformed scalar :math:\delta.

**y** : float, ndarray, shape :math:\left(n\right)
The transformed vector.

.. _f06ft-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:5)
On entry, error in parameter :math:\mathrm{zeta}.

Constraint: :math:\mathrm{zeta} = 0.0.

.. _f06ft-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

dnhous applies a real elementary reflection (Householder matrix) :math:P, as generated by :meth:dnhousg, to a given real vector:

.. math::
\begin{pmatrix}\delta \\y\end{pmatrix}←P\begin{pmatrix}\delta \\y\end{pmatrix}\text{,}

where :math:y is an :math:n-element real vector and :math:\delta a real scalar.
"""
raise NotImplementedError

[docs]def dlhous(z, z1, alpha, x):
r"""
dlhous applies a LINPACK (as opposed to NAG) style real elementary reflection to a real vector.

.. _f06fu-py2-py-doc:

For full information please refer to the NAG Library document for f06fu

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06fuf.html

.. _f06fu-py2-py-parameters:

**Parameters**
**z** : float, array-like, shape :math:\left(n\right)
The vector :math:z, as returned by :meth:dlhousg.

**z1** : float
The scalar :math:\zeta, as returned by :meth:dlhousg.

If :math:\zeta = 0, :math:P is assumed to be the unit matrix and the transformation is skipped.

**alpha** : float
The original scalar :math:\alpha.

**x** : float, array-like, shape :math:\left(n\right)
The original vector :math:x.

**Returns**
**alpha** : float
The transformed scalar :math:\alpha.

**x** : float, ndarray, shape :math:\left(n\right)
The transformed vector :math:x.

.. _f06fu-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

dlhous applies a real elementary reflection (Householder matrix) :math:P, as generated by :meth:dlhousg, to a given real vector:

.. math::
\begin{pmatrix}\alpha \\x\end{pmatrix}←P\begin{pmatrix}\alpha \\x\end{pmatrix}

where :math:x is an :math:n-element real vector and :math:\alpha a real scalar.
"""
raise NotImplementedError

[docs]def zdotu(x, y):
r"""
zdotu computes the scalar product of two complex vectors.

.. _f06ga-py2-py-doc:

For full information please refer to the NAG Library document for f06ga

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06gaf.html

.. _f06ga-py2-py-parameters:

**Parameters**
**x** : complex, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:x.

**y** : complex, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:y.

**Returns**
**zdu** : complex
The value of the scalar product.

.. _f06ga-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

zdotu returns the value of the scalar product

.. math::
x^\mathrm{T}y

where :math:x and :math:y are :math:n-element complex vectors.

.. _f06ga-py2-py-references:

**References**
Lawson, C L, Hanson, R J, Kincaid, D R and Krogh, F T, 1979, Basic linear algebra supbrograms for Fortran usage, ACM Trans. Math. Software (5), 308--325
"""
raise NotImplementedError

[docs]def zdotc(x, y):
r"""
zdotc computes the scalar product of two complex vectors.

.. _f06gb-py2-py-doc:

For full information please refer to the NAG Library document for f06gb

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06gbf.html

.. _f06gb-py2-py-parameters:

**Parameters**
**x** : complex, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:x.

**y** : complex, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:y.

**Returns**
**zdc** : complex
The value of the scalar product.

.. _f06gb-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

zdotc returns the value of the scalar product

.. math::
x^\mathrm{H}y

where :math:x and :math:y are :math:n-element complex vectors.

.. _f06gb-py2-py-references:

**References**
Lawson, C L, Hanson, R J, Kincaid, D R and Krogh, F T, 1979, Basic linear algebra supbrograms for Fortran usage, ACM Trans. Math. Software (5), 308--325
"""
raise NotImplementedError

[docs]def zaxpy(alpha, x, y):
r"""
zaxpy adds a scaled complex vector to an unscaled complex vector.

.. _f06gc-py2-py-doc:

For full information please refer to the NAG Library document for f06gc

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06gcf.html

.. _f06gc-py2-py-parameters:

**Parameters**
**alpha** : complex
The scalar :math:\alpha.

**x** : complex, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:x.

**y** : complex, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:y.

**Returns**
**y** : complex, ndarray, shape :math:\left(n\right)
The updated vector :math:y.

.. _f06gc-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

zaxpy performs the operation

.. math::
y←\alpha x+y

where :math:x and :math:y are :math:n-element complex vectors, and :math:\alpha is a complex scalar.

.. _f06gc-py2-py-references:

**References**
Lawson, C L, Hanson, R J, Kincaid, D R and Krogh, F T, 1979, Basic linear algebra supbrograms for Fortran usage, ACM Trans. Math. Software (5), 308--325
"""
raise NotImplementedError

[docs]def zscal(alpha, x):
r"""
zscal scales a complex vector by a complex scalar.

.. _f06gd-py2-py-doc:

For full information please refer to the NAG Library document for f06gd

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06gdf.html

.. _f06gd-py2-py-parameters:

**Parameters**
**alpha** : complex
The scalar :math:\alpha.

**x** : complex, ndarray, shape :math:\left(n\right), modified in place
On entry: the :math:n-element vector :math:x.

On exit: the vector :math:\alpha x.

.. _f06gd-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:4)
On entry, error in parameter :math:\textit{incx}.

Constraint: :math:\textit{incx} > 0.

.. _f06gd-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

zscal performs the operation

.. math::
x←\alpha x

where :math:x is an :math:n-element complex vector, and :math:\alpha is a complex scalar.

.. _f06gd-py2-py-references:

**References**
Lawson, C L, Hanson, R J, Kincaid, D R and Krogh, F T, 1979, Basic linear algebra supbrograms for Fortran usage, ACM Trans. Math. Software (5), 308--325
"""
raise NotImplementedError

[docs]def zcopy(x):
r"""
zcopy copies a complex vector to a complex vector.

.. _f06gf-py2-py-doc:

For full information please refer to the NAG Library document for f06gf

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06gff.html

.. _f06gf-py2-py-parameters:

**Parameters**
**x** : complex, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:x.

**Returns**
**y** : complex, ndarray, shape :math:\left(n\right)
The elements :math:y_i of the vector :math:y.

.. _f06gf-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

zcopy performs the operation

.. math::
y←x

where :math:x and :math:y are :math:n-element complex vectors.

.. _f06gf-py2-py-references:

**References**
Lawson, C L, Hanson, R J, Kincaid, D R and Krogh, F T, 1979, Basic linear algebra supbrograms for Fortran usage, ACM Trans. Math. Software (5), 308--325
"""
raise NotImplementedError

[docs]def zswap(x, y):
r"""
zswap interchanges two :math:n-element complex vectors :math:x and :math:y.

.. _f06gg-py2-py-doc:

For full information please refer to the NAG Library document for f06gg

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06ggf.html

.. _f06gg-py2-py-parameters:

**Parameters**
**x** : complex, array-like, shape :math:\left(n\right)
The original vector :math:x.

**y** : complex, array-like, shape :math:\left(n\right)
The original vector :math:y.

**Returns**
**x** : complex, ndarray, shape :math:\left(n\right)
The original vector :math:y.

**y** : complex, ndarray, shape :math:\left(n\right)
The original vector :math:x.

.. _f06gg-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

zswap interchanges the elements of complex vectors :math:x and :math:y.

.. _f06gg-py2-py-references:

**References**
Lawson, C L, Hanson, R J, Kincaid, D R and Krogh, F T, 1979, Basic linear algebra supbrograms for Fortran usage, ACM Trans. Math. Software (5), 308--325
"""
raise NotImplementedError

[docs]def zdotui(x, indx, y):
r"""
zdotui computes the scalar product of an unconjugated sparse complex vector with a complex vector.

.. _f06gr-py2-py-doc:

For full information please refer to the NAG Library document for f06gr

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06grf.html

.. _f06gr-py2-py-parameters:

**Parameters**
**x** : complex, array-like, shape :math:\left(\textit{nz}\right)
The compressed vector :math:x. :math:\mathrm{x} contains :math:x_i for :math:i \in J.

**indx** : int, array-like, shape :math:\left(\textit{nz}\right)
:math:\mathrm{indx} must contain the set of indices :math:J.

**y** : complex, array-like, shape :math:\left(\max\left(\mathrm{indx}\right)\right)
The vector :math:y. Only elements corresponding to indices in :math:\mathrm{indx} are accessed.

**Returns**
**zdu** : complex
The value of the scalar product.

.. _f06gr-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

zdotui returns the value of the scalar product

.. math::
x^\mathrm{T}y

where :math:x is a sparse complex vector stored in compressed form, and :math:y is a complex vector in full storage form.

.. _f06gr-py2-py-references:

**References**
Dodson, D S, Grimes, R G and Lewis, J G, 1991, Sparse extensions to the Fortran basic linear algebra subprograms, ACM Trans. Math. Software (17), 253--263
"""
raise NotImplementedError

[docs]def zdotci(x, indx, y):
r"""
zdotci computes the scalar product of a conjugated sparse complex vector with a complex vector.

.. _f06gs-py2-py-doc:

For full information please refer to the NAG Library document for f06gs

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06gsf.html

.. _f06gs-py2-py-parameters:

**Parameters**
**x** : complex, array-like, shape :math:\left(\textit{nz}\right)
The compressed vector :math:x. :math:\mathrm{x} contains :math:x_i for :math:i \in J.

**indx** : int, array-like, shape :math:\left(\textit{nz}\right)
:math:\mathrm{indx} must contain the set of indices :math:J.

**y** : complex, array-like, shape :math:\left(\max\left(\mathrm{indx}\right)\right)
The vector :math:y. Only elements corresponding to indices in :math:\mathrm{indx} are accessed.

**Returns**
**zdc** : complex
The value of the scalar product.

.. _f06gs-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

zdotci returns the value of the scalar product

.. math::
x^\mathrm{H}y

where :math:x is a sparse complex vector stored in compressed form, and :math:y is a complex vector in full storage form.

.. _f06gs-py2-py-references:

**References**
Dodson, D S, Grimes, R G and Lewis, J G, 1991, Sparse extensions to the Fortran basic linear algebra subprograms, ACM Trans. Math. Software (17), 253--263
"""
raise NotImplementedError

[docs]def zaxpyi(a, x, indx, y):
r"""
zaxpyi adds a scaled sparse complex vector to an unscaled complex vector.

.. _f06gt-py2-py-doc:

For full information please refer to the NAG Library document for f06gt

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06gtf.html

.. _f06gt-py2-py-parameters:

**Parameters**
**a** : complex
The scalar :math:\alpha.

**x** : complex, array-like, shape :math:\left(\textit{nz}\right)
The compressed vector :math:x. :math:\mathrm{x} contains :math:x_i for :math:i \in J.

**indx** : int, array-like, shape :math:\left(\textit{nz}\right)
The indices of the elements in the compressed vector :math:x.

**y** : complex, array-like, shape :math:\left(\max\left(\mathrm{indx}\right)\right)
The vector :math:y. Only elements corresponding to indices in :math:\mathrm{indx} are accessed.

**Returns**
**y** : complex, ndarray, shape :math:\left(\max\left(\mathrm{indx}\right)\right)
The updated vector :math:y.

.. _f06gt-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:4)
On entry, error in parameter :math:\mathrm{indx}.

Constraint: the indices must be distinct.

.. _f06gt-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

zaxpyi performs the operation

.. math::
y←\alpha x+y

where :math:x is a sparse complex vector stored in compressed form, and :math:y is a complex vector in full storage form.

.. _f06gt-py2-py-references:

**References**
Dodson, D S, Grimes, R G and Lewis, J G, 1991, Sparse extensions to the Fortran basic linear algebra subprograms, ACM Trans. Math. Software (17), 253--263
"""
raise NotImplementedError

[docs]def zgthr(y, indx):
r"""
zgthr gathers specified (usually nonzero) elements of a complex vector :math:y in full storage form into a sparse complex vector :math:x in compressed form.

.. _f06gu-py2-py-doc:

For full information please refer to the NAG Library document for f06gu

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06guf.html

.. _f06gu-py2-py-parameters:

**Parameters**
**y** : complex, array-like, shape :math:\left(\max\left(\mathrm{indx}\right)\right)
The vector :math:y. Only elements corresponding to indices in :math:\mathrm{indx} are accessed.

**indx** : int, array-like, shape :math:\left(\textit{nz}\right)
:math:\mathrm{indx} must contain the set of indices :math:J.

**Returns**
**x** : complex, ndarray, shape :math:\left(\textit{nz}\right)
The compressed vector :math:x.

.. _f06gu-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

.. _f06gu-py2-py-references:

**References**
Dodson, D S, Grimes, R G and Lewis, J G, 1991, Sparse extensions to the Fortran basic linear algebra subprograms, ACM Trans. Math. Software (17), 253--263
"""
raise NotImplementedError

[docs]def zgthrz(y, indx):
r"""
zgthrz gathers specified (usually nonzero) elements of a complex vector :math:y in full storage form into a sparse complex vector :math:x in compressed form.
The specified elements of :math:y are set to zero.

.. _f06gv-py2-py-doc:

For full information please refer to the NAG Library document for f06gv

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06gvf.html

.. _f06gv-py2-py-parameters:

**Parameters**
**y** : complex, array-like, shape :math:\left(\max\left(\mathrm{indx}\right)\right)
The vector :math:y. Only elements corresponding to indices in :math:\mathrm{indx} are accessed.

**indx** : int, array-like, shape :math:\left(\textit{nz}\right)
:math:\mathrm{indx} must contain the set of indices :math:J.

**Returns**
**y** : complex, ndarray, shape :math:\left(\max\left(\mathrm{indx}\right)\right)
The elements of :math:y corresponding to indices in :math:\mathrm{indx} are set to zero.

**x** : complex, ndarray, shape :math:\left(\textit{nz}\right)
The compressed vector :math:x.

.. _f06gv-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

.. _f06gv-py2-py-references:

**References**
Dodson, D S, Grimes, R G and Lewis, J G, 1991, Sparse extensions to the Fortran basic linear algebra subprograms, ACM Trans. Math. Software (17), 253--263
"""
raise NotImplementedError

[docs]def zsctr(x, indx, y):
r"""
zsctr scatters the elements of a sparse complex vector :math:x stored in compressed form, into a complex vector :math:y in full storage form.

.. _f06gw-py2-py-doc:

For full information please refer to the NAG Library document for f06gw

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06gwf.html

.. _f06gw-py2-py-parameters:

**Parameters**
**x** : complex, array-like, shape :math:\left(\textit{nz}\right)
The compressed vector :math:x. :math:\mathrm{x} contains :math:x_i for :math:i \in J.

**indx** : int, array-like, shape :math:\left(\textit{nz}\right)
The indices of the elements in the compressed vector :math:x.

**y** : complex, array-like, shape :math:\left(\max\left(\mathrm{indx}\right)\right)
The vector :math:y.

**Returns**
**y** : complex, ndarray, shape :math:\left(\max\left(\mathrm{indx}\right)\right)
The vector :math:y, with the elements corresponding to indices in :math:\mathrm{indx} altered.

.. _f06gw-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:3)
On entry, error in parameter :math:\mathrm{indx}.

Constraint: the indices must be distinct.

.. _f06gw-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

.. _f06gw-py2-py-references:

**References**
Dodson, D S, Grimes, R G and Lewis, J G, 1991, Sparse extensions to the Fortran basic linear algebra subprograms, ACM Trans. Math. Software (17), 253--263
"""
raise NotImplementedError

r"""
zload broadcasts a complex scalar into a complex vector.

.. _f06hb-py2-py-doc:

For full information please refer to the NAG Library document for f06hb

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06hbf.html

.. _f06hb-py2-py-parameters:

**Parameters**
**n** : int
:math:n, the number of elements in :math:x.

**con** : complex
The scalar :math:\alpha.

**Returns**
**x** : complex, ndarray, shape :math:\left(\mathrm{n}\right)
The elements :math:x_i of the vector :math:x.

.. _f06hb-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:4)
On entry, error in parameter :math:\textit{incx}.

Constraint: :math:\textit{incx} > 0.

.. _f06hb-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

zload performs the operation

.. math::
x←\left(\alpha, \alpha, \ldots, \alpha \right)^\mathrm{T}\text{,}

where :math:x is an :math:n-element complex vector.
"""
raise NotImplementedError

[docs]def zdscl(d, x):
r"""
zdscl multiplies a complex vector by a complex diagonal matrix.

.. _f06hc-py2-py-doc:

For full information please refer to the NAG Library document for f06hc

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06hcf.html

.. _f06hc-py2-py-parameters:

**Parameters**
**d** : complex, array-like, shape :math:\left(n\right)
The vector :math:d.

**x** : complex, ndarray, shape :math:\left(n\right), modified in place
On entry: the array :math:\mathrm{x} must contain the :math:n-element vector :math:x.

On exit: the updated vector :math:x.

.. _f06hc-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

zdscl performs the operation

.. math::
x←Dx

where :math:x is an :math:n-element complex vector and :math:D = \mathrm{diag}\left(d\right) is a complex diagonal matrix.

Equivalently, the function performs the element-by-element product of the vectors :math:x and :math:d

.. math::
x_i = d_ix_i\text{, }\quad i = 1,2,\ldots,n\text{.}
"""
raise NotImplementedError

[docs]def zaxpzy(alpha, x):
r"""
zaxpzy multiplies a complex vector by a scalar, preserving the input vector.

.. _f06hd-py2-py-doc:

For full information please refer to the NAG Library document for f06hd

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06hdf.html

.. _f06hd-py2-py-parameters:

**Parameters**
**alpha** : complex
The scalar :math:\alpha.

**x** : complex, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:x.

**Returns**
**y** : complex, ndarray, shape :math:\left(n\right)
The elements :math:y_i of the vector :math:y.

.. _f06hd-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

zaxpzy performs the operation

.. math::
y←\alpha x

where :math:x and :math:y are :math:n-element complex vectors, and :math:\alpha is a complex scalar.
"""
raise NotImplementedError

[docs]def znegv(x):
r"""
znegv negates a complex vector.

.. _f06hg-py2-py-doc:

For full information please refer to the NAG Library document for f06hg

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06hgf.html

.. _f06hg-py2-py-parameters:

**Parameters**
**x** : complex, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:x.

**Returns**
**x** : complex, ndarray, shape :math:\left(n\right)
The vector :math:{-x}.

.. _f06hg-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:3)
On entry, error in parameter :math:\textit{incx}.

Constraint: :math:\textit{incx} > 0.

.. _f06hg-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

znegv performs the operation

.. math::
x←-x

where :math:x is an :math:n-element complex vector.
"""
raise NotImplementedError

[docs]def zrot(cx, cy, c, s):
r"""
zrot applies a plane rotation with a real cosine and complex sine to two complex vectors.

.. _f06hm-py2-py-doc:

For full information please refer to the NAG Library document for f06hm

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06hmf.html

.. _f06hm-py2-py-parameters:

**Parameters**
**cx** : complex, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:x.

**cy** : complex, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:y.

**c** : float
The value :math:c, the cosine of the rotation.

**s** : complex
The value :math:s, the sine of the rotation.

**Returns**
**cx** : complex, ndarray, shape :math:\left(n\right)
The transformed vector :math:x.

**cy** : complex, ndarray, shape :math:\left(n\right)
The transformed vector :math:y.

.. _f06hm-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

zrot applies a plane rotation, where the cosine is real and the sine is complex, to two :math:n-element complex vectors :math:x and :math:y:

.. math::
\begin{pmatrix}x^\mathrm{T}\\y^\mathrm{T}\end{pmatrix}←\begin{pmatrix}c&s\\-\bar{s}&c\end{pmatrix}\begin{pmatrix}x^\mathrm{T}\\y^\mathrm{T}\end{pmatrix}\text{.}
"""
raise NotImplementedError

[docs]def zcrot(x, y, c, s):
r"""
zcrot applies a complex plane rotation to two complex vectors.

.. _f06hp-py2-py-doc:

For full information please refer to the NAG Library document for f06hp

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06hpf.html

.. _f06hp-py2-py-parameters:

**Parameters**
**x** : complex, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:x.

**y** : complex, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:y.

**c** : complex
The value :math:c, the cosine of the rotation.

**s** : complex
The value :math:s, the sine of the rotation.

**Returns**
**x** : complex, ndarray, shape :math:\left(n\right)
The transformed vector :math:x.

**y** : complex, ndarray, shape :math:\left(n\right)
The transformed vector :math:y.

.. _f06hp-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

zcrot applies a complex plane rotation to two :math:n-element complex vectors :math:x and :math:y:

.. math::
\begin{pmatrix}x^\mathrm{T}\\y^\mathrm{T}\end{pmatrix}←\begin{pmatrix}c&s\\-\bar{s}&\bar{c}\end{pmatrix}\begin{pmatrix}x^\mathrm{T}\\y^\mathrm{T}\end{pmatrix}\text{.}
"""
raise NotImplementedError

[docs]def zsrotg(pivot, direct, alpha, x):
r"""
zsrotg generates a sequence of complex plane rotations.

.. _f06hq-py2-py-doc:

For full information please refer to the NAG Library document for f06hq

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06hqf.html

.. _f06hq-py2-py-parameters:

**Parameters**
**pivot** : str, length 1
Specifies the plane rotated by :math:P_k.

:math:\mathrm{pivot} = \texttt{'V'} (variable pivot)

:math:P_k rotates the :math:\left(k, {k+1}\right) plane.

:math:\mathrm{pivot} = \texttt{'F'} (fixed pivot)

:math:P_k rotates the :math:\left(1, {k+1}\right) plane if :math:\mathrm{direct} = \texttt{'F'}, or the :math:\left(k, {n+1}\right) plane if :math:\mathrm{direct} = \texttt{'B'}.

**direct** : str, length 1
Specifies the sequence direction.

:math:\mathrm{direct} = \texttt{'F'} (forward sequence)

:math:P = P_n \cdots P_2P_1.

:math:\mathrm{direct} = \texttt{'B'} (backward sequence)

:math:P = P_1P_2 \cdots P_n.

**alpha** : complex
The scalar :math:\alpha.

**x** : complex, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:x.

**Returns**
**alpha** : complex
The scalar :math:\beta.

**x** : complex, ndarray, shape :math:\left(n\right)
The referenced elements are overwritten by details of the plane rotations.

**c** : float, ndarray, shape :math:\left(n\right)
The values :math:c_k, the cosines of the rotations.

**s** : complex, ndarray, shape :math:\left(n\right)
The values :math:s_k, the sines of the rotations.

.. _f06hq-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{pivot}.

Constraint: :math:\mathrm{pivot} = \texttt{'V'} or :math:\texttt{'F'}.

(errno :math:2)
On entry, error in parameter :math:\mathrm{direct}.

Constraint: :math:\mathrm{direct} = \texttt{'F'} or :math:\texttt{'B'}.

(errno :math:6)
On entry, error in parameter :math:\textit{incx}.

Constraint: :math:\textit{incx} > 0.

.. _f06hq-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

zsrotg generates the parameters of a complex unitary matrix :math:P, of order :math:n+1, chosen so as to set to zero the elements of a supplied :math:n-element complex vector :math:x.

If :math:\mathrm{pivot} = \texttt{'F'} and :math:\mathrm{direct} = \texttt{'F'}, or if :math:\mathrm{pivot} = \texttt{'V'} and :math:\mathrm{direct} = \texttt{'B'},

.. math::
P\begin{pmatrix}\alpha \\x\end{pmatrix} = \begin{pmatrix}\beta \\0\end{pmatrix}\text{;}

If :math:\mathrm{pivot} = \texttt{'F'} and :math:\mathrm{direct} = \texttt{'B'}, or if :math:\mathrm{pivot} = \texttt{'V'} and :math:\mathrm{direct} = \texttt{'F'},

.. math::
P\begin{pmatrix}x\\\alpha \end{pmatrix} = \begin{pmatrix}0\\\beta \end{pmatrix}\text{.}

Here :math:\alpha and :math:\beta are complex scalars.

:math:P is represented as a sequence of :math:n plane rotations :math:P_k, as specified by :math:\mathrm{pivot} and :math:\mathrm{direct}; :math:P_k is chosen to annihilate :math:x_k, and its :math:2\times 2 plane rotation part has the form

.. math::
\begin{pmatrix}c_k&\bar{s}_k\\-s_k&c_k\end{pmatrix}\text{,}

with :math:c_k real.
The tangent of the rotation, :math:t_k, is overwritten on :math:x_k.
"""
raise NotImplementedError

[docs]def zhousg(alpha, x, tol):
r"""
zhousg generates a complex elementary reflection.

.. _f06hr-py2-py-doc:

For full information please refer to the NAG Library document for f06hr

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06hrf.html

.. _f06hr-py2-py-parameters:

**Parameters**
**alpha** : complex
The scalar :math:\alpha.

**x** : complex, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:x.

**tol** : float
The value :math:\textit{tol}.

**Returns**
**alpha** : complex
The scalar :math:\beta.

**x** : complex, ndarray, shape :math:\left(n\right)
The referenced elements are overwritten by details of the complex elementary reflection.

**theta** : complex
The scalar :math:\theta.

.. _f06hr-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:4)
On entry, error in parameter :math:\textit{incx}.

Constraint: :math:\textit{incx} > 0.

.. _f06hr-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

zhousg generates details of a complex elementary reflection (Householder matrix), :math:P, such that

.. math::
P\begin{pmatrix}\alpha \\x\end{pmatrix} = \begin{pmatrix}\beta \\0\end{pmatrix}

where :math:P is unitary, :math:\alpha is a complex scalar, :math:\beta is a real scalar, and :math:x is an :math:n-element complex vector.

:math:P is given in the form

.. math::
P = I-\gamma \begin{pmatrix}\zeta \\z\end{pmatrix}\begin{pmatrix}\zeta &z^\mathrm{H}\end{pmatrix}\text{,}

where :math:z is an :math:n-element complex vector, :math:\gamma is a complex scalar such that :math:\mathrm{Re}\left(\gamma \right) = 1, and :math:\zeta is a real scalar. :math:\gamma and :math:\zeta are returned in a single complex value :math:\theta = \left(\zeta, {\mathrm{Im}\left(\gamma \right)}\right).
Thus :math:\zeta = \mathrm{Re}\left(\theta \right) and :math:\gamma = \left(1, {\mathrm{Im}\left(\theta \right)}\right).

If :math:x is such that

.. math::
\mathrm{max}\left({\left\lvert \mathrm{Re}\left(x_i\right)\right\rvert }, {\left\lvert \mathrm{Im}\left(x_i\right)\right\rvert }\right)\leq \mathrm{max}\left(\textit{tol},\epsilon \mathrm{max}\left({\left\lvert \mathrm{Re}\left(\alpha \right)\right\rvert }, {\left\lvert \mathrm{Im}\left(\alpha \right)\right\rvert }\right)\right)\text{,}

where :math:\epsilon is the machine precision and :math:\textit{tol} is a user-supplied tolerance, then:

either :math:\theta is set to :math:0, in which case :math:P can be taken to be the unit matrix;

or :math:\theta is set so that :math:\mathrm{Re}\left(\theta \right)\leq 0 and :math:\theta \neq 0, in which case

.. math::
P = \begin{pmatrix}\theta &0\\0&I\end{pmatrix}\text{.}

Otherwise :math:1\leq \mathrm{Re}\left(\theta \right)\leq \sqrt{2}.
"""
raise NotImplementedError

[docs]def zhous(delta, y, theta, z):
r"""
zhous applies a complex elementary reflection to a complex vector.

.. _f06ht-py2-py-doc:

For full information please refer to the NAG Library document for f06ht

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06htf.html

.. _f06ht-py2-py-parameters:

**Parameters**
**delta** : complex
The original scalar :math:\delta.

**y** : complex, array-like, shape :math:\left(n\right)
The original vector :math:y.

**theta** : complex
The value :math:\theta, as returned by :meth:zhousg.

If :math:\theta = 0, :math:P is assumed to be the unit matrix and the transformation is skipped.

**z** : complex, array-like, shape :math:\left(n\right)
The vector :math:z, as returned by :meth:zhousg.

**Returns**
**delta** : complex
The transformed scalar :math:\delta.

**y** : complex, ndarray, shape :math:\left(n\right)
The transformed vector.

.. _f06ht-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:5)
On entry, error in parameter :math:\mathrm{theta}.

Constraint: :math:\mathrm{Re}\left(\mathrm{theta}\right)\leq 0.0.

.. _f06ht-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

zhous applies a complex elementary reflection (Householder matrix) :math:P, as generated by :meth:zhousg, to a given complex vector:

.. math::
\begin{pmatrix}\delta \\y\end{pmatrix}←P\begin{pmatrix}\delta \\y\end{pmatrix}

where :math:y is an :math:n-element complex vector and :math:\delta is a complex scalar.

To apply the conjugate transpose matrix :math:P^\mathrm{H}, call zhous with :math:\bar{\theta } in place of :math:\theta.
"""
raise NotImplementedError

[docs]def zdscal(alpha, x):
r"""
zdscal scales a complex vector by a real scalar.

.. _f06jd-py2-py-doc:

For full information please refer to the NAG Library document for f06jd

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06jdf.html

.. _f06jd-py2-py-parameters:

**Parameters**
**alpha** : float
The scalar :math:\alpha.

**x** : complex, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:x.

**Returns**
**x** : complex, ndarray, shape :math:\left(n\right)
The vector :math:\alpha x.

.. _f06jd-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:4)
On entry, error in parameter :math:\textit{incx}.

Constraint: :math:\textit{incx} > 0.

.. _f06jd-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

zdscal performs the operation

.. math::
x←\alpha x

where :math:x is an :math:n-element complex vector, and :math:\alpha is a real scalar.

.. _f06jd-py2-py-references:

**References**
Lawson, C L, Hanson, R J, Kincaid, D R and Krogh, F T, 1979, Basic linear algebra supbrograms for Fortran usage, ACM Trans. Math. Software (5), 308--325
"""
raise NotImplementedError

[docs]def dznrm2(x):
r"""
dznrm2 computes the Euclidean norm of a complex vector.

.. _f06jj-py2-py-doc:

For full information please refer to the NAG Library document for f06jj

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06jjf.html

.. _f06jj-py2-py-parameters:

**Parameters**
**x** : complex, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:x.

**Returns**
**nrm** : float
The Euclidean norm of the complex vector, :math:x.

.. _f06jj-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:3)
On entry, error in parameter :math:\textit{incx}.

Constraint: :math:\textit{incx} > 0.

.. _f06jj-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

dznrm2 returns the Euclidean norm

.. math::
\left\lVert x\right\rVert_2 = \sqrt{x^\mathrm{H}x}

of the :math:n-element complex vector :math:x.

.. _f06jj-py2-py-references:

**References**
Lawson, C L, Hanson, R J, Kincaid, D R and Krogh, F T, 1979, Basic linear algebra supbrograms for Fortran usage, ACM Trans. Math. Software (5), 308--325
"""
raise NotImplementedError

[docs]def dzasum(x):
r"""
dzasum returns the sum of the absolute values of the real and imaginary parts of the elements in a complex vector.

.. _f06jk-py2-py-doc:

For full information please refer to the NAG Library document for f06jk

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06jkf.html

.. _f06jk-py2-py-parameters:

**Parameters**
**x** : complex, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:x.

**Returns**
**sumx** : float
The sum of the absolute values of the real and imaginary parts of the elements in the complex vector, :math:x.

.. _f06jk-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:3)
On entry, error in parameter :math:\textit{incx}.

Constraint: :math:\textit{incx} > 0.

.. _f06jk-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

dzasum returns the norm

.. math::
\left\lvert \mathrm{Re}\left(x_1\right)\right\rvert +\left\lvert \mathrm{Im}\left(x_1\right)\right\rvert + \cdots +\left\lvert \mathrm{Re}\left(x_n\right)\right\rvert +\left\lvert \mathrm{Im}\left(x_n\right)\right\rvert

of the :math:n-element complex vector :math:x.

.. _f06jk-py2-py-references:

**References**
Lawson, C L, Hanson, R J, Kincaid, D R and Krogh, F T, 1979, Basic linear algebra supbrograms for Fortran usage, ACM Trans. Math. Software (5), 308--325
"""
raise NotImplementedError

[docs]def idamax(x):
r"""
idamax computes the index of the absolutely largest component of a real vector.

.. _f06jl-py2-py-doc:

For full information please refer to the NAG Library document for f06jl

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06jlf.html

.. _f06jl-py2-py-parameters:

**Parameters**
**x** : float, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:x.

**Returns**
**imax** : int
The index of the absolutely largest component of the real vector, :math:x.

.. _f06jl-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:3)
On entry, error in parameter :math:\textit{incx}.

Constraint: :math:\textit{incx} > 0.

.. _f06jl-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

idamax returns the smallest index :math:i such that

.. math::
\left\lvert x_i\right\rvert = \mathrm{max}_j\left\lvert x_j\right\rvert

where :math:x is an :math:n-element real vector.

.. _f06jl-py2-py-references:

**References**
Lawson, C L, Hanson, R J, Kincaid, D R and Krogh, F T, 1979, Basic linear algebra supbrograms for Fortran usage, ACM Trans. Math. Software (5), 308--325
"""
raise NotImplementedError

[docs]def izamax(x):
r"""
izamax computes the index of the absolutely largest component of a complex vector.

.. _f06jm-py2-py-doc:

For full information please refer to the NAG Library document for f06jm

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06jmf.html

.. _f06jm-py2-py-parameters:

**Parameters**
**x** : complex, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:x.

**Returns**
**imax** : int
The index of the absolutely largest component of a complex vector, :math:x.

.. _f06jm-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:3)
On entry, error in parameter :math:\textit{incx}.

Constraint: :math:\textit{incx} > 0.

.. _f06jm-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

izamax returns the smallest index :math:i such that

.. math::
\left\lvert \mathrm{Re}\left(x_i\right)\right\rvert +\left\lvert \mathrm{Im}\left(x_i\right)\right\rvert = \mathrm{max}_j\left(\left\lvert \mathrm{Re}\left(x_j\right)\right\rvert +\left\lvert \mathrm{Im}\left(x_j\right)\right\rvert \right)

where :math:x is an :math:n-element complex vector.

.. _f06jm-py2-py-references:

**References**
Lawson, C L, Hanson, R J, Kincaid, D R and Krogh, F T, 1979, Basic linear algebra supbrograms for Fortran usage, ACM Trans. Math. Software (5), 308--325
"""
raise NotImplementedError

[docs]def zddscl(d, x):
r"""
zddscl multiplies a complex vector by a real diagonal matrix.

.. _f06kc-py2-py-doc:

For full information please refer to the NAG Library document for f06kc

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06kcf.html

.. _f06kc-py2-py-parameters:

**Parameters**
**d** : float, array-like, shape :math:\left(n\right)
The vector :math:d.

**x** : complex, array-like, shape :math:\left(n\right)
The array :math:\mathrm{x} must contain the :math:n-element vector :math:x.

**Returns**
**x** : complex, ndarray, shape :math:\left(n\right)
The updated vector :math:x.

.. _f06kc-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

zddscl performs the operation

.. math::
x←Dx

where :math:x is an :math:n-element complex vector and :math:D = \mathrm{diag}\left(d\right) is a real diagonal matrix.

Equivalently, the function performs the element-by-element product of the vectors :math:x and :math:d

.. math::
x_i = d_ix_i\text{, }\quad i = 1,2,\ldots,n\text{.}
"""
raise NotImplementedError

[docs]def zdaxpzy(alpha, x):
r"""
zdaxpzy multiplies a complex vector by a real scalar, preserving the input vector.

.. _f06kd-py2-py-doc:

For full information please refer to the NAG Library document for f06kd

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06kdf.html

.. _f06kd-py2-py-parameters:

**Parameters**
**alpha** : float
The scalar :math:\alpha.

**x** : complex, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:x.

**Returns**
**y** : complex, ndarray, shape :math:\left(n\right)
The elements :math:y_i of the vector :math:y.

.. _f06kd-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

zdaxpzy performs the operation

.. math::
y←\alpha x

where :math:x and :math:y are :math:n-element complex vectors, and :math:\alpha is a real scalar.
"""
raise NotImplementedError

[docs]def zdrscl(alpha, x):
r"""
zdrscl multiplies a complex vector by the reciprocal of a real scalar.

.. _f06ke-py2-py-doc:

For full information please refer to the NAG Library document for f06ke

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06kef.html

.. _f06ke-py2-py-parameters:

**Parameters**
**alpha** : float
The scalar :math:\alpha.

**x** : complex, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:x.

**Returns**
**x** : complex, ndarray, shape :math:\left(n\right)
The updated vector :math:x.

.. _f06ke-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:2)
On entry, error in parameter :math:\mathrm{alpha}.

Constraint: :math:\mathrm{alpha}\neq 0.0.

(errno :math:4)
On entry, error in parameter :math:\textit{incx}.

Constraint: :math:\textit{incx} > 0.

.. _f06ke-py2-py-notes:

**Notes**
zdrscl performs the operation

.. math::
x←\frac{1}{\alpha }x

where :math:x is an :math:n-element complex vector and :math:\alpha is a real nonzero scalar.
"""
raise NotImplementedError

[docs]def zdcopy(x):
r"""
zdcopy copies a real vector to a complex vector.

.. _f06kf-py2-py-doc:

For full information please refer to the NAG Library document for f06kf

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06kff.html

.. _f06kf-py2-py-parameters:

**Parameters**
**x** : float, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:x.

**Returns**
**y** : complex, ndarray, shape :math:\left(n\right)
The elements :math:y_i of the vector :math:y.

.. _f06kf-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

zdcopy performs the operation

.. math::
y←x

where :math:x is an :math:n-element real vector, and :math:y is an :math:n-element complex vector.
"""
raise NotImplementedError

[docs]def dzssq(x, scal, sumsq):
r"""
dzssq updates the Euclidean norm of complex vector in scaled form.

.. _f06kj-py2-py-doc:

For full information please refer to the NAG Library document for f06kj

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06kjf.html

.. _f06kj-py2-py-parameters:

**Parameters**
**x** : complex, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:x.

**scal** : float
The scaling factor :math:\alpha. On the first call to dzssq :math:\mathrm{scal} = 0.0.

**sumsq** : float
The scaled sum of squares :math:\xi. On the first call to dzssq :math:\mathrm{sumsq} = 1.0.

**Returns**
**scal** : float
The updated scaling factor :math:\tilde{\alpha } = \mathrm{max}_i\left(\alpha, {\left\lvert \mathrm{Re}\left(x_i\right)\right\rvert }, {\left\lvert \mathrm{Im}\left(x_i\right)\right\rvert }\right).

**sumsq** : float
The updated scaled sum of squares :math:\tilde{\xi }, satisfying: :math:1\leq \tilde{\xi }\leq \xi +2n.

.. _f06kj-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:3)
On entry, error in parameter :math:\textit{incx}.

Constraint: :math:\textit{incx} > 0.

(errno :math:4)
On entry, error in parameter :math:\mathrm{scal}.

Constraint: :math:\mathrm{scal}\geq 0.

(errno :math:5)
On entry, error in parameter :math:\mathrm{sumsq}.

Constraint: :math:\mathrm{sumsq}\geq 1.

.. _f06kj-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

Given an :math:n-element complex vector :math:x, and real scalars :math:\alpha and :math:\xi, dzssq returns updated values :math:\tilde{\alpha } and :math:\tilde{\xi } such that

.. math::
\tilde{\alpha }^2\tilde{\xi } = \left\lvert x_1\right\rvert^2+\left\lvert x_2\right\rvert^2 + \cdots +\left\lvert x_n\right\rvert^2+\alpha^2\xi \text{.}

dzssq is designed for use in the safe computation of the Euclidean norm of a complex vector, without unnecessary overflow or destructive underflow.
An initial call to dzssq (with :math:\xi = 1 and :math:\alpha = 0) may be followed by further calls to dzssq and finally a call to :meth:dnorm to complete the computation.
Multiple calls of dzssq may be needed if the elements of the vector cannot all be accessed in a single array :math:\mathrm{x}.
"""
raise NotImplementedError

[docs]def idrank(x, tol):
r"""
idrank determines the index of the first negligible element of a real vector.

.. _f06kl-py2-py-doc:

For full information please refer to the NAG Library document for f06kl

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06klf.html

.. _f06kl-py2-py-parameters:

**Parameters**
**x** : float, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:x.

**tol** : float
The value :math:\textit{tol}.

**Returns**
**k** : int
The index of the first negligible element of the real vector.

.. _f06kl-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:3)
On entry, error in parameter :math:\textit{incx}.

Constraint: :math:\textit{incx} > 0.

.. _f06kl-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

idrank finds the first element of the :math:n-element real vector :math:x for which

.. math::
\left\lvert x_{{k+1}}\right\rvert \leq \textit{tol}\mathrm{max}\left({\left\lvert x_1\right\rvert,\ldots }, {\left\lvert x_k\right\rvert }\right)

and returns the index :math:k.
If no such :math:k exists, then the value :math:n is returned.
If a negative value of :math:\textit{tol} is supplied, the value of machine precision is used in place of :math:\textit{tol}.
"""
raise NotImplementedError

[docs]def zdrot(x, y, c, s):
r"""
zdrot applies a real plane rotation to two complex vectors.

.. _f06kp-py2-py-doc:

For full information please refer to the NAG Library document for f06kp

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06kpf.html

.. _f06kp-py2-py-parameters:

**Parameters**
**x** : complex, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:x.

**y** : complex, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:y.

**c** : float
The value :math:c, the cosine of the rotation.

**s** : float
The value :math:s, the sine of the rotation.

**Returns**
**x** : complex, ndarray, shape :math:\left(n\right)
The transformed vector :math:x.

**y** : complex, ndarray, shape :math:\left(n\right)
The transformed vector :math:y.

.. _f06kp-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

zdrot applies a real plane rotation to two :math:n-element complex vectors :math:x and :math:y:

.. math::
\begin{pmatrix}x^\mathrm{T}\\y^\mathrm{T}\end{pmatrix}←\begin{pmatrix}c&s\\-s&c\end{pmatrix}\begin{pmatrix}x^\mathrm{T}\\y^\mathrm{T}\end{pmatrix}\text{.}

The plane rotation has the form generated by :meth:drotg or :meth:drotgc.
"""
raise NotImplementedError

[docs]def dgemv(trans, m, alpha, a, x, beta, y=None):
r"""
dgemv computes the matrix-vector product for a real general matrix or its transpose.

.. _f06pa-py2-py-doc:

For full information please refer to the NAG Library document for f06pa

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06paf.html

.. _f06pa-py2-py-parameters:

**Parameters**
**trans** : str, length 1
Specifies the operation to be performed.

:math:\mathrm{trans} = \texttt{'N'}

:math:y←\alpha Ax+\beta y.

:math:\mathrm{trans} = \texttt{'T'} or :math:\texttt{'C'}

:math:y←\alpha A^\mathrm{T}x+\beta y.

**m** : int
:math:m, the number of rows of the matrix :math:A.

**alpha** : float
The scalar :math:\alpha.

**a** : float, array-like, shape :math:\left(\mathrm{m}, n\right)
The :math:m\times n matrix :math:A.

**x** : float, array-like, shape :math:\left(:\right)
Note: the required length for this argument is determined as follows: if :math:\mathrm{trans}=\texttt{'N'}: :math:n; if :math:\mathrm{trans}\text{ in } (\texttt{'T'}, \texttt{'C'}): :math:\mathrm{m}; otherwise: :math:0.

The vector :math:x.

**beta** : float
The scalar :math:\beta.

**y** : None or float, array-like, shape :math:\left(:\right), optional
Note: the required length for this argument is determined as follows: if :math:\mathrm{trans}=\texttt{'N'}: :math:\mathrm{m}; if :math:\mathrm{trans}\text{ in } (\texttt{'T'}, \texttt{'C'}): :math:n; otherwise: :math:0.

The vector :math:y, if :math:\mathrm{beta} = 0.0, :math:\mathrm{y} need not be set.

**Returns**
**y** : float, ndarray, shape :math:\left(:\right)
The updated vector :math:y.

.. _f06pa-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{trans}.

Constraint: :math:\mathrm{trans} = \texttt{'N'}, :math:\texttt{'T'} or :math:\texttt{'C'}.

(errno :math:2)
On entry, error in parameter :math:\mathrm{m}.

Constraint: :math:\mathrm{m}\geq 0.

(errno :math:3)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

(errno :math:8)
On entry, error in parameter :math:\textit{incx}.

Constraint: :math:\textit{incx}\neq 0.

(errno :math:11)
On entry, error in parameter :math:\textit{incy}.

Constraint: :math:\textit{incy}\neq 0.

.. _f06pa-py2-py-notes:

**Notes**
In the NAG Library the traditional C interface for this routine uses a different algorithmic base. Please contact NAG if you have any questions about compatibility.

dgemv performs one of the matrix-vector operations

.. math::
y←\alpha Ax+\beta y\text{, or }\quad y←\alpha A^\mathrm{T}x+\beta y\text{,}

where :math:A is an :math:m\times n real matrix, :math:x and :math:y are real vectors, and :math:\alpha and :math:\beta are real scalars.

If :math:m = 0 or :math:n = 0, no operation is performed.
"""
raise NotImplementedError

[docs]def dgbmv(trans, m, kl, ku, alpha, a, x, beta, y=None):
r"""
dgbmv computes the matrix-vector product for a real general band matrix or its transpose.

.. _f06pb-py2-py-doc:

For full information please refer to the NAG Library document for f06pb

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06pbf.html

.. _f06pb-py2-py-parameters:

**Parameters**
**trans** : str, length 1
Specifies the operation to be performed.

:math:\mathrm{trans} = \texttt{'N'}

:math:y←\alpha Ax+\beta y.

:math:\mathrm{trans} = \texttt{'T'} or :math:\texttt{'C'}

:math:y←\alpha A^\mathrm{T}x+\beta y.

**m** : int
:math:m, the number of rows of the matrix :math:A.

**kl** : int
:math:k_l, the number of subdiagonals within the band of :math:A.

**ku** : int
:math:k_u, the number of superdiagonals within the band of :math:A.

**alpha** : float
The scalar :math:\alpha.

**a** : float, array-like, shape :math:\left(\mathrm{kl}+\mathrm{ku}+1, n\right)
The :math:m\times n band matrix :math:A.

**x** : float, array-like, shape :math:\left(:\right)
Note: the required length for this argument is determined as follows: if :math:\mathrm{trans}=\texttt{'N'}: :math:n; if :math:\mathrm{trans}\text{ in } (\texttt{'T'}, \texttt{'C'}): :math:\mathrm{m}; otherwise: :math:0.

The vector :math:x.

**beta** : float
The scalar :math:\beta.

**y** : None or float, array-like, shape :math:\left(:\right), optional
Note: the required length for this argument is determined as follows: if :math:\mathrm{trans}=\texttt{'N'}: :math:\mathrm{m}; if :math:\mathrm{trans}\text{ in } (\texttt{'T'}, \texttt{'C'}): :math:n; otherwise: :math:0.

The vector :math:y, if :math:\mathrm{beta} = 0.0, :math:\mathrm{y} need not be set.

**Returns**
**y** : float, ndarray, shape :math:\left(:\right)
The updated vector :math:y.

.. _f06pb-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{trans}.

Constraint: :math:\mathrm{trans} = \texttt{'N'}, :math:\texttt{'T'} or :math:\texttt{'C'}.

(errno :math:2)
On entry, error in parameter :math:\mathrm{m}.

Constraint: :math:\mathrm{m}\geq 0.

(errno :math:3)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

(errno :math:4)
On entry, error in parameter :math:\mathrm{kl}.

Constraint: :math:\mathrm{kl}\geq 0.

(errno :math:5)
On entry, error in parameter :math:\mathrm{ku}.

Constraint: :math:\mathrm{ku}\geq 0.

(errno :math:10)
On entry, error in parameter :math:\textit{incx}.

Constraint: :math:\textit{incx}\neq 0.

(errno :math:13)
On entry, error in parameter :math:\textit{incy}.

Constraint: :math:\textit{incy}\neq 0.

.. _f06pb-py2-py-notes:

**Notes**
In the NAG Library the traditional C interface for this routine uses a different algorithmic base. Please contact NAG if you have any questions about compatibility.

dgbmv performs one of the matrix-vector operations

.. math::

where :math:A is an :math:m\times n real band matrix with :math:k_l subdiagonals and :math:k_u superdiagonals, :math:x and :math:y are real vectors, and :math:\alpha and :math:\beta are real scalars.

If :math:m = 0 or :math:n = 0, no operation is performed.
"""
raise NotImplementedError

[docs]def dsymv(uplo, alpha, a, x, beta, y=None):
r"""
dsymv the matrix-vector product for a real symmetric matrix.

.. _f06pc-py2-py-doc:

For full information please refer to the NAG Library document for f06pc

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06pcf.html

.. _f06pc-py2-py-parameters:

**Parameters**
**uplo** : str, length 1
Specifies whether the upper or lower triangular part of :math:A is stored.

:math:\mathrm{uplo} = \texttt{'U'}

The upper triangular part of :math:A is stored.

:math:\mathrm{uplo} = \texttt{'L'}

The lower triangular part of :math:A is stored.

**alpha** : float
The scalar :math:\alpha.

**a** : float, array-like, shape :math:\left(n, n\right)
The :math:n\times n symmetric matrix :math:A.

**x** : float, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:x.

**beta** : float
The scalar :math:\beta.

**y** : None or float, array-like, shape :math:\left(n\right), optional
The :math:n-element vector :math:y, if :math:\mathrm{beta} = 0.0 :math:\mathrm{y} need not be set.

**Returns**
**y** : float, ndarray, shape :math:\left(n\right)
The updated vector :math:y.

.. _f06pc-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{uplo}.

Constraint: :math:\mathrm{uplo} = \texttt{'U'} or :math:\texttt{'L'}.

(errno :math:2)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

(errno :math:7)
On entry, error in parameter :math:\textit{incx}.

Constraint: :math:\textit{incx}\neq 0.

(errno :math:10)
On entry, error in parameter :math:\textit{incy}.

Constraint: :math:\textit{incy}\neq 0.

.. _f06pc-py2-py-notes:

**Notes**
In the NAG Library the traditional C interface for this routine uses a different algorithmic base. Please contact NAG if you have any questions about compatibility.

dsymv performs the matrix-vector operation

.. math::
y←\alpha Ax+\beta y\text{,}

where :math:A is an :math:n\times n real symmetric matrix, :math:x and :math:y are :math:n-element real vectors, and :math:\alpha and :math:\beta are real scalars.
"""
raise NotImplementedError

[docs]def dsbmv(uplo, k, alpha, a, x, beta, y=None):
r"""
dsbmv computes the matrix-vector product for a real symmetric band matrix.

.. _f06pd-py2-py-doc:

For full information please refer to the NAG Library document for f06pd

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06pdf.html

.. _f06pd-py2-py-parameters:

**Parameters**
**uplo** : str, length 1
Specifies whether the upper or lower triangular part of :math:A is stored.

:math:\mathrm{uplo} = \texttt{'U'}

The upper triangular part of :math:A is stored.

:math:\mathrm{uplo} = \texttt{'L'}

The lower triangular part of :math:A is stored.

**k** : int
:math:k, the number of subdiagonals or superdiagonals of the matrix :math:A.

**alpha** : float
The scalar :math:\alpha.

**a** : float, array-like, shape :math:\left(\mathrm{k}+1, n\right)
The :math:n\times n symmetric band matrix :math:A.

**x** : float, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:x.

**beta** : float
The scalar :math:\beta.

**y** : None or float, array-like, shape :math:\left(n\right), optional
The :math:n-element vector :math:y, if :math:\mathrm{beta} = 0.0 :math:\mathrm{y} need not be set.

**Returns**
**y** : float, ndarray, shape :math:\left(n\right)
The updated vector :math:y.

.. _f06pd-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{uplo}.

Constraint: :math:\mathrm{uplo} = \texttt{'U'} or :math:\texttt{'L'}.

(errno :math:2)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

(errno :math:3)
On entry, error in parameter :math:\mathrm{k}.

Constraint: :math:\mathrm{k}\geq 0.

(errno :math:8)
On entry, error in parameter :math:\textit{incx}.

Constraint: :math:\textit{incx}\neq 0.

(errno :math:11)
On entry, error in parameter :math:\textit{incy}.

Constraint: :math:\textit{incy}\neq 0.

.. _f06pd-py2-py-notes:

**Notes**
In the NAG Library the traditional C interface for this routine uses a different algorithmic base. Please contact NAG if you have any questions about compatibility.

dsbmv performs the matrix-vector operation

.. math::
y←\alpha Ax+\beta y\text{,}

where :math:A is an :math:n\times n real symmetric band matrix with :math:k subdiagonals and :math:k superdiagonals, :math:x and :math:y are :math:n-element real vectors, and :math:\alpha and :math:\beta are real scalars.
"""
raise NotImplementedError

[docs]def dspmv(uplo, alpha, ap, x, beta, y=None):
r"""
dspmv computes the matrix-vector product for a real symmetric matrix stored in packed form.

.. _f06pe-py2-py-doc:

For full information please refer to the NAG Library document for f06pe

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06pef.html

.. _f06pe-py2-py-parameters:

**Parameters**
**uplo** : str, length 1
Specifies whether the upper or lower triangular part of :math:A is stored.

:math:\mathrm{uplo} = \texttt{'U'}

The upper triangular part of :math:A is stored.

:math:\mathrm{uplo} = \texttt{'L'}

The lower triangular part of :math:A is stored.

**alpha** : float
The scalar :math:\alpha.

**ap** : float, array-like, shape :math:\left(n\times \left(n+1\right)/2\right)
The :math:n\times n symmetric matrix :math:A, packed by columns.

**x** : float, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:x.

**beta** : float
The scalar :math:\beta.

**y** : None or float, array-like, shape :math:\left(n\right), optional
The :math:n-element vector :math:y, if :math:\mathrm{beta} = 0.0 :math:\mathrm{y} need not be set.

**Returns**
**y** : float, ndarray, shape :math:\left(n\right)
The updated vector :math:y.

.. _f06pe-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{uplo}.

Constraint: :math:\mathrm{uplo} = \texttt{'U'} or :math:\texttt{'L'}.

(errno :math:2)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

(errno :math:6)
On entry, error in parameter :math:\textit{incx}.

Constraint: :math:\textit{incx}\neq 0.

(errno :math:9)
On entry, error in parameter :math:\textit{incy}.

Constraint: :math:\textit{incy}\neq 0.

.. _f06pe-py2-py-notes:

**Notes**
In the NAG Library the traditional C interface for this routine uses a different algorithmic base. Please contact NAG if you have any questions about compatibility.

dspmv performs the matrix-vector operation

.. math::
y←\alpha Ax+\beta y\text{,}

where :math:A is an :math:n\times n real symmetric matrix stored in packed form, :math:x and :math:y are :math:n-element real vectors, and :math:\alpha and :math:\beta are real scalars.
"""
raise NotImplementedError

[docs]def dtrmv(uplo, trans, diag, a, x):
r"""
dtrmv computes the matrix-vector product for a real triangular matrix or its transpose.

.. _f06pf-py2-py-doc:

For full information please refer to the NAG Library document for f06pf

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06pff.html

.. _f06pf-py2-py-parameters:

**Parameters**
**uplo** : str, length 1
Specifies whether :math:A is upper or lower triangular.

:math:\mathrm{uplo} = \texttt{'U'}

:math:A is upper triangular.

:math:\mathrm{uplo} = \texttt{'L'}

:math:A is lower triangular.

**trans** : str, length 1
Specifies the operation to be performed.

:math:\mathrm{trans} = \texttt{'N'}

:math:x←Ax.

:math:\mathrm{trans} = \texttt{'T'} or :math:\texttt{'C'}

:math:x←A^\mathrm{T}x.

**diag** : str, length 1
Specifies whether :math:A has nonunit or unit diagonal elements.

:math:\mathrm{diag} = \texttt{'N'}

The diagonal elements are stored explicitly.

:math:\mathrm{diag} = \texttt{'U'}

The diagonal elements are assumed to be :math:1, and are not referenced.

**a** : float, array-like, shape :math:\left(n, n\right)
The :math:n\times n triangular matrix :math:A.

**x** : float, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:x.

**Returns**
**x** : float, ndarray, shape :math:\left(n\right)
The updated vector :math:x.

.. _f06pf-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{uplo}.

Constraint: :math:\mathrm{uplo} = \texttt{'U'} or :math:\texttt{'L'}.

(errno :math:2)
On entry, error in parameter :math:\mathrm{trans}.

Constraint: :math:\mathrm{trans} = \texttt{'N'}, :math:\texttt{'T'} or :math:\texttt{'C'}.

(errno :math:3)
On entry, error in parameter :math:\mathrm{diag}.

Constraint: :math:\mathrm{diag} = \texttt{'N'} or :math:\texttt{'U'}.

(errno :math:4)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

(errno :math:8)
On entry, error in parameter :math:\textit{incx}.

Constraint: :math:\textit{incx}\neq 0.

.. _f06pf-py2-py-notes:

**Notes**
In the NAG Library the traditional C interface for this routine uses a different algorithmic base. Please contact NAG if you have any questions about compatibility.

dtrmv performs one of the matrix-vector operations

.. math::

where :math:A is an :math:n\times n real triangular matrix, and :math:x is an :math:n-element real vector.
"""
raise NotImplementedError

[docs]def dtbmv(uplo, trans, diag, k, a, x):
r"""
dtbmv computes the matrix-vector product for a real triangular band matrix or its transpose.

.. _f06pg-py2-py-doc:

For full information please refer to the NAG Library document for f06pg

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06pgf.html

.. _f06pg-py2-py-parameters:

**Parameters**
**uplo** : str, length 1
Specifies whether :math:A is upper or lower triangular.

:math:\mathrm{uplo} = \texttt{'U'}

:math:A is upper triangular.

:math:\mathrm{uplo} = \texttt{'L'}

:math:A is lower triangular.

**trans** : str, length 1
Specifies the operation to be performed.

:math:\mathrm{trans} = \texttt{'N'}

:math:x←Ax.

:math:\mathrm{trans} = \texttt{'T'} or :math:\texttt{'C'}

:math:x←A^\mathrm{T}x.

**diag** : str, length 1
Specifies whether :math:A has nonunit or unit diagonal elements.

:math:\mathrm{diag} = \texttt{'N'}

The diagonal elements are stored explicitly.

:math:\mathrm{diag} = \texttt{'U'}

The diagonal elements are assumed to be :math:1, and are not referenced.

**k** : int
:math:k, the number of subdiagonals or superdiagonals of the matrix :math:A.

**a** : float, array-like, shape :math:\left(\mathrm{k}+1, n\right)
The :math:n\times n triangular band matrix :math:A

**x** : float, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:x.

**Returns**
**x** : float, ndarray, shape :math:\left(n\right)
The updated vector :math:x.

.. _f06pg-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{uplo}.

Constraint: :math:\mathrm{uplo} = \texttt{'U'} or :math:\texttt{'L'}.

(errno :math:2)
On entry, error in parameter :math:\mathrm{trans}.

Constraint: :math:\mathrm{trans} = \texttt{'N'}, :math:\texttt{'T'} or :math:\texttt{'C'}.

(errno :math:3)
On entry, error in parameter :math:\mathrm{diag}.

Constraint: :math:\mathrm{diag} = \texttt{'N'} or :math:\texttt{'U'}.

(errno :math:4)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

(errno :math:5)
On entry, error in parameter :math:\mathrm{k}.

Constraint: :math:\mathrm{k}\geq 0.

(errno :math:9)
On entry, error in parameter :math:\textit{incx}.

Constraint: :math:\textit{incx}\neq 0.

.. _f06pg-py2-py-notes:

**Notes**
In the NAG Library the traditional C interface for this routine uses a different algorithmic base. Please contact NAG if you have any questions about compatibility.

dtbmv performs one of the matrix-vector operations

.. math::

where :math:A is an :math:n\times n real triangular band matrix with :math:k subdiagonals or superdiagonals, and :math:x is an :math:n-element real vector.
"""
raise NotImplementedError

[docs]def dtpmv(uplo, trans, diag, ap, x):
r"""
dtpmv computes the matrix-vector product for a real triangular matrix, or its transpose, stored in packed form.

.. _f06ph-py2-py-doc:

For full information please refer to the NAG Library document for f06ph

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06phf.html

.. _f06ph-py2-py-parameters:

**Parameters**
**uplo** : str, length 1
Specifies whether :math:A is upper or lower triangular.

:math:\mathrm{uplo} = \texttt{'U'}

:math:A is upper triangular.

:math:\mathrm{uplo} = \texttt{'L'}

:math:A is lower triangular.

**trans** : str, length 1
Specifies the operation to be performed.

:math:\mathrm{trans} = \texttt{'N'}

:math:x←Ax.

:math:\mathrm{trans} = \texttt{'T'} or :math:\texttt{'C'}

:math:x←A^\mathrm{T}x.

**diag** : str, length 1
Specifies whether :math:A has nonunit or unit diagonal elements.

:math:\mathrm{diag} = \texttt{'N'}

The diagonal elements are stored explicitly.

:math:\mathrm{diag} = \texttt{'U'}

The diagonal elements are assumed to be :math:1, and are not referenced.

**ap** : float, array-like, shape :math:\left(n\times \left(n+1\right)/2\right)
The :math:n\times n triangular matrix :math:A, packed by columns.

**x** : float, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:x.

**Returns**
**x** : float, ndarray, shape :math:\left(n\right)
The updated vector :math:x.

.. _f06ph-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{uplo}.

Constraint: :math:\mathrm{uplo} = \texttt{'U'} or :math:\texttt{'L'}.

(errno :math:2)
On entry, error in parameter :math:\mathrm{trans}.

Constraint: :math:\mathrm{trans} = \texttt{'N'}, :math:\texttt{'T'} or :math:\texttt{'C'}.

(errno :math:3)
On entry, error in parameter :math:\mathrm{diag}.

Constraint: :math:\mathrm{diag} = \texttt{'N'} or :math:\texttt{'U'}.

(errno :math:4)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

(errno :math:7)
On entry, error in parameter :math:\textit{incx}.

Constraint: :math:\textit{incx}\neq 0.

.. _f06ph-py2-py-notes:

**Notes**
In the NAG Library the traditional C interface for this routine uses a different algorithmic base. Please contact NAG if you have any questions about compatibility.

dtpmv performs one of the matrix-vector operations

.. math::

where :math:A is an :math:n\times n real triangular matrix, stored in packed form, and :math:x is an :math:n-element real vector.
"""
raise NotImplementedError

[docs]def dtrsv(uplo, trans, diag, a, x):
r"""
dtrsv solves a real triangular system of equations with a single right-hand side.

.. _f06pj-py2-py-doc:

For full information please refer to the NAG Library document for f06pj

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06pjf.html

.. _f06pj-py2-py-parameters:

**Parameters**
**uplo** : str, length 1
Specifies whether :math:A is upper or lower triangular.

:math:\mathrm{uplo} = \texttt{'U'}

:math:A is upper triangular.

:math:\mathrm{uplo} = \texttt{'L'}

:math:A is lower triangular.

**trans** : str, length 1
Specifies the operation to be performed.

:math:\mathrm{trans} = \texttt{'N'}

:math:x←A^{-1}x.

:math:\mathrm{trans} = \texttt{'T'} or :math:\texttt{'C'}

:math:x←A^{-\mathrm{T}}x.

**diag** : str, length 1
Specifies whether :math:A has nonunit or unit diagonal elements.

:math:\mathrm{diag} = \texttt{'N'}

The diagonal elements are stored explicitly.

:math:\mathrm{diag} = \texttt{'U'}

The diagonal elements are assumed to be :math:1, and are not referenced.

**a** : float, array-like, shape :math:\left(n, n\right)
The :math:n\times n triangular matrix :math:A.

**x** : float, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:x.

**Returns**
**x** : float, ndarray, shape :math:\left(n\right)
The updated vector :math:x.

.. _f06pj-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{uplo}.

Constraint: :math:\mathrm{uplo} = \texttt{'U'} or :math:\texttt{'L'}.

(errno :math:2)
On entry, error in parameter :math:\mathrm{trans}.

Constraint: :math:\mathrm{trans} = \texttt{'N'}, :math:\texttt{'T'} or :math:\texttt{'C'}.

(errno :math:3)
On entry, error in parameter :math:\mathrm{diag}.

Constraint: :math:\mathrm{diag} = \texttt{'N'} or :math:\texttt{'U'}.

(errno :math:4)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

(errno :math:8)
On entry, error in parameter :math:\textit{incx}.

Constraint: :math:\textit{incx}\neq 0.

.. _f06pj-py2-py-notes:

**Notes**
In the NAG Library the traditional C interface for this routine uses a different algorithmic base. Please contact NAG if you have any questions about compatibility.

dtrsv performs one of the matrix-vector operations

.. math::

where :math:A is an :math:n\times n real triangular matrix, and :math:x is an :math:n-element real vector. :math:A^{-\mathrm{T}} denotes :math:\left(A^\mathrm{T}\right)^{-1} or equivalently :math:\left(A^{-1}\right)^\mathrm{T}.

No test for singularity or near-singularity of :math:A is included in this function.
Such tests must be performed before calling this function.
"""
raise NotImplementedError

[docs]def dtbsv(uplo, trans, diag, k, a, x):
r"""
dtbsv solves a real triangular banded system of equations with a single right-hand side.

.. _f06pk-py2-py-doc:

For full information please refer to the NAG Library document for f06pk

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06pkf.html

.. _f06pk-py2-py-parameters:

**Parameters**
**uplo** : str, length 1
Specifies whether :math:A is upper or lower triangular.

:math:\mathrm{uplo} = \texttt{'U'}

:math:A is upper triangular.

:math:\mathrm{uplo} = \texttt{'L'}

:math:A is lower triangular.

**trans** : str, length 1
Specifies the operation to be performed.

:math:\mathrm{trans} = \texttt{'N'}

:math:x←A^{-1}x.

:math:\mathrm{trans} = \texttt{'T'} or :math:\texttt{'C'}

:math:x←A^{-\mathrm{T}}x.

**diag** : str, length 1
Specifies whether :math:A has nonunit or unit diagonal elements.

:math:\mathrm{diag} = \texttt{'N'}

The diagonal elements are stored explicitly.

:math:\mathrm{diag} = \texttt{'U'}

The diagonal elements are assumed to be :math:1, and are not referenced.

**k** : int
:math:k, the number of subdiagonals or superdiagonals of the matrix :math:A.

**a** : float, array-like, shape :math:\left(\mathrm{k}+1, n\right)
The :math:n\times n triangular band matrix :math:A

**x** : float, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:x.

**Returns**
**x** : float, ndarray, shape :math:\left(n\right)
The updated vector :math:x.

.. _f06pk-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{uplo}.

Constraint: :math:\mathrm{uplo} = \texttt{'U'} or :math:\texttt{'L'}.

(errno :math:2)
On entry, error in parameter :math:\mathrm{trans}.

Constraint: :math:\mathrm{trans} = \texttt{'N'}, :math:\texttt{'T'} or :math:\texttt{'C'}.

(errno :math:3)
On entry, error in parameter :math:\mathrm{diag}.

Constraint: :math:\mathrm{diag} = \texttt{'N'} or :math:\texttt{'U'}.

(errno :math:4)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

(errno :math:5)
On entry, error in parameter :math:\mathrm{k}.

Constraint: :math:\mathrm{k}\geq 0.

(errno :math:9)
On entry, error in parameter :math:\textit{incx}.

Constraint: :math:\textit{incx}\neq 0.

.. _f06pk-py2-py-notes:

**Notes**
In the NAG Library the traditional C interface for this routine uses a different algorithmic base. Please contact NAG if you have any questions about compatibility.

dtbsv performs one of the matrix-vector operations

.. math::

where :math:A is an :math:n\times n real triangular band matrix with :math:k subdiagonals or superdiagonals, and :math:x is an :math:n-element real vector. :math:A^{-\mathrm{T}} denotes :math:\left(A^\mathrm{T}\right)^{-1} or equivalently :math:\left(A^{-1}\right)^\mathrm{T}.

No test for singularity or near-singularity of :math:A is included in this function.
Such tests must be performed before calling this function.
"""
raise NotImplementedError

[docs]def dtpsv(uplo, trans, diag, ap, x):
r"""
dtpsv solves a real triangular system of equations, stored in packed form, with a single right-hand side.

.. _f06pl-py2-py-doc:

For full information please refer to the NAG Library document for f06pl

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06plf.html

.. _f06pl-py2-py-parameters:

**Parameters**
**uplo** : str, length 1
Specifies whether :math:A is upper or lower triangular.

:math:\mathrm{uplo} = \texttt{'U'}

:math:A is upper triangular.

:math:\mathrm{uplo} = \texttt{'L'}

:math:A is lower triangular.

**trans** : str, length 1
Specifies the operation to be performed.

:math:\mathrm{trans} = \texttt{'N'}

:math:x←A^{-1}x.

:math:\mathrm{trans} = \texttt{'T'} or :math:\texttt{'C'}

:math:x←A^{-\mathrm{T}}x.

**diag** : str, length 1
Specifies whether :math:A has nonunit or unit diagonal elements.

:math:\mathrm{diag} = \texttt{'N'}

The diagonal elements are stored explicitly.

:math:\mathrm{diag} = \texttt{'U'}

The diagonal elements are assumed to be :math:1, and are not referenced.

**ap** : float, array-like, shape :math:\left(n\times \left(n+1\right)/2\right)
The :math:n\times n triangular matrix :math:A, packed by columns.

**x** : float, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:x.

**Returns**
**x** : float, ndarray, shape :math:\left(n\right)
The updated vector :math:x.

.. _f06pl-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{uplo}.

Constraint: :math:\mathrm{uplo} = \texttt{'U'} or :math:\texttt{'L'}.

(errno :math:2)
On entry, error in parameter :math:\mathrm{trans}.

Constraint: :math:\mathrm{trans} = \texttt{'N'}, :math:\texttt{'T'} or :math:\texttt{'C'}.

(errno :math:3)
On entry, error in parameter :math:\mathrm{diag}.

Constraint: :math:\mathrm{diag} = \texttt{'N'} or :math:\texttt{'U'}.

(errno :math:4)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

(errno :math:7)
On entry, error in parameter :math:\textit{incx}.

Constraint: :math:\textit{incx}\neq 0.

.. _f06pl-py2-py-notes:

**Notes**
In the NAG Library the traditional C interface for this routine uses a different algorithmic base. Please contact NAG if you have any questions about compatibility.

dtpsv performs one of the matrix-vector operations

.. math::

where :math:A is an :math:n\times n real triangular matrix, stored in packed form, and :math:x is an :math:n-element real vector. :math:A^{-\mathrm{T}} denotes :math:A^{-\mathrm{T}} or equivalently :math:A^{-\mathrm{T}}.

No test for singularity or near-singularity of :math:A is included in this function.
Such tests must be performed before calling this function.
"""
raise NotImplementedError

[docs]def dger(alpha, x, y, a):
r"""
dger computes the rank-1 update of a real general matrix.

.. _f06pm-py2-py-doc:

For full information please refer to the NAG Library document for f06pm

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06pmf.html

.. _f06pm-py2-py-parameters:

**Parameters**
**alpha** : float
The scalar :math:\alpha.

**x** : float, array-like, shape :math:\left(m\right)
The :math:m element vector :math:x.

**y** : float, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:y.

**a** : float, array-like, shape :math:\left(m, n\right)
The :math:m\times n matrix :math:A.

**Returns**
**a** : float, ndarray, shape :math:\left(m, n\right)
The updated matrix :math:A.

.. _f06pm-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\textit{m}.

Constraint: :math:m\geq 0.

(errno :math:2)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

(errno :math:5)
On entry, error in parameter :math:\textit{incx}.

Constraint: :math:\textit{incx}\neq 0.

(errno :math:7)
On entry, error in parameter :math:\textit{incy}.

Constraint: :math:\textit{incy}\neq 0.

.. _f06pm-py2-py-notes:

**Notes**
In the NAG Library the traditional C interface for this routine uses a different algorithmic base. Please contact NAG if you have any questions about compatibility.

dger performs the rank-1 update operation

.. math::
A←\alpha xy^\mathrm{T}+A\text{,}

where :math:A is an :math:m\times n real matrix, :math:x is an :math:m element real vector, :math:y is an :math:n-element real vector, and :math:\alpha is a real scalar.
"""
raise NotImplementedError

[docs]def dsyr(uplo, alpha, x, a):
r"""
dsyr computes the rank-1 update of a real symmetric matrix.

.. _f06pp-py2-py-doc:

For full information please refer to the NAG Library document for f06pp

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06ppf.html

.. _f06pp-py2-py-parameters:

**Parameters**
**uplo** : str, length 1
Specifies whether the upper or lower triangular part of :math:A is stored.

:math:\mathrm{uplo} = \texttt{'U'}

The upper triangular part of :math:A is stored.

:math:\mathrm{uplo} = \texttt{'L'}

The lower triangular part of :math:A is stored.

**alpha** : float
The scalar :math:\alpha.

**x** : float, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:x.

**a** : float, array-like, shape :math:\left(n, n\right)
The :math:n\times n symmetric matrix :math:A.

**Returns**
**a** : float, ndarray, shape :math:\left(n, n\right)
The updated matrix :math:A.

.. _f06pp-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{uplo}.

Constraint: :math:\mathrm{uplo} = \texttt{'U'} or :math:\texttt{'L'}.

(errno :math:2)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

(errno :math:5)
On entry, error in parameter :math:\textit{incx}.

Constraint: :math:\textit{incx}\neq 0.

.. _f06pp-py2-py-notes:

**Notes**
In the NAG Library the traditional C interface for this routine uses a different algorithmic base. Please contact NAG if you have any questions about compatibility.

dsyr performs the symmetric rank-1 update operation

.. math::
A←\alpha xx^\mathrm{T}+A\text{,}

where :math:A is an :math:n\times n real symmetric matrix, :math:x is an :math:n-element real vector, and :math:\alpha is a real scalar.
"""
raise NotImplementedError

[docs]def dspr(uplo, alpha, x, ap):
r"""
dspr computes the rank-1 update of a real symmetric matrix stored in packed form.

.. _f06pq-py2-py-doc:

For full information please refer to the NAG Library document for f06pq

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06pqf.html

.. _f06pq-py2-py-parameters:

**Parameters**
**uplo** : str, length 1
Specifies whether the upper or lower triangular part of :math:A is stored.

:math:\mathrm{uplo} = \texttt{'U'}

The upper triangular part of :math:A is stored.

:math:\mathrm{uplo} = \texttt{'L'}

The lower triangular part of :math:A is stored.

**alpha** : float
The scalar :math:\alpha.

**x** : float, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:x.

**ap** : float, array-like, shape :math:\left(n\times \left(n+1\right)/2\right)
The :math:n\times n symmetric matrix :math:A, packed by columns.

**Returns**
**ap** : float, ndarray, shape :math:\left(n\times \left(n+1\right)/2\right)
The updated matrix :math:A.

.. _f06pq-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{uplo}.

Constraint: :math:\mathrm{uplo} = \texttt{'U'} or :math:\texttt{'L'}.

(errno :math:2)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

(errno :math:5)
On entry, error in parameter :math:\textit{incx}.

Constraint: :math:\textit{incx}\neq 0.

.. _f06pq-py2-py-notes:

**Notes**
In the NAG Library the traditional C interface for this routine uses a different algorithmic base. Please contact NAG if you have any questions about compatibility.

dspr performs the symmetric rank-1 update operation

.. math::
A←\alpha xx^\mathrm{T}+A\text{,}

where :math:A is an :math:n\times n real symmetric matrix, stored in packed form, :math:x is an :math:n-element real vector, and :math:\alpha is a real scalar.
"""
raise NotImplementedError

[docs]def dsyr2(uplo, alpha, x, y, a):
r"""
dsyr2 computes the rank-2 update of a real symmetric matrix.

.. _f06pr-py2-py-doc:

For full information please refer to the NAG Library document for f06pr

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06prf.html

.. _f06pr-py2-py-parameters:

**Parameters**
**uplo** : str, length 1
Specifies whether the upper or lower triangular part of :math:A is stored.

:math:\mathrm{uplo} = \texttt{'U'}

The upper triangular part of :math:A is stored.

:math:\mathrm{uplo} = \texttt{'L'}

The lower triangular part of :math:A is stored.

**alpha** : float
The scalar :math:\alpha.

**x** : float, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:x.

**y** : float, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:y.

**a** : float, array-like, shape :math:\left(n, n\right)
The :math:n\times n symmetric matrix :math:A.

**Returns**
**a** : float, ndarray, shape :math:\left(n, n\right)
The updated matrix :math:A.

.. _f06pr-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{uplo}.

Constraint: :math:\mathrm{uplo} = \texttt{'U'} or :math:\texttt{'L'}.

(errno :math:2)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

(errno :math:5)
On entry, error in parameter :math:\textit{incx}.

Constraint: :math:\textit{incx}\neq 0.

(errno :math:7)
On entry, error in parameter :math:\textit{incy}.

Constraint: :math:\textit{incy}\neq 0.

.. _f06pr-py2-py-notes:

**Notes**
In the NAG Library the traditional C interface for this routine uses a different algorithmic base. Please contact NAG if you have any questions about compatibility.

dsyr2 performs the symmetric rank-2 update operation

.. math::
A←\alpha xy^\mathrm{T}+\alpha yx^\mathrm{T}+A\text{,}

where :math:A is an :math:n\times n real symmetric matrix, :math:x and :math:y are :math:n-element real vectors, and :math:\alpha is a real scalar.
"""
raise NotImplementedError

[docs]def dspr2(uplo, alpha, x, y, ap):
r"""
dspr2 computes the rank-2 update of a real symmetric matrix stored in packed form.

.. _f06ps-py2-py-doc:

For full information please refer to the NAG Library document for f06ps

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06psf.html

.. _f06ps-py2-py-parameters:

**Parameters**
**uplo** : str, length 1
Specifies whether the upper or lower triangular part of :math:A is stored.

:math:\mathrm{uplo} = \texttt{'U'}

The upper triangular part of :math:A is stored.

:math:\mathrm{uplo} = \texttt{'L'}

The lower triangular part of :math:A is stored.

**alpha** : float
The scalar :math:\alpha.

**x** : float, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:x.

**y** : float, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:y.

**ap** : float, array-like, shape :math:\left(n\times \left(n+1\right)/2\right)
The :math:n\times n symmetric matrix :math:A, packed by columns.

**Returns**
**ap** : float, ndarray, shape :math:\left(n\times \left(n+1\right)/2\right)
The updated matrix :math:A.

.. _f06ps-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{uplo}.

Constraint: :math:\mathrm{uplo} = \texttt{'U'} or :math:\texttt{'L'}.

(errno :math:2)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

(errno :math:5)
On entry, error in parameter :math:\textit{incx}.

Constraint: :math:\textit{incx}\neq 0.

(errno :math:7)
On entry, error in parameter :math:\textit{incy}.

Constraint: :math:\textit{incy}\neq 0.

.. _f06ps-py2-py-notes:

**Notes**
In the NAG Library the traditional C interface for this routine uses a different algorithmic base. Please contact NAG if you have any questions about compatibility.

dspr2 performs the symmetric rank-2 update operation

.. math::
A←\alpha xy^\mathrm{T}+\alpha yx^\mathrm{T}+A\text{,}

where :math:A is an :math:n\times n real symmetric matrix, stored in packed form, :math:x and :math:y are :math:n-element real vectors, and :math:\alpha is a real scalar.
"""
raise NotImplementedError

[docs]def dmcopy(matrix, m, a):
r"""
dmcopy performs the matrix-copy operation

.. math::
B←A

where :math:A and :math:B are :math:m\times n real general or trapezoidal matrices.

.. _f06qf-py2-py-doc:

For full information please refer to the NAG Library document for f06qf

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06qff.html

.. _f06qf-py2-py-parameters:

**Parameters**
**matrix** : str, length 1
The matrix type.

:math:\mathrm{matrix} = \texttt{'G'}

General matrix.

:math:\mathrm{matrix} = \texttt{'U'}

Upper trapezoidal matrix (upper triangular if :math:m = n).

:math:\mathrm{matrix} = \texttt{'L'}

Lower trapezoidal matrix (lower triangular if :math:m = n).

**m** : int
:math:m, the number of rows of the matrices :math:A and :math:B.

**a** : float, array-like, shape :math:\left(\mathrm{m}, n\right)
The :math:m\times n general or trapezoidal matrix :math:A.

**Returns**
**b** : float, ndarray, shape :math:\left(\mathrm{m}, n\right)
The :math:m\times n general or trapezoidal matrix :math:B.

.. _f06qf-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{matrix}.

Constraint: :math:\mathrm{matrix} = \texttt{'G'}, :math:\texttt{'U'} or :math:\texttt{'L'}.

(errno :math:2)
On entry, error in parameter :math:\mathrm{m}.

Constraint: :math:\mathrm{m}\geq 0.

(errno :math:3)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

.. _f06qf-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.
"""
raise NotImplementedError

[docs]def dmload(matrix, m, n, con, diag):
r"""
dmload forms the real :math:m\times n rectangular or trapezoidal matrix :math:A given by

.. math::
a_{{ij}} = \left\{\begin{array}{ll}\mathrm{diag}&\text{if }i = j\\\mathrm{const}&\text{if }i\neq j\end{array}\right. \text{.}

.. _f06qh-py2-py-doc:

For full information please refer to the NAG Library document for f06qh

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06qhf.html

.. _f06qh-py2-py-parameters:

**Parameters**
**matrix** : str, length 1
The matrix type.

:math:\mathrm{matrix} = \texttt{'G'}

General matrix.

:math:\mathrm{matrix} = \texttt{'U'}

Upper trapezoidal matrix (upper triangular if :math:m = n).

:math:\mathrm{matrix} = \texttt{'L'}

Lower trapezoidal matrix (lower triangular if :math:m = n).

**m** : int
:math:m, the number of rows of the matrix :math:A.

**n** : int
:math:n, the number of columns of the matrix :math:A.

**con** : float
The value to be assigned to the off-diagonal elements of :math:A.

**diag** : float
The value to be assigned to the diagonal elements of :math:A.

**Returns**
**a** : float, ndarray, shape :math:\left(\mathrm{m}, \mathrm{n}\right)
The :math:m\times n general or trapezoidal matrix :math:A.

.. _f06qh-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{matrix}.

Constraint: :math:\mathrm{matrix} = \texttt{'G'}, :math:\texttt{'U'} or :math:\texttt{'L'}.

(errno :math:2)
On entry, error in parameter :math:\mathrm{m}.

Constraint: :math:\mathrm{m}\geq 0.

(errno :math:3)
On entry, error in parameter :math:\mathrm{n}.

Constraint: :math:\mathrm{n}\geq 0.

.. _f06qh-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.
"""
raise NotImplementedError

[docs]def dgeap(side, trans, perm, k, b):
r"""
dgeap permutes the rows or columns of a real rectangular matrix using an int array of permutations.

.. _f06qj-py2-py-doc:

For full information please refer to the NAG Library document for f06qj

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06qjf.html

.. _f06qj-py2-py-parameters:

**Parameters**
**side** : str, length 1
Specifies the operation to be performed.

:math:\mathrm{side} = \texttt{'L'} and :math:\mathrm{trans} = \texttt{'T'}

:math:B←P^\mathrm{T}B.

:math:\mathrm{side} = \texttt{'L'} and :math:\mathrm{trans} = \texttt{'N'}

:math:B←PB.

:math:\mathrm{side} = \texttt{'R'} and :math:\mathrm{trans} = \texttt{'T'}

:math:B←BP^\mathrm{T}.

:math:\mathrm{side} = \texttt{'R'} and :math:\mathrm{trans} = \texttt{'N'}

:math:B←BP.

**trans** : str, length 1
Specifies the operation to be performed.

:math:\mathrm{side} = \texttt{'L'} and :math:\mathrm{trans} = \texttt{'T'}

:math:B←P^\mathrm{T}B.

:math:\mathrm{side} = \texttt{'L'} and :math:\mathrm{trans} = \texttt{'N'}

:math:B←PB.

:math:\mathrm{side} = \texttt{'R'} and :math:\mathrm{trans} = \texttt{'T'}

:math:B←BP^\mathrm{T}.

:math:\mathrm{side} = \texttt{'R'} and :math:\mathrm{trans} = \texttt{'N'}

:math:B←BP.

**perm** : int, array-like, shape :math:\left(n\right)
The :math:n indices :math:p_i which define the interchanges in the representation of :math:P. It is usual to have :math:p_i\geq i, but this is not necessary.

**k** : int
:math:k, the number of columns of :math:B if :math:\mathrm{side} = \texttt{'L'}, or the number of rows of :math:B if :math:\mathrm{side} = \texttt{'R'}.

**b** : float, array-like, shape :math:\left(:, :\right)
Note: the required extent for this argument in dimension 1 is determined as follows: if :math:\mathrm{side}=\texttt{'L'}: :math:\max\left(n,\textit{m}\right); if :math:\mathrm{side}=\texttt{'R'}: :math:\mathrm{k}; otherwise: :math:0.

Note: the required extent for this argument in dimension 2 is determined as follows: if :math:\mathrm{side}=\texttt{'L'}: :math:\mathrm{k}; if :math:\mathrm{side}=\texttt{'R'}: :math:\max\left(n,\max\left(\mathrm{perm}\right)\right); otherwise: :math:0.

The original matrix :math:B; :math:B is :math:\textit{m}\times k if :math:\mathrm{side} = \texttt{'L'}, or :math:k\times \textit{m} if :math:\mathrm{side} = \texttt{'R'}.

**Returns**
**b** : float, ndarray, shape :math:\left(:, :\right)
The permuted matrix :math:B.

.. _f06qj-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:2)
On entry, error in parameter :math:\mathrm{trans}.

Constraint: :math:\mathrm{side} = \texttt{'L'} or :math:\texttt{'R'}.

(errno :math:2)
On entry, error in parameter :math:\mathrm{trans}.

Constraint: :math:\mathrm{trans} = \texttt{'N'} or :math:\texttt{'T'}.

(errno :math:3)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

(errno :math:4)
On entry, error in parameter :math:\mathrm{perm}.

Constraint: :math:1\leq \mathrm{perm}[i-1]\leq \textit{m}.

(errno :math:5)
On entry, error in parameter :math:\mathrm{k}.

Constraint: :math:\mathrm{k}\geq 0.

.. _f06qj-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

dgeap performs one of the permutation operations

.. math::

where :math:B is a real matrix, and :math:P is a permutation matrix.

:math:P is represented in the form

.. math::
P = P_{{1,p_1}}P_{{2,p_2}} \cdots P_{{n,p_n}}\text{,}

where :math:P_{{i,j}} is the permutation matrix that interchanges items :math:i and :math:j; that is, :math:P_{{i,j}} is the unit matrix with rows and columns :math:i and :math:j interchanged.
If :math:i = j, :math:P_{{i,j}} = I.

Let :math:\textit{m} denote the number of rows of :math:B if :math:\mathrm{side} = \texttt{'L'}, or the number of columns of :math:B if :math:\mathrm{side} = \texttt{'R'}: the function does not require :math:\textit{m} to be passed as an argument, but assumes that :math:m\geq p_{\textit{i}}, for :math:\textit{i} = 1,2,\ldots,n.

This function requires the indices :math:p_i to be supplied in an int array; :meth:dgeapr performs the same operation with the indices supplied in a float array.
"""
raise NotImplementedError

[docs]def dgeapr(side, trans, perm, k, b):
r"""
dgeapr permutes the rows or columns of a real rectangular matrix using a float array of permutations.

.. _f06qk-py2-py-doc:

For full information please refer to the NAG Library document for f06qk

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06qkf.html

.. _f06qk-py2-py-parameters:

**Parameters**
**side** : str, length 1
Specifies the operation to be performed.

:math:\mathrm{side} = \texttt{'L'} and :math:\mathrm{trans} = \texttt{'T'}

:math:B←P^\mathrm{T}B.

:math:\mathrm{side} = \texttt{'L'} and :math:\mathrm{trans} = \texttt{'N'}

:math:B←PB.

:math:\mathrm{side} = \texttt{'R'} and :math:\mathrm{trans} = \texttt{'T'}

:math:B←BP^\mathrm{T}.

:math:\mathrm{side} = \texttt{'R'} and :math:\mathrm{trans} = \texttt{'N'}

:math:B←BP.

**trans** : str, length 1
Specifies the operation to be performed.

:math:\mathrm{side} = \texttt{'L'} and :math:\mathrm{trans} = \texttt{'T'}

:math:B←P^\mathrm{T}B.

:math:\mathrm{side} = \texttt{'L'} and :math:\mathrm{trans} = \texttt{'N'}

:math:B←PB.

:math:\mathrm{side} = \texttt{'R'} and :math:\mathrm{trans} = \texttt{'T'}

:math:B←BP^\mathrm{T}.

:math:\mathrm{side} = \texttt{'R'} and :math:\mathrm{trans} = \texttt{'N'}

:math:B←BP.

**perm** : float, array-like, shape :math:\left(n\right)
The :math:n indices :math:p_i which define the interchanges in the representation of :math:P. It is usual to have :math:p_i\geq i, but this is not necessary.

**k** : int
:math:k, the number of columns of :math:B if :math:\mathrm{side} = \texttt{'L'}, or the number of rows of :math:B if :math:\mathrm{side} = \texttt{'R'}.

**b** : float, array-like, shape :math:\left(:, :\right)
Note: the required extent for this argument in dimension 1 is determined as follows: if :math:\mathrm{side}=\texttt{'L'}: :math:\max\left(n,\textit{m}\right); if :math:\mathrm{side}=\texttt{'R'}: :math:\mathrm{k}; otherwise: :math:0.

Note: the required extent for this argument in dimension 2 is determined as follows: if :math:\mathrm{side}=\texttt{'L'}: :math:\mathrm{k}; if :math:\mathrm{side}=\texttt{'R'}: :math:\max\left(n,\mathrm{int}\left(\max\left(\mathrm{perm}\right)\right)\right); otherwise: :math:0.

The original matrix :math:B; :math:B is :math:\textit{m}\times k if :math:\mathrm{side} = \texttt{'L'}, or :math:k\times \textit{m} if :math:\mathrm{side} = \texttt{'R'}.

**Returns**
**b** : float, ndarray, shape :math:\left(:, :\right)
The permuted matrix :math:B.

.. _f06qk-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:2)
On entry, error in parameter :math:\mathrm{trans}.

Constraint: :math:\mathrm{side} = \texttt{'L'} or :math:\texttt{'R'}.

(errno :math:2)
On entry, error in parameter :math:\mathrm{trans}.

Constraint: :math:\mathrm{trans} = \texttt{'N'} or :math:\texttt{'T'}.

(errno :math:3)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

(errno :math:4)
On entry, error in parameter :math:\mathrm{perm}.

Constraint: :math:1\leq \mathrm{perm}[i-1]\leq \textit{m}.

(errno :math:5)
On entry, error in parameter :math:\mathrm{k}.

Constraint: :math:\mathrm{k}\geq 0.

.. _f06qk-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

dgeapr performs one of the permutation operations

.. math::

where :math:B is a real matrix, and :math:P is a permutation matrix.

:math:P is represented in the form

.. math::
P = P_{{1,p_1}}P_{{2,p_2}} \cdots P_{{n,p_n}}\text{,}

where :math:P_{{i,j}} is the permutation matrix that interchanges items :math:i and :math:j; that is, :math:P_{{i,j}} is the unit matrix with rows and columns :math:i and :math:j interchanged.
If :math:i = j, :math:P_{{i,j}} = I.

Let :math:\textit{m} denote the number of rows of :math:B if :math:\mathrm{side} = \texttt{'L'}, or the number of columns of :math:B if :math:\mathrm{side} = \texttt{'R'}: the function does not require :math:\textit{m} to be passed as an argument, but assumes that :math:m\geq p_{\textit{i}}, for :math:\textit{i} = 1,2,\ldots,n.

This function requires the indices :math:p_i to be supplied in a float array (the function takes the integer part of the array elements); :meth:dgeap performs the same operation with the indices supplied in an int array.
"""
raise NotImplementedError

[docs]def dsysrc(uplo, pivot, direct, k1, k2, c, s, a):
r"""
dsysrc performs an orthogonal similarity transformation (as a sequence of plane rotations) of a real symmetric matrix.

.. _f06qm-py2-py-doc:

For full information please refer to the NAG Library document for f06qm

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06qmf.html

.. _f06qm-py2-py-parameters:

**Parameters**
**uplo** : str, length 1
Specifies whether the upper or lower triangular part of :math:A is stored.

:math:\mathrm{uplo} = \texttt{'U'}

The upper triangular part of :math:A is stored.

:math:\mathrm{uplo} = \texttt{'L'}

The lower triangular part of :math:A is stored.

**pivot** : str, length 1
Specifies the plane rotated by :math:P_k.

:math:\mathrm{pivot} = \texttt{'V'} (variable pivot)

:math:P_k rotates the :math:\left(k, {k+1}\right) plane.

:math:\mathrm{pivot} = \texttt{'T'} (top pivot)

:math:P_k rotates the :math:\left(k_1, {k+1}\right) plane.

:math:\mathrm{pivot} = \texttt{'B'} (bottom pivot)

:math:P_k rotates the :math:\left(k, k_2\right) plane.

**direct** : str, length 1
Specifies the sequence direction.

:math:\mathrm{direct} = \texttt{'F'} (forward sequence)

:math:P = P_{{k_2-1}} \cdots P_{{k_1+1}}P_{k_1}.

:math:\mathrm{direct} = \texttt{'B'} (backward sequence)

:math:P = P_{k_1}P_{{k_1+1}} \cdots P_{{k_2-1}}.

**k1** : int
The value :math:k_1.

**k2** : int
The value :math:k_2.

**c** : float, array-like, shape :math:\left(\mathrm{k2}-1\right)
:math:\mathrm{c}[\textit{k}] must hold :math:c_{\textit{k}}, the cosine of the rotation :math:P_{\textit{k}}, for :math:\textit{k} = \textit{k}_1,\ldots,\textit{k}_2-1.

**s** : float, array-like, shape :math:\left(\mathrm{k2}-1\right)
:math:\mathrm{s}[\textit{k}] must hold :math:s_{\textit{k}}, the sine of the rotation :math:P_{\textit{k}}, for :math:\textit{k} = \textit{k}_1,\ldots,\textit{k}_2-1.

**a** : float, array-like, shape :math:\left(n, n\right)
The :math:n\times n symmetric matrix :math:A.

**Returns**
**a** : float, ndarray, shape :math:\left(n, n\right)
The transformed matrix :math:A.

.. _f06qm-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{uplo}.

Constraint: :math:\mathrm{uplo} = \texttt{'U'} or :math:\texttt{'L'}.

(errno :math:2)
On entry, error in parameter :math:\mathrm{pivot}.

Constraint: :math:\mathrm{pivot} = \texttt{'V'}, :math:\texttt{'T'} or :math:\texttt{'B'}.

(errno :math:3)
On entry, error in parameter :math:\mathrm{direct}.

Constraint: :math:\mathrm{direct} = \texttt{'F'} or :math:\texttt{'B'}.

(errno :math:4)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

.. _f06qm-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

dsysrc performs the transformation

.. math::
A←PAP^\mathrm{T}

where :math:A is an :math:n\times n real symmetric matrix, and :math:P is a real orthogonal matrix defined as a sequence of plane rotations, :math:P_k, applied in planes :math:k_1 to :math:k_2.

The :math:2\times 2 plane rotation part of :math:P_k is assumed to have the form

.. math::
\begin{pmatrix}c_k&s_k\\-s_k&c_k\end{pmatrix}\text{.}
"""
raise NotImplementedError

[docs]def dutr1(alpha, x, y, a):
r"""
dutr1 performs a :math:QR factorization (as a sequence of plane rotations) of a real upper triangular matrix that has been modified by a rank-1 update.

.. _f06qp-py2-py-doc:

For full information please refer to the NAG Library document for f06qp

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06qpf.html

.. _f06qp-py2-py-parameters:

**Parameters**
**alpha** : float
The scalar :math:\alpha.

**x** : float, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:x.

**y** : float, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:y.

**a** : float, array-like, shape :math:\left(n, n\right)
The :math:n\times n upper triangular matrix :math:U.

**Returns**
**x** : float, ndarray, shape :math:\left(n\right)
The referenced elements are overwritten by details of the sequence of plane rotations.

**a** : float, ndarray, shape :math:\left(n, n\right)
The upper triangular matrix :math:R.

**c** : float, ndarray, shape :math:\left(n-1\right)
The cosines of the rotations :math:Q_{\textit{k}}, for :math:\textit{k} = 1,2,\ldots,n-1.

**s** : float, ndarray, shape :math:\left(n-1\right)
The sines of the rotations :math:Q_{\textit{k}}, for :math:\textit{k} = 1,2,\ldots,n-1.

.. _f06qp-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

(errno :math:4)
On entry, error in parameter :math:\textit{incx}.

Constraint: :math:\textit{incx} > 0.

(errno :math:6)
On entry, error in parameter :math:\textit{incy}.

Constraint: :math:\textit{incy} > 0.

.. _f06qp-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

dutr1 performs a :math:QR factorization of an upper triangular matrix which has been modified by a rank-1 update:

.. math::
\alpha xy^\mathrm{T}+U = QR

where :math:U and :math:R are :math:n\times n real upper triangular matrices, :math:x and :math:y are :math:n-element real vectors, :math:\alpha is a real scalar, and :math:Q is an :math:n\times n real orthogonal matrix.

:math:Q is formed as the product of two sequences of plane rotations:

.. math::
Q^\mathrm{T} = Q_{{n-1}} \cdots Q_2Q_1P_1P_2 \cdots P_{{n-1}}

where

:math:P_k is a rotation in the :math:\left(k, n\right) plane, chosen to annihilate :math:x_k: thus :math:Px = \beta e_n, where :math:P = P_1P_2 \cdots P_{{n-1}} and :math:e_n is the last column of the unit matrix;

:math:Q_k is a rotation in the :math:\left(k, n\right) plane, chosen to annihilate the :math:\left(n, k\right) element of :math:\left(\alpha \beta e_ny^\mathrm{T}+PU\right), and thus restore it to upper triangular form.

The :math:2\times 2 plane rotation part of :math:P_k or :math:Q_k has the form

.. math::
\begin{pmatrix}c_k&s_k\\-s_k&c_k\end{pmatrix}\text{.}

The tangents of the rotations :math:P_k are returned in the array :math:\mathrm{x}; the cosines and sines of these rotations can be recovered by calling :meth:dcsg.
The cosines and sines of the rotations :math:Q_k are returned directly in the arrays :math:\mathrm{c} and :math:\mathrm{s}.
"""
raise NotImplementedError

[docs]def dutupd(alpha, x, a):
r"""
dutupd performs a :math:QR factorization (as a sequence of plane rotations) of a real upper triangular matrix that has been augmented by a full row.

.. _f06qq-py2-py-doc:

For full information please refer to the NAG Library document for f06qq

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06qqf.html

.. _f06qq-py2-py-parameters:

**Parameters**
**alpha** : float
The scalar :math:\alpha.

**x** : float, array-like, shape :math:\left(n\right)
The vector :math:x.

**a** : float, array-like, shape :math:\left(n, n\right)
The :math:n\times n upper triangular matrix :math:U.

**Returns**
**x** : float, ndarray, shape :math:\left(n\right)
The referenced elements are overwritten by the tangents of the rotations :math:Q_{\textit{k}}, for :math:\textit{k} = 1,2,\ldots,n.

**a** : float, ndarray, shape :math:\left(n, n\right)
The upper triangular matrix :math:R.

**c** : float, ndarray, shape :math:\left(n\right)
The values :math:c_{\textit{k}}, the cosines of the rotations :math:Q_{\textit{k}}, for :math:\textit{k} = 1,2,\ldots,n.

**s** : float, ndarray, shape :math:\left(n\right)
The values :math:s_{\textit{k}}, the sines of the rotations :math:Q_{\textit{k}}, for :math:\textit{k} = 1,2,\ldots,n.

.. _f06qq-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

(errno :math:4)
On entry, error in parameter :math:\textit{incx}.

Constraint: :math:\textit{incx} > 0.

.. _f06qq-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

dutupd performs the factorization

.. math::
\begin{pmatrix}U\\\alpha x^\mathrm{T}\end{pmatrix} = Q\begin{pmatrix}R\\0\end{pmatrix}

where :math:U and :math:R are :math:n\times n real upper triangular matrices, :math:x is an :math:n-element real vector, :math:\alpha is a real scalar, and :math:Q is a real orthogonal matrix.

:math:Q is formed as a sequence of plane rotations

.. math::
Q^\mathrm{T} = Q_n \cdots Q_2Q_1

where :math:Q_k is a rotation in the :math:\left(k, {n+1}\right) plane, chosen to annihilate :math:x_k.

The :math:2\times 2 plane rotation part of :math:Q_k has the form

.. math::
\begin{pmatrix}c_k&s_k\\-s_k&c_k\end{pmatrix}\text{.}
"""
raise NotImplementedError

[docs]def duhqr(side, k1, k2, s, a):
r"""
duhqr performs a :math:QR or :math:RQ factorization (as a sequence of plane rotations) of a real upper Hessenberg matrix.

.. _f06qr-py2-py-doc:

For full information please refer to the NAG Library document for f06qr

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06qrf.html

.. _f06qr-py2-py-parameters:

**Parameters**
**side** : str, length 1
Specifies whether :math:H is operated on from the left or the right.

:math:\mathrm{side} = \texttt{'L'}

:math:H is pre-multiplied from the left.

:math:\mathrm{side} = \texttt{'R'}

:math:H is post-multiplied from the right.

**k1** : int
The value :math:k_1.

**k2** : int
The value :math:k_2.

**s** : float, array-like, shape :math:\left(\mathrm{k2}-1\right)
The nonzero subdiagonal elements of :math:H: :math:\mathrm{s}[\textit{k}] must hold :math:h_{{\textit{k}+1,\textit{k}}}, for :math:\textit{k} = \textit{k}_1,\ldots,\textit{k}_2-1.

**a** : float, array-like, shape :math:\left(n, n\right)
The upper triangular part of the :math:n\times n upper Hessenberg matrix :math:H.

**Returns**
**c** : float, ndarray, shape :math:\left(\mathrm{k2}-1\right)
:math:\mathrm{c}[\textit{k}] holds :math:c_{\textit{k}}, the cosine of the rotation :math:P_{\textit{k}}, for :math:\textit{k} = \textit{k}_1,\ldots,\textit{k}_2-1.

**s** : float, ndarray, shape :math:\left(\mathrm{k2}-1\right)
:math:\mathrm{s}[\textit{k}] holds :math:s_{\textit{k}}, the sine of the rotation :math:P_{\textit{k}}, for :math:\textit{k} = \textit{k}_1,\ldots,\textit{k}_2-1.

**a** : float, ndarray, shape :math:\left(n, n\right)
The upper triangular matrix :math:R.

.. _f06qr-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{side}.

Constraint: :math:\mathrm{side} = \texttt{'L'} or :math:\texttt{'R'}.

(errno :math:2)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

.. _f06qr-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

duhqr transforms an :math:n\times n real upper Hessenberg matrix :math:H to upper triangular form :math:R by applying an orthogonal matrix :math:P from the left or the right. :math:H is assumed to have nonzero subdiagonal elements :math:h_{{\textit{k}+1,\textit{k}}}, for :math:\textit{k} = \textit{k}_1,\ldots,\textit{k}_2-1, only. :math:P is formed as a sequence of plane rotations in planes :math:k_1 to :math:k_2.

If :math:\mathrm{side} = \texttt{'L'}, the rotations are applied from the left:

.. math::
PH = R\text{,}

where :math:P = P_{{k_2-1}} \cdots P_{{k_1+1}}P_{k_1}.

If :math:\mathrm{side} = \texttt{'R'}, the rotations are applied from the right:

.. math::
HP^\mathrm{T} = R\text{,}

where :math:P = P_{k_1}P_{{k_1+1}} \cdots P_{{k_2-1}}.

In either case, :math:P_k is a rotation in the :math:\left(k, {k+1}\right) plane, chosen to annihilate :math:h_{{k+1,k}}.

The :math:2\times 2 plane rotation part of :math:P_k has the form

.. math::
\begin{pmatrix}c_k&s_k\\-s_k&c_k\end{pmatrix}\text{.}
"""
raise NotImplementedError

[docs]def dusqr(side, k1, k2, s, a):
r"""
dusqr performs a :math:QR or :math:RQ factorization (as a sequence of plane rotations) of a real upper spiked matrix.

.. _f06qs-py2-py-doc:

For full information please refer to the NAG Library document for f06qs

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06qsf.html

.. _f06qs-py2-py-parameters:

**Parameters**
**side** : str, length 1
Specifies whether :math:H is operated on from the left or the right.

:math:\mathrm{side} = \texttt{'L'}

:math:H is pre-multiplied from the left.

:math:\mathrm{side} = \texttt{'R'}

:math:H is post-multiplied from the right.

**k1** : int
The value :math:k_1.

**k2** : int
The value :math:k_2.

**s** : float, array-like, shape :math:\left(\mathrm{k2}-1\right)
The nonzero elements of the spike of :math:H: :math:\mathrm{s}[\textit{k}] must hold :math:h_{{\textit{k}_2,\textit{k}}} if :math:\mathrm{side} = \texttt{'L'}, and :math:h_{{\textit{k}+1,\textit{k}_1}} if :math:\mathrm{side} = \texttt{'R'}, for :math:\textit{k} = \textit{k}_1,\ldots,\textit{k}_2-1.

**a** : float, array-like, shape :math:\left(n, n\right)
The upper triangular part of the :math:n\times n upper spiked matrix :math:H.

**Returns**
**c** : float, ndarray, shape :math:\left(\mathrm{k2}-1\right)
:math:\mathrm{c}[\textit{k}] holds :math:c_{\textit{k}}, the cosine of the rotation :math:P_{\textit{k}}, for :math:\textit{k} = \textit{k}_1,\ldots,\textit{k}_2-1.

**s** : float, ndarray, shape :math:\left(\mathrm{k2}-1\right)
:math:\mathrm{s}[\textit{k}] holds :math:s_{\textit{k}}, the sine of the rotation :math:P_{\textit{k}}, for :math:\textit{k} = \textit{k}_1,\ldots,\textit{k}_2-1.

**a** : float, ndarray, shape :math:\left(n, n\right)
The upper triangular matrix :math:R.

.. _f06qs-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{side}.

Constraint: :math:\mathrm{side} = \texttt{'L'} or :math:\texttt{'R'}.

(errno :math:2)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

.. _f06qs-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

dusqr transforms an :math:n\times n real upper spiked matrix :math:H to upper triangular form :math:R by applying a real orthogonal matrix :math:P from the left or the right. :math:P is formed as a sequence of plane rotations in planes :math:k_1 to :math:k_2.

If :math:\mathrm{side} = \texttt{'L'}, :math:H is assumed to have a row spike, with nonzero elements :math:h_{{\textit{k}_2,\textit{k}}}, for :math:\textit{k} = \textit{k}_1,\ldots,\textit{k}_2-1.
The rotations are applied from the left:

.. math::
PH = R\text{,}

where :math:P = P_{{k_2-1}} \cdots P_{{k_1+1}}P_{k_1} and :math:P_k is a rotation in the :math:\left(k, k_2\right) plane.

If :math:\mathrm{side} = \texttt{'R'}, :math:H is assumed to have a column spike, with nonzero elements :math:h_{{\textit{k}+1,\textit{k}_1}}, for :math:\textit{k} = \textit{k}_1,\ldots,\textit{k}_2-1.
The rotations are applied from the right:

.. math::
HP^\mathrm{T} = R\text{,}

where :math:P = P_{k_1}P_{{k_1+1}} \cdots P_{{k_2-1}} and :math:P_k is a rotation in the :math:\left(k_1, {k+1}\right) plane.

The :math:2\times 2 plane rotation part of :math:P_k has the form

.. math::
\begin{pmatrix}c_k&s_k\\-s_k&c_k\end{pmatrix}\text{.}
"""
raise NotImplementedError

[docs]def dutsqr(side, k1, k2, c, s, a):
r"""
dutsqr performs a :math:QR or :math:RQ factorization of the product of a real upper triangular matrix and a real matrix of plane rotations.

.. _f06qt-py2-py-doc:

For full information please refer to the NAG Library document for f06qt

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06qtf.html

.. _f06qt-py2-py-parameters:

**Parameters**
**side** : str, length 1
Specifies whether :math:P is applied from the left or the right in the transformation.

:math:\mathrm{side} = \texttt{'L'}

:math:P is applied from the left.

:math:\mathrm{side} = \texttt{'R'}

:math:P is applied from the right.

**k1** : int
The value :math:k_1.

**k2** : int
The value :math:k_2.

**c** : float, array-like, shape :math:\left(\mathrm{k2}-1\right)
:math:\mathrm{c}[\textit{k}] must hold the cosine of the rotation :math:P_{\textit{k}}, for :math:\textit{k} = \textit{k}_1,\ldots,\textit{k}_2-1.

**s** : float, array-like, shape :math:\left(\mathrm{k2}-1\right)
:math:\mathrm{s}[\textit{k}] must hold the sine of the rotation :math:P_{\textit{k}}, for :math:\textit{k} = \textit{k}_1,\ldots,\textit{k}_2-1.

**a** : float, array-like, shape :math:\left(n, n\right)
The :math:n\times n upper triangular matrix :math:U.

**Returns**
**c** : float, ndarray, shape :math:\left(\mathrm{k2}-1\right)
:math:\mathrm{c}[\textit{k}] holds the cosine of the rotation :math:Q_{\textit{k}}, for :math:\textit{k} = \textit{k}_1,\ldots,\textit{k}_2-1.

**s** : float, ndarray, shape :math:\left(\mathrm{k2}-1\right)
:math:\mathrm{s}[\textit{k}] holds the sine of the rotation :math:Q_{\textit{k}}, for :math:\textit{k} = \textit{k}_1,\ldots,\textit{k}_2-1.

**a** : float, ndarray, shape :math:\left(n, n\right)
The upper triangular matrix :math:R.

.. _f06qt-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{side}.

Constraint: :math:\mathrm{side} = \texttt{'L'} or :math:\texttt{'R'}.

(errno :math:2)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

.. _f06qt-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

dutsqr performs one of the transformations

.. math::

where :math:U is a given :math:n\times n real upper triangular matrix, :math:P is a given real orthogonal matrix, and :math:Q is a real orthogonal matrix chosen to make :math:R upper triangular.
Both :math:P and :math:Q are represented as sequences of plane rotations in planes :math:k_1 to :math:k_2.

If :math:\mathrm{side} = \texttt{'L'},

.. math::
R←PUQ^\mathrm{T}\text{,}

where :math:P = P_{{k_2-1}}\ldots P_{{k_1+1}}P_{k_1} and :math:Q = Q_{{k_2-1}}\ldots Q_{{k_1+1}}Q_{k_1}.

If :math:\mathrm{side} = \texttt{'R'},

.. math::
R←QUP^\mathrm{T}\text{,}

where :math:P = P_{k_1}P_{{k_1+1}}\ldots P_{{k_2-1}} and :math:Q = Q_{k_1}Q_{{k_1+1}}\ldots Q_{{k_2-1}}.

In either case :math:P_k and :math:Q_k are rotations in the :math:\left(k, {k+1}\right) plane.

The :math:2\times 2 rotation part of :math:P_k or :math:Q_k has the form

.. math::
\begin{pmatrix}c_k&s_k\\-s_k&c_k\end{pmatrix}\text{.}
"""
raise NotImplementedError

[docs]def dutsrh(side, k1, k2, c, s, a):
r"""
dutsrh transforms a real upper triangular matrix to an upper Hessenberg matrix by applying a given sequence of plane rotations.

.. _f06qv-py2-py-doc:

For full information please refer to the NAG Library document for f06qv

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06qvf.html

.. _f06qv-py2-py-parameters:

**Parameters**
**side** : str, length 1
Specifies whether :math:U is operated on from the left or the right.

:math:\mathrm{side} = \texttt{'L'}

:math:U is pre-multiplied from the left.

:math:\mathrm{side} = \texttt{'R'}

:math:U is post-multiplied from the right.

**k1** : int
The value :math:k_1.

**k2** : int
The value :math:k_2.

**c** : float, array-like, shape :math:\left(\mathrm{k2}-1\right)
:math:\mathrm{c}[\textit{k}] must hold :math:c_{\textit{k}}, the cosine of the rotation :math:P_{\textit{k}}, for :math:\textit{k} = \textit{k}_1,\ldots,\textit{k}_2-1.

**s** : float, array-like, shape :math:\left(\mathrm{k2}-1\right)
:math:\mathrm{s}[\textit{k}] must hold :math:s_{\textit{k}}, the sine of the rotation :math:P_{\textit{k}}, for :math:\textit{k} = \textit{k}_1,\ldots,\textit{k}_2-1.

**a** : float, array-like, shape :math:\left(n, n\right)
The :math:n\times n upper triangular matrix :math:U.

**Returns**
**s** : float, ndarray, shape :math:\left(\mathrm{k2}-1\right)
:math:\mathrm{s}[\textit{k}] holds :math:h_{{\textit{k}+1,\textit{k}}}, the subdiagonal element of :math:H, for :math:\textit{k} = \textit{k}_1,\ldots,\textit{k}_2-1.

**a** : float, ndarray, shape :math:\left(n, n\right)
The upper triangular part of the upper Hessenberg matrix :math:H.

.. _f06qv-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{side}.

Constraint: :math:\mathrm{side} = \texttt{'L'} or :math:\texttt{'R'}.

(errno :math:2)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

.. _f06qv-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

dutsrh transforms an :math:n\times n real upper triangular matrix :math:U to an upper Hessenberg matrix :math:H, by applying a given sequence of plane rotations from either the left or the right, in planes :math:k_1 to :math:k_2; :math:H has nonzero subdiagonal elements :math:h_{{\textit{k}+1,\textit{k}}}, for :math:\textit{k} = \textit{k}_1,\ldots,\textit{k}_2-1 only.

If :math:\mathrm{side} = \texttt{'L'}, the rotations are applied from the left:

.. math::
H = PU\text{,}

where :math:P = P_{k_1}P_{{k_1+1}} \cdots P_{{k_2-1}}.

If :math:\mathrm{side} = \texttt{'R'}, the rotations are applied from the right:

.. math::
H = UP^\mathrm{T}\text{,}

where :math:P = P_{{k_2-1}} \cdots P_{{k_1+1}}P_{k_1}.

In either case, :math:P_k is a rotation in the :math:\left(k, {k+1}\right) plane.

The :math:2\times 2 plane rotation part of :math:P_k has the form

.. math::
\begin{pmatrix}c_k&s_k\\-s_k&c_k\end{pmatrix}\text{.}
"""
raise NotImplementedError

[docs]def dutsrs(side, k1, k2, c, s, a):
r"""
dutsrs transforms a real upper triangular matrix to an upper spiked matrix by applying a given sequence of plane rotations.

.. _f06qw-py2-py-doc:

For full information please refer to the NAG Library document for f06qw

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06qwf.html

.. _f06qw-py2-py-parameters:

**Parameters**
**side** : str, length 1
Specifies whether :math:U is operated on from the left or the right.

:math:\mathrm{side} = \texttt{'L'}

:math:U is pre-multiplied from the left.

:math:\mathrm{side} = \texttt{'R'}

:math:U is post-multiplied from the right.

**k1** : int
The value :math:k_1.

**k2** : int
The value :math:k_2.

**c** : float, array-like, shape :math:\left(\mathrm{k2}-1\right)
:math:\mathrm{c}[\textit{k}] must hold :math:c_{\textit{k}}, the cosine of the rotation :math:P_{\textit{k}}, for :math:\textit{k} = \textit{k}_1,\ldots,\textit{k}_2-1.

**s** : float, array-like, shape :math:\left(\mathrm{k2}-1\right)
:math:\mathrm{s}[\textit{k}] must hold :math:s_{\textit{k}}, the sine of the rotation :math:P_{\textit{k}}, for :math:\textit{k} = \textit{k}_1,\ldots,\textit{k}_2-1.

**a** : float, array-like, shape :math:\left(n, n\right)
The :math:n\times n upper triangular matrix :math:U.

**Returns**
**s** : float, ndarray, shape :math:\left(\mathrm{k2}-1\right)
:math:\mathrm{s}[\textit{k}] holds a nonzero element of the spike of :math:H: :math:h_{{\textit{k}_2,\textit{k}}} if :math:\mathrm{side} = \texttt{'L'}, or :math:h_{{\textit{k}+1,\textit{k}_1}} if :math:\mathrm{side} = \texttt{'R'}, for :math:\textit{k} = \textit{k}_1,\ldots,\textit{k}_2-1.

**a** : float, ndarray, shape :math:\left(n, n\right)
The upper triangular part of the upper spiked matrix :math:H.

.. _f06qw-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{side}.

Constraint: :math:\mathrm{side} = \texttt{'L'} or :math:\texttt{'R'}.

(errno :math:2)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

.. _f06qw-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

dutsrs transforms an :math:n\times n real upper triangular matrix :math:U to an upper spiked matrix :math:H, by applying a given sequence of plane rotations from either the left or the right, in planes :math:k_1 to :math:k_2.

If :math:\mathrm{side} = \texttt{'L'}, :math:H has a row spike, with nonzero elements :math:h_{{k_2,k}}, for :math:k = k_1,k_1+1,\ldots,k_2-1.
The rotations are applied from the left:

.. math::
H = PU\text{,}

where :math:P = P_{k_1}P_{{k_1+1}} \cdots P_{{k_2-1}} and :math:P_k is a rotation in the :math:\left(k, k_2\right) plane.

If :math:\mathrm{side} = \texttt{'R'}, :math:H has a column spike, with nonzero elements :math:h_{{k+1,k_1}}, for :math:k = k_1,k_1+1,\ldots,k_2-1.
The rotations are applied from the right:

.. math::
HP^\mathrm{T} = R\text{,}

where :math:P = P_{{k_2-1}} \cdots P_{{k_1+1}}P_{k_1} and :math:P_k is a rotation in the :math:\left(k_1, {k+1}\right) plane.

The :math:2\times 2 plane rotation part of :math:P_k has the form

.. math::
\begin{pmatrix}c_k&s_k\\-s_k&c_k\end{pmatrix}\text{.}
"""
raise NotImplementedError

[docs]def dgesrc(side, pivot, direct, m, k1, k2, c, s, a):
r"""
dgesrc applies a sequence of plane rotations to a real rectangular matrix.

.. _f06qx-py2-py-doc:

For full information please refer to the NAG Library document for f06qx

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06qxf.html

.. _f06qx-py2-py-parameters:

**Parameters**
**side** : str, length 1
Specifies whether :math:A is operated on from the left or the right.

:math:\mathrm{side} = \texttt{'L'}

:math:A is pre-multiplied from the left.

:math:\mathrm{side} = \texttt{'R'}

:math:A is post-multiplied from the right.

**pivot** : str, length 1
Specifies the plane rotated by :math:P_k.

:math:\mathrm{pivot} = \texttt{'V'} (variable pivot)

:math:P_k rotates the :math:\left(k, {k+1}\right) plane.

:math:\mathrm{pivot} = \texttt{'T'} (top pivot)

:math:P_k rotates the :math:\left(k_1, {k+1}\right) plane.

:math:\mathrm{pivot} = \texttt{'B'} (bottom pivot)

:math:P_k rotates the :math:\left(k, k_2\right) plane.

**direct** : str, length 1
Specifies the sequence direction.

:math:\mathrm{direct} = \texttt{'F'} (forward sequence)

:math:P = P_{{k_2-1}} \cdots P_{{k_1+1}}P_{k_1}.

:math:\mathrm{direct} = \texttt{'B'} (backward sequence)

:math:P = P_{k_1}P_{{k_1+1}} \cdots P_{{k_2-1}}.

**m** : int
:math:m, the number of rows of the matrix :math:A.

If :math:\mathrm{m} < 1, an immediate return is effected.

**k1** : int
The value :math:k_1.

**k2** : int
The value :math:k_2.

**c** : float, array-like, shape :math:\left(\mathrm{k2}-1\right)
:math:\mathrm{c}[\textit{k}] must hold :math:c_{\textit{k}}, the cosine of the rotation :math:P_{\textit{k}}, for :math:\textit{k} = \textit{k}_1,\ldots,\textit{k}_2-1.

**s** : float, array-like, shape :math:\left(\mathrm{k2}-1\right)
:math:\mathrm{s}[\textit{k}] must hold :math:s_{\textit{k}}, the sine of the rotation :math:P_{\textit{k}}, for :math:\textit{k} = \textit{k}_1,\ldots,\textit{k}_2-1.

**a** : float, array-like, shape :math:\left(\mathrm{m}, n\right)
The :math:m\times n matrix :math:A.

**Returns**
**a** : float, ndarray, shape :math:\left(\mathrm{m}, n\right)
The transformed matrix :math:A.

.. _f06qx-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{side}.

Constraint: :math:\mathrm{side} = \texttt{'L'} or :math:\texttt{'R'}.

(errno :math:2)
On entry, error in parameter :math:\mathrm{pivot}.

Constraint: :math:\mathrm{pivot} = \texttt{'V'}, :math:\texttt{'T'} or :math:\texttt{'B'}.

(errno :math:3)
On entry, error in parameter :math:\mathrm{direct}.

Constraint: :math:\mathrm{direct} = \texttt{'F'} or :math:\texttt{'B'}.

(errno :math:4)
On entry, error in parameter :math:\mathrm{m}.

Constraint: :math:\mathrm{m}\geq 0.

(errno :math:5)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

.. _f06qx-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

dgesrc performs the transformation

.. math::

where :math:A is an :math:m\times n real matrix and :math:P is a real orthogonal matrix, defined as a sequence of plane rotations, :math:P_k, applied in planes :math:k_1 to :math:k_2.

The :math:2\times 2 plane rotation part of :math:P_k is assumed to have the form

.. math::
\begin{pmatrix}c_k&s_k\\-s_k&c_k\end{pmatrix}\text{.}
"""
raise NotImplementedError

[docs]def dlange(norm, a):
r"""
dlange returns the value of the :math:1-norm, the :math:\infty-norm, the Frobenius norm, or the maximum absolute value of the elements of a real :math:m\times n matrix.

.. _f06ra-py2-py-doc:

For full information please refer to the NAG Library document for f06ra

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06raf.html

.. _f06ra-py2-py-parameters:

**Parameters**
**norm** : str, length 1
Specifies the value to be returned.

:math:\mathrm{norm} = \texttt{'1'} or :math:\texttt{'O'}

The :math:1-norm.

:math:\mathrm{norm} = \texttt{'I'}

The :math:\infty-norm.

:math:\mathrm{norm} = \texttt{'F'} or :math:\texttt{'E'}

The Frobenius (or Euclidean) norm.

:math:\mathrm{norm} = \texttt{'M'}

The value :math:\mathrm{max}_{{i,j}}\left(\left\lvert a_{{ij}}\right\rvert \right) (not a norm).

**a** : float, array-like, shape :math:\left(m, n\right)
The :math:m\times n matrix :math:A.

**Returns**
**nrm** : float
The value of the :math:1-norm, the :math:\infty-norm, the Frobenius norm, or the maximum absolute value of the elements of the real :math:m\times n matrix.

.. _f06ra-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{norm}.

Constraint: :math:\mathrm{norm} = \texttt{'1'}, :math:\texttt{'O'}, :math:\texttt{'I'}, :math:\texttt{'F'}, :math:\texttt{'E'} or :math:\texttt{'M'}.

(errno :math:2)
On entry, error in parameter :math:\textit{m}.

Constraint: :math:m\geq 0.

(errno :math:3)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

.. _f06ra-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.
"""
raise NotImplementedError

[docs]def dlangb(norm, kl, ku, ab):
r"""
dlangb returns the value of the :math:1-norm, the :math:\infty-norm, the Frobenius norm, or the maximum absolute value of the elements of a real :math:n\times n band matrix.

.. _f06rb-py2-py-doc:

For full information please refer to the NAG Library document for f06rb

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06rbf.html

.. _f06rb-py2-py-parameters:

**Parameters**
**norm** : str, length 1
Specifies the value to be returned.

:math:\mathrm{norm} = \texttt{'1'} or :math:\texttt{'O'}

The :math:1-norm.

:math:\mathrm{norm} = \texttt{'I'}

The :math:\infty-norm.

:math:\mathrm{norm} = \texttt{'F'} or :math:\texttt{'E'}

The Frobenius (or Euclidean) norm.

:math:\mathrm{norm} = \texttt{'M'}

The value :math:\mathrm{max}_{{i,j}}\left(\left\lvert a_{{ij}}\right\rvert \right) (not a norm).

**kl** : int
:math:k_l, the number of subdiagonals within the band of :math:A.

**ku** : int
:math:k_u, the number of superdiagonals within the band of :math:A.

**ab** : float, array-like, shape :math:\left(\mathrm{kl}+\mathrm{ku}+1, n\right)
The :math:n\times n band matrix :math:A.

**Returns**
**nrm** : float
The value of the :math:1-norm, the :math:\infty-norm, the Frobenius norm, or the maximum absolute value of the elements of the real :math:n\times n band matrix.

.. _f06rb-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{norm}.

Constraint: :math:\mathrm{norm} = \texttt{'1'}, :math:\texttt{'O'}, :math:\texttt{'I'}, :math:\texttt{'F'}, :math:\texttt{'E'} or :math:\texttt{'M'}.

(errno :math:2)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

(errno :math:3)
On entry, error in parameter :math:\mathrm{kl}.

Constraint: :math:\mathrm{kl}\geq 0.

(errno :math:4)
On entry, error in parameter :math:\mathrm{ku}.

Constraint: :math:\mathrm{ku}\geq 0.

.. _f06rb-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.
"""
raise NotImplementedError

[docs]def dlansy(norm, uplo, a):
r"""
dlansy returns the value of the :math:1-norm, the :math:\infty-norm, the Frobenius norm, or the maximum absolute value of the elements of a real :math:n\times n symmetric matrix.

.. _f06rc-py2-py-doc:

For full information please refer to the NAG Library document for f06rc

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06rcf.html

.. _f06rc-py2-py-parameters:

**Parameters**
**norm** : str, length 1
Specifies the value to be returned.

:math:\mathrm{norm} = \texttt{'1'} or :math:\texttt{'O'}

The :math:1-norm.

:math:\mathrm{norm} = \texttt{'I'}

The :math:\infty-norm (= the :math:1-norm for a symmetric matrix).

:math:\mathrm{norm} = \texttt{'F'} or :math:\texttt{'E'}

The Frobenius (or Euclidean) norm.

:math:\mathrm{norm} = \texttt{'M'}

The value :math:\mathrm{max}_{{i,j}}\left(\left\lvert a_{{ij}}\right\rvert \right) (not a norm).

**uplo** : str, length 1
Specifies whether the upper or lower triangular part of :math:A is stored.

:math:\mathrm{uplo} = \texttt{'U'}

The upper triangular part of :math:A is stored.

:math:\mathrm{uplo} = \texttt{'L'}

The lower triangular part of :math:A is stored.

**a** : float, array-like, shape :math:\left(n, n\right)
The :math:n\times n symmetric matrix :math:A.

**Returns**
**nrm** : float
The value of the :math:1-norm, the :math:\infty-norm, the Frobenius norm, or the maximum absolute value of the elements of the real :math:n\times n symmetric matrix.

.. _f06rc-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{norm}.

Constraint: :math:\mathrm{norm} = \texttt{'1'}, :math:\texttt{'O'}, :math:\texttt{'I'}, :math:\texttt{'F'}, :math:\texttt{'E'} or :math:\texttt{'M'}.

(errno :math:2)
On entry, error in parameter :math:\mathrm{uplo}.

Constraint: :math:\mathrm{uplo} = \texttt{'U'} or :math:\texttt{'L'}.

(errno :math:3)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

.. _f06rc-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.
"""
raise NotImplementedError

[docs]def dlansp(norm, uplo, n, ap):
r"""
dlansp returns the value of the :math:1-norm, the :math:\infty-norm, the Frobenius norm, or the maximum absolute value of the elements of a real :math:n\times n symmetric matrix, stored in packed form.

.. _f06rd-py2-py-doc:

For full information please refer to the NAG Library document for f06rd

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06rdf.html

.. _f06rd-py2-py-parameters:

**Parameters**
**norm** : str, length 1
Specifies the value to be returned.

:math:\mathrm{norm} = \texttt{'1'} or :math:\texttt{'O'}

The :math:1-norm.

:math:\mathrm{norm} = \texttt{'I'}

The :math:\infty-norm (= the :math:1-norm for a symmetric matrix).

:math:\mathrm{norm} = \texttt{'F'} or :math:\texttt{'E'}

The Frobenius (or Euclidean) norm.

:math:\mathrm{norm} = \texttt{'M'}

The value :math:\mathrm{max}_{{i,j}}\left(\left\lvert a_{{ij}}\right\rvert \right) (not a norm).

**uplo** : str, length 1
Specifies whether the upper or lower triangular part of :math:A is stored.

:math:\mathrm{uplo} = \texttt{'U'}

The upper triangular part of :math:A is stored.

:math:\mathrm{uplo} = \texttt{'L'}

The lower triangular part of :math:A is stored.

**n** : int
:math:n, the order of the matrix :math:A.

When :math:\mathrm{n} = 0, dlansp returns zero.

**ap** : float, array-like, shape :math:\left(\mathrm{n}\times \left(\mathrm{n}+1\right)/2\right)
The :math:n\times n symmetric matrix :math:A, packed by columns.

**Returns**
**nrm** : float
The value of the :math:1-norm, the :math:\infty-norm, the Frobenius norm, or the maximum absolute value of the elements of the real :math:n\times n symmetric matrix, stored in packed form.

.. _f06rd-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{norm}.

Constraint: :math:\mathrm{norm} = \texttt{'1'}, :math:\texttt{'O'}, :math:\texttt{'I'}, :math:\texttt{'F'}, :math:\texttt{'E'} or :math:\texttt{'M'}.

(errno :math:2)
On entry, error in parameter :math:\mathrm{uplo}.

Constraint: :math:\mathrm{uplo} = \texttt{'U'} or :math:\texttt{'L'}.

(errno :math:3)
On entry, error in parameter :math:\mathrm{n}.

Constraint: :math:\mathrm{n}\geq 0.

.. _f06rd-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.
"""
raise NotImplementedError

[docs]def dlansb(norm, uplo, k, ab):
r"""
dlansb returns the value of the :math:1-norm, the :math:\infty-norm, the Frobenius norm, or the maximum absolute value of the elements of a real :math:n\times n symmetric band matrix.

.. _f06re-py2-py-doc:

For full information please refer to the NAG Library document for f06re

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06ref.html

.. _f06re-py2-py-parameters:

**Parameters**
**norm** : str, length 1
Specifies the value to be returned.

:math:\mathrm{norm} = \texttt{'1'} or :math:\texttt{'O'}

The :math:1-norm.

:math:\mathrm{norm} = \texttt{'I'}

The :math:\infty-norm (= the :math:1-norm for a symmetric matrix).

:math:\mathrm{norm} = \texttt{'F'} or :math:\texttt{'E'}

The Frobenius (or Euclidean) norm.

:math:\mathrm{norm} = \texttt{'M'}

The value :math:\mathrm{max}_{{i,j}}\left(\left\lvert a_{{ij}}\right\rvert \right) (not a norm).

**uplo** : str, length 1
Specifies whether the upper or lower triangular part of :math:A is stored.

:math:\mathrm{uplo} = \texttt{'U'}

The upper triangular part of :math:A is stored.

:math:\mathrm{uplo} = \texttt{'L'}

The lower triangular part of :math:A is stored.

**k** : int
:math:k, the number of subdiagonals or superdiagonals of the matrix :math:A.

**ab** : float, array-like, shape :math:\left(\mathrm{k}+1, n\right)
The :math:n\times n symmetric band matrix :math:A.

**Returns**
**nrm** : float
The value of the :math:1-norm, the :math:\infty-norm, the Frobenius norm, or the maximum absolute value of the elements of the real :math:n\times n symmetric band matrix.

.. _f06re-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{norm}.

Constraint: :math:\mathrm{norm} = \texttt{'1'}, :math:\texttt{'O'}, :math:\texttt{'I'}, :math:\texttt{'F'}, :math:\texttt{'E'} or :math:\texttt{'M'}.

(errno :math:2)
On entry, error in parameter :math:\mathrm{uplo}.

Constraint: :math:\mathrm{uplo} = \texttt{'U'} or :math:\texttt{'L'}.

(errno :math:3)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

(errno :math:4)
On entry, error in parameter :math:\mathrm{k}.

Constraint: :math:\mathrm{k}\geq 0.

.. _f06re-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.
"""
raise NotImplementedError

[docs]def dlantr(norm, uplo, diag, m, a):
r"""
dlantr returns the value of the :math:1-norm, the :math:\infty-norm, the Frobenius norm, or the maximum absolute value of the elements of a real :math:m\times n trapezoidal matrix (triangular if :math:m = n).

.. _f06rj-py2-py-doc:

For full information please refer to the NAG Library document for f06rj

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06rjf.html

.. _f06rj-py2-py-parameters:

**Parameters**
**norm** : str, length 1
Specifies the value to be returned.

:math:\mathrm{norm} = \texttt{'1'} or :math:\texttt{'O'}

The :math:1-norm.

:math:\mathrm{norm} = \texttt{'I'}

The :math:\infty-norm.

:math:\mathrm{norm} = \texttt{'F'} or :math:\texttt{'E'}

The Frobenius (or Euclidean) norm.

:math:\mathrm{norm} = \texttt{'M'}

The value :math:\mathrm{max}_{{i,j}}\left(\left\lvert a_{{ij}}\right\rvert \right) (not a norm).

**uplo** : str, length 1
Specifies whether :math:A is upper or lower trapezoidal.

:math:\mathrm{uplo} = \texttt{'U'}

:math:A is upper trapezoidal.

:math:\mathrm{uplo} = \texttt{'L'}

:math:A is lower trapezoidal.

**diag** : str, length 1
Specifies whether :math:A has nonunit or unit diagonal elements.

:math:\mathrm{diag} = \texttt{'N'}

The diagonal elements are stored explicitly.

:math:\mathrm{diag} = \texttt{'U'}

The diagonal elements are assumed to be :math:1, and are not referenced.

**m** : int
:math:m, the number of rows of the matrix :math:A.

When :math:\mathrm{m} = 0, dlantr is set to zero.

**a** : float, array-like, shape :math:\left(\mathrm{m}, n\right)
The :math:m\times n trapezoidal matrix :math:A.

**Returns**
**nrm** : float
The value of the :math:1-norm, the :math:\infty-norm, the Frobenius norm, or the maximum absolute value of the elements of the real :math:m\times n trapezoidal matrix (triangular if :math:m = n).

.. _f06rj-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{norm}.

Constraint: :math:\mathrm{norm} = \texttt{'1'}, :math:\texttt{'O'}, :math:\texttt{'I'}, :math:\texttt{'F'}, :math:\texttt{'E'} or :math:\texttt{'M'}.

(errno :math:2)
On entry, error in parameter :math:\mathrm{uplo}.

Constraint: :math:\mathrm{uplo} = \texttt{'U'} or :math:\texttt{'L'}.

(errno :math:3)
On entry, error in parameter :math:\mathrm{diag}.

Constraint: :math:\mathrm{diag} = \texttt{'N'} or :math:\texttt{'U'}.

(errno :math:4)
On entry, error in parameter :math:\mathrm{m}.

Constraint: :math:\mathrm{m}\geq 0.

(errno :math:5)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

.. _f06rj-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.
"""
raise NotImplementedError

[docs]def dlantp(norm, uplo, diag, n, ap):
r"""
dlantp returns the value of the :math:1-norm, the :math:\infty-norm, the Frobenius norm, or the maximum absolute value of the elements of a real :math:n\times n triangular matrix, stored in packed form.

.. _f06rk-py2-py-doc:

For full information please refer to the NAG Library document for f06rk

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06rkf.html

.. _f06rk-py2-py-parameters:

**Parameters**
**norm** : str, length 1
Specifies the value to be returned.

:math:\mathrm{norm} = \texttt{'1'} or :math:\texttt{'O'}

The :math:1-norm.

:math:\mathrm{norm} = \texttt{'I'}

The :math:\infty-norm.

:math:\mathrm{norm} = \texttt{'F'} or :math:\texttt{'E'}

The Frobenius (or Euclidean) norm.

:math:\mathrm{norm} = \texttt{'M'}

The value :math:\mathrm{max}_{{i,j}}\left(\left\lvert a_{{ij}}\right\rvert \right) (not a norm).

**uplo** : str, length 1
Specifies whether :math:A is upper or lower triangular.

:math:\mathrm{uplo} = \texttt{'U'}

:math:A is upper triangular.

:math:\mathrm{uplo} = \texttt{'L'}

:math:A is lower triangular.

**diag** : str, length 1
Specifies whether :math:A has nonunit or unit diagonal elements.

:math:\mathrm{diag} = \texttt{'N'}

The diagonal elements are stored explicitly.

:math:\mathrm{diag} = \texttt{'U'}

The diagonal elements are assumed to be :math:1, and are not referenced.

**n** : int
:math:n, the order of the matrix :math:A.

When :math:\mathrm{n} = 0, dlantp returns zero.

**ap** : float, array-like, shape :math:\left(\mathrm{n}\times \left(\mathrm{n}+1\right)/2\right)
The :math:n\times n triangular matrix :math:A, packed by columns.

**Returns**
**nrm** : float
The value of the :math:1-norm, the :math:\infty-norm, the Frobenius norm, or the maximum absolute value of the elements of the real :math:n\times n triangular matrix, stored in packed form.

.. _f06rk-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{norm}.

Constraint: :math:\mathrm{norm} = \texttt{'1'}, :math:\texttt{'O'}, :math:\texttt{'I'}, :math:\texttt{'F'}, :math:\texttt{'E'} or :math:\texttt{'M'}.

(errno :math:2)
On entry, error in parameter :math:\mathrm{uplo}.

Constraint: :math:\mathrm{uplo} = \texttt{'U'} or :math:\texttt{'L'}.

(errno :math:3)
On entry, error in parameter :math:\mathrm{diag}.

Constraint: :math:\mathrm{diag} = \texttt{'N'} or :math:\texttt{'U'}.

(errno :math:4)
On entry, error in parameter :math:\mathrm{n}.

Constraint: :math:\mathrm{n}\geq 0.

.. _f06rk-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.
"""
raise NotImplementedError

[docs]def dlantb(norm, uplo, diag, k, ab):
r"""
dlantb returns the value of the :math:1-norm, the :math:\infty-norm, the Frobenius norm, or the maximum absolute value of the elements of a real :math:n\times n triangular band matrix.

.. _f06rl-py2-py-doc:

For full information please refer to the NAG Library document for f06rl

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06rlf.html

.. _f06rl-py2-py-parameters:

**Parameters**
**norm** : str, length 1
Specifies the value to be returned.

:math:\mathrm{norm} = \texttt{'1'} or :math:\texttt{'O'}

The :math:1-norm.

:math:\mathrm{norm} = \texttt{'I'}

The :math:\infty-norm.

:math:\mathrm{norm} = \texttt{'F'} or :math:\texttt{'E'}

The Frobenius (or Euclidean) norm.

:math:\mathrm{norm} = \texttt{'M'}

The value :math:\mathrm{max}_{{i,j}}\left(\left\lvert a_{{ij}}\right\rvert \right) (not a norm).

**uplo** : str, length 1
Specifies whether :math:A is upper or lower triangular.

:math:\mathrm{uplo} = \texttt{'U'}

:math:A is upper triangular.

:math:\mathrm{uplo} = \texttt{'L'}

:math:A is lower triangular.

**diag** : str, length 1
Specifies whether :math:A has nonunit or unit diagonal elements.

:math:\mathrm{diag} = \texttt{'N'}

The diagonal elements are stored explicitly.

:math:\mathrm{diag} = \texttt{'U'}

The diagonal elements are assumed to be :math:1, and are not referenced.

**k** : int
:math:k, the number of subdiagonals or superdiagonals of the matrix :math:A.

**ab** : float, array-like, shape :math:\left(\mathrm{k}+1, n\right)
The :math:n\times n triangular band matrix :math:A

**Returns**
**nrm** : float
The value of the :math:1-norm, the :math:\infty-norm, the Frobenius norm, or the maximum absolute value of the elements of the real :math:n\times n triangular band matrix.

.. _f06rl-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{norm}.

Constraint: :math:\mathrm{norm} = \texttt{'1'}, :math:\texttt{'O'}, :math:\texttt{'I'}, :math:\texttt{'F'}, :math:\texttt{'E'} or :math:\texttt{'M'}.

(errno :math:2)
On entry, error in parameter :math:\mathrm{uplo}.

Constraint: :math:\mathrm{uplo} = \texttt{'U'} or :math:\texttt{'L'}.

(errno :math:3)
On entry, error in parameter :math:\mathrm{diag}.

Constraint: :math:\mathrm{diag} = \texttt{'N'} or :math:\texttt{'U'}.

(errno :math:4)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

(errno :math:5)
On entry, error in parameter :math:\mathrm{k}.

Constraint: :math:\mathrm{k}\geq 0.

.. _f06rl-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.
"""
raise NotImplementedError

[docs]def dlanhs(norm, a):
r"""
dlanhs returns the value of the :math:1-norm, the :math:\infty-norm, the Frobenius norm, or the maximum absolute value of the elements of a real :math:n\times n upper Hessenberg matrix.

.. _f06rm-py2-py-doc:

For full information please refer to the NAG Library document for f06rm

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06rmf.html

.. _f06rm-py2-py-parameters:

**Parameters**
**norm** : str, length 1
Specifies the value to be returned.

:math:\mathrm{norm} = \texttt{'1'} or :math:\texttt{'O'}

The :math:1-norm.

:math:\mathrm{norm} = \texttt{'I'}

The :math:\infty-norm.

:math:\mathrm{norm} = \texttt{'F'} or :math:\texttt{'E'}

The Frobenius (or Euclidean) norm.

:math:\mathrm{norm} = \texttt{'M'}

The value :math:\mathrm{max}_{{i,j}}\left(\left\lvert a_{{ij}}\right\rvert \right) (not a norm).

**a** : float, array-like, shape :math:\left(n, n\right)
The :math:n\times n upper Hessenberg matrix :math:A; elements of the array below the first subdiagonal are not referenced.

**Returns**
**nrm** : float
The value of the :math:1-norm, the :math:\infty-norm, the Frobenius norm, or the maximum absolute value of the elements of the real :math:n\times n upper Hessenberg matrix.

.. _f06rm-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{norm}.

Constraint: :math:\mathrm{norm} = \texttt{'1'}, :math:\texttt{'O'}, :math:\texttt{'I'}, :math:\texttt{'F'}, :math:\texttt{'E'} or :math:\texttt{'M'}.

(errno :math:2)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

.. _f06rm-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.
"""
raise NotImplementedError

[docs]def dlangt(norm, dl, d, du):
r"""
dlangt returns the value of the :math:1-norm, the :math:\infty-norm, the Frobenius norm, or the maximum absolute value of the elements of a real :math:n\times n tridiagonal matrix :math:A.

.. _f06rn-py2-py-doc:

For full information please refer to the NAG Library document for f06rn

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06rnf.html

.. _f06rn-py2-py-parameters:

**Parameters**
**norm** : str, length 1
Specifies the value to be returned.

:math:\mathrm{norm} = \texttt{'1'} or :math:\texttt{'O'}

The :math:1-norm.

:math:\mathrm{norm} = \texttt{'I'}

The :math:\infty-norm.

:math:\mathrm{norm} = \texttt{'F'} or :math:\texttt{'E'}

The Frobenius (or Euclidean) norm.

:math:\mathrm{norm} = \texttt{'M'}

The value :math:\mathrm{max}_{{i,j}}\left(\left\lvert a_{{ij}}\right\rvert \right) (not a norm).

**dl** : float, array-like, shape :math:\left(n-1\right)
The (:math:n-1) subdiagonal elements of :math:A.

**d** : float, array-like, shape :math:\left(n\right)
The :math:n diagonal elements of :math:A.

**du** : float, array-like, shape :math:\left(n-1\right)
The (:math:n-1) superdiagonal elements of :math:A.

**Returns**
**nrm** : float
The value of the :math:1-norm, the :math:\infty-norm, the Frobenius norm, or the maximum absolute value of the elements of the real :math:n\times n tridiagonal matrix :math:A.

.. _f06rn-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{norm}.

Constraint: :math:\mathrm{norm} = \texttt{'1'}, :math:\texttt{'O'}, :math:\texttt{'I'}, :math:\texttt{'F'}, :math:\texttt{'E'} or :math:\texttt{'M'}.

(errno :math:2)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

.. _f06rn-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.
"""
raise NotImplementedError

[docs]def dlanst(norm, d, e):
r"""
dlanst returns the value of the :math:1-norm, the :math:\infty-norm, the Frobenius norm, or the maximum absolute value of the elements of a real :math:n\times n symmetric tridiagonal matrix :math:A.

.. _f06rp-py2-py-doc:

For full information please refer to the NAG Library document for f06rp

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06rpf.html

.. _f06rp-py2-py-parameters:

**Parameters**
**norm** : str, length 1
Specifies the value to be returned.

:math:\mathrm{norm} = \texttt{'1'} or :math:\texttt{'O'}

The :math:1-norm.

:math:\mathrm{norm} = \texttt{'I'}

The :math:\infty-norm.

:math:\mathrm{norm} = \texttt{'F'} or :math:\texttt{'E'}

The Frobenius (or Euclidean) norm.

:math:\mathrm{norm} = \texttt{'M'}

The value :math:\mathrm{max}_{{i,j}}\left(\left\lvert a_{{ij}}\right\rvert \right) (not a norm).

**d** : float, array-like, shape :math:\left(n\right)
The :math:n diagonal elements of the tridiagonal matrix :math:A.

**e** : float, array-like, shape :math:\left(n-1\right)
The (:math:n-1) subdiagonal or superdiagonal elements of the tridiagonal matrix :math:A.

**Returns**
**nrm** : float
The value of the :math:1-norm, the :math:\infty-norm, the Frobenius norm, or the maximum absolute value of the elements of the real :math:n\times n symmetric tridiagonal matrix :math:A.

.. _f06rp-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{norm}.

Constraint: :math:\mathrm{norm} = \texttt{'1'}, :math:\texttt{'O'}, :math:\texttt{'I'}, :math:\texttt{'F'}, :math:\texttt{'E'} or :math:\texttt{'M'}.

(errno :math:2)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

.. _f06rp-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.
"""
raise NotImplementedError

[docs]def zgemv(trans, m, alpha, a, x, beta, y=None):
r"""
zgemv computes the matrix-vector product for a complex general matrix, its transpose or its conjugate transpose.

.. _f06sa-py2-py-doc:

For full information please refer to the NAG Library document for f06sa

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06saf.html

.. _f06sa-py2-py-parameters:

**Parameters**
**trans** : str, length 1
Specifies the operation to be performed.

:math:\mathrm{trans} = \texttt{'N'}

:math:y←\alpha Ax+\beta y.

:math:\mathrm{trans} = \texttt{'T'}

:math:y←\alpha A^\mathrm{T}x+\beta y.

:math:\mathrm{trans} = \texttt{'C'}

:math:y←\alpha A^\mathrm{H}x+\beta y.

**m** : int
:math:m, the number of rows of the matrix :math:A.

**alpha** : complex
The scalar :math:\alpha.

**a** : complex, array-like, shape :math:\left(\mathrm{m}, n\right)
The :math:m\times n matrix :math:A.

**x** : complex, array-like, shape :math:\left(:\right)
Note: the required length for this argument is determined as follows: if :math:\mathrm{trans}=\texttt{'N'}: :math:n; if :math:\mathrm{trans}\text{ in } (\texttt{'T'}, \texttt{'C'}): :math:\mathrm{m}; otherwise: :math:0.

The vector :math:x.

**beta** : complex
The scalar :math:\beta.

**y** : None or complex, array-like, shape :math:\left(:\right), optional
Note: the required length for this argument is determined as follows: if :math:\mathrm{trans}=\texttt{'N'}: :math:\mathrm{m}; if :math:\mathrm{trans}\text{ in } (\texttt{'T'}, \texttt{'C'}): :math:n; otherwise: :math:0.

The vector :math:y, if :math:\mathrm{beta} = 0.0, :math:\mathrm{y} need not be set.

**Returns**
**y** : complex, ndarray, shape :math:\left(:\right)
The updated vector :math:y.

.. _f06sa-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{trans}.

Constraint: :math:\mathrm{trans} = \texttt{'N'}, :math:\texttt{'T'} or :math:\texttt{'C'}.

(errno :math:2)
On entry, error in parameter :math:\mathrm{m}.

Constraint: :math:\mathrm{m}\geq 0.

(errno :math:3)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

(errno :math:8)
On entry, error in parameter :math:\textit{incx}.

Constraint: :math:\textit{incx}\neq 0.

(errno :math:11)
On entry, error in parameter :math:\textit{incy}.

Constraint: :math:\textit{incy}\neq 0.

.. _f06sa-py2-py-notes:

**Notes**
In the NAG Library the traditional C interface for this routine uses a different algorithmic base. Please contact NAG if you have any questions about compatibility.

zgemv performs one of the matrix-vector operations

.. math::

where :math:A is an :math:m\times n complex matrix, :math:x and :math:y are complex vectors, and :math:\alpha and :math:\beta are complex scalars.

If :math:m = 0 or :math:n = 0, no operation is performed.
"""
raise NotImplementedError

[docs]def zgbmv(trans, m, kl, ku, alpha, a, x, beta, y=None):
r"""
zgbmv computes the matrix-vector product for a complex general band matrix, its transpose or its conjugate transpose.

.. _f06sb-py2-py-doc:

For full information please refer to the NAG Library document for f06sb

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06sbf.html

.. _f06sb-py2-py-parameters:

**Parameters**
**trans** : str, length 1
Specifies the operation to be performed.

:math:\mathrm{trans} = \texttt{'N'}

:math:y←\alpha Ax+\beta y.

:math:\mathrm{trans} = \texttt{'T'}

:math:y←\alpha A^\mathrm{T}x+\beta y.

:math:\mathrm{trans} = \texttt{'C'}

:math:y←\alpha A^\mathrm{H}x+\beta y.

**m** : int
:math:m, the number of rows of the matrix :math:A.

**kl** : int
:math:k_l, the number of subdiagonals within the band of :math:A.

**ku** : int
:math:k_u, the number of superdiagonals within the band of :math:A.

**alpha** : complex
The scalar :math:\alpha.

**a** : complex, array-like, shape :math:\left(\mathrm{kl}+\mathrm{ku}+1, n\right)
The :math:m\times n band matrix :math:A.

**x** : complex, array-like, shape :math:\left(:\right)
Note: the required length for this argument is determined as follows: if :math:\mathrm{trans}=\texttt{'N'}: :math:n; if :math:\mathrm{trans}\text{ in } (\texttt{'T'}, \texttt{'C'}): :math:\mathrm{m}; otherwise: :math:0.

The vector :math:x.

**beta** : complex
The scalar :math:\beta.

**y** : None or complex, array-like, shape :math:\left(:\right), optional
Note: the required length for this argument is determined as follows: if :math:\mathrm{trans}=\texttt{'N'}: :math:\mathrm{m}; if :math:\mathrm{trans}\text{ in } (\texttt{'T'}, \texttt{'C'}): :math:n; otherwise: :math:0.

The vector :math:y, if :math:\mathrm{beta} = 0.0, :math:\mathrm{y} need not be set.

**Returns**
**y** : complex, ndarray, shape :math:\left(:\right)
The updated vector :math:y.

.. _f06sb-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{trans}.

Constraint: :math:\mathrm{trans} = \texttt{'N'}, :math:\texttt{'T'} or :math:\texttt{'C'}.

(errno :math:2)
On entry, error in parameter :math:\mathrm{m}.

Constraint: :math:\mathrm{m}\geq 0.

(errno :math:3)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

(errno :math:4)
On entry, error in parameter :math:\mathrm{kl}.

Constraint: :math:\mathrm{kl}\geq 0.

(errno :math:5)
On entry, error in parameter :math:\mathrm{ku}.

Constraint: :math:\mathrm{ku}\geq 0.

(errno :math:10)
On entry, error in parameter :math:\textit{incx}.

Constraint: :math:\textit{incx}\neq 0.

(errno :math:13)
On entry, error in parameter :math:\textit{incy}.

Constraint: :math:\textit{incy}\neq 0.

.. _f06sb-py2-py-notes:

**Notes**
In the NAG Library the traditional C interface for this routine uses a different algorithmic base. Please contact NAG if you have any questions about compatibility.

zgbmv performs one of the matrix-vector operations

.. math::

where :math:A is an :math:m\times n complex band matrix with :math:k_l subdiagonals and :math:k_u superdiagonals, :math:x and :math:y are complex vectors, and :math:\alpha and :math:\beta are complex scalars.

If :math:m = 0 or :math:n = 0, no operation is performed.
"""
raise NotImplementedError

[docs]def zhemv(uplo, alpha, a, x, beta, y=None):
r"""
zhemv computes the matrix-vector product for a complex Hermitian matrix.

.. _f06sc-py2-py-doc:

For full information please refer to the NAG Library document for f06sc

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06scf.html

.. _f06sc-py2-py-parameters:

**Parameters**
**uplo** : str, length 1
Specifies whether the upper or lower triangular part of :math:A is stored.

:math:\mathrm{uplo} = \texttt{'U'}

The upper triangular part of :math:A is stored.

:math:\mathrm{uplo} = \texttt{'L'}

The lower triangular part of :math:A is stored.

**alpha** : complex
The scalar :math:\alpha.

**a** : complex, array-like, shape :math:\left(n, n\right)
The :math:n\times n Hermitian matrix :math:A.

**x** : complex, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:x.

**beta** : complex
The scalar :math:\beta.

**y** : None or complex, array-like, shape :math:\left(n\right), optional
The :math:n-element vector :math:y, if :math:\mathrm{beta} = 0.0, :math:\mathrm{y} need not be set.

**Returns**
**y** : complex, ndarray, shape :math:\left(n\right)
The updated vector :math:y.

.. _f06sc-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{uplo}.

Constraint: :math:\mathrm{uplo} = \texttt{'U'} or :math:\texttt{'L'}.

(errno :math:2)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

(errno :math:7)
On entry, error in parameter :math:\textit{incx}.

Constraint: :math:\textit{incx}\neq 0.

(errno :math:10)
On entry, error in parameter :math:\textit{incy}.

Constraint: :math:\textit{incy}\neq 0.

.. _f06sc-py2-py-notes:

**Notes**
In the NAG Library the traditional C interface for this routine uses a different algorithmic base. Please contact NAG if you have any questions about compatibility.

zhemv performs the matrix-vector operation

.. math::
y←\alpha Ax+\beta y\text{,}

where :math:A is an :math:n\times n complex Hermitian matrix, :math:x and :math:y are :math:n-element complex vectors, and :math:\alpha and :math:\beta are complex scalars.
"""
raise NotImplementedError

[docs]def zhbmv(uplo, k, alpha, a, x, beta, y=None):
r"""
zhbmv computes the matrix-vector product for a complex Hermitian band matrix.

.. _f06sd-py2-py-doc:

For full information please refer to the NAG Library document for f06sd

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06sdf.html

.. _f06sd-py2-py-parameters:

**Parameters**
**uplo** : str, length 1
Specifies whether the upper or lower triangular part of :math:A is stored.

:math:\mathrm{uplo} = \texttt{'U'}

The upper triangular part of :math:A is stored.

:math:\mathrm{uplo} = \texttt{'L'}

The lower triangular part of :math:A is stored.

**k** : int
:math:k, the number of subdiagonals or superdiagonals of the matrix :math:A.

**alpha** : complex
The scalar :math:\alpha.

**a** : complex, array-like, shape :math:\left(\mathrm{k}+1, n\right)
The :math:n\times n Hermitian band matrix :math:A.

**x** : complex, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:x.

**beta** : complex
The scalar :math:\beta.

**y** : None or complex, array-like, shape :math:\left(n\right), optional
The :math:n-element vector :math:y, if :math:\mathrm{beta} = 0.0, :math:\mathrm{y} need not be set.

**Returns**
**y** : complex, ndarray, shape :math:\left(n\right)
The updated vector :math:y.

.. _f06sd-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{uplo}.

Constraint: :math:\mathrm{uplo} = \texttt{'U'} or :math:\texttt{'L'}.

(errno :math:2)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

(errno :math:3)
On entry, error in parameter :math:\mathrm{k}.

Constraint: :math:\mathrm{k}\geq 0.

(errno :math:8)
On entry, error in parameter :math:\textit{incx}.

Constraint: :math:\textit{incx}\neq 0.

(errno :math:11)
On entry, error in parameter :math:\textit{incy}.

Constraint: :math:\textit{incy}\neq 0.

.. _f06sd-py2-py-notes:

**Notes**
In the NAG Library the traditional C interface for this routine uses a different algorithmic base. Please contact NAG if you have any questions about compatibility.

zhbmv performs the matrix-vector operation

.. math::
y←\alpha Ax+\beta y\text{,}

where :math:A is an :math:n\times n complex Hermitian band matrix with :math:k subdiagonals and :math:k superdiagonals, :math:x and :math:y are :math:n-element complex vectors, and :math:\alpha and :math:\beta are complex scalars.
"""
raise NotImplementedError

[docs]def zhpmv(uplo, alpha, ap, x, beta, y=None):
r"""
zhpmv computes the matrix-vector product for a complex Hermitian matrix stored in packed form.

.. _f06se-py2-py-doc:

For full information please refer to the NAG Library document for f06se

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06sef.html

.. _f06se-py2-py-parameters:

**Parameters**
**uplo** : str, length 1
Specifies whether the upper or lower triangular part of :math:A is stored.

:math:\mathrm{uplo} = \texttt{'U'}

The upper triangular part of :math:A is stored.

:math:\mathrm{uplo} = \texttt{'L'}

The lower triangular part of :math:A is stored.

**alpha** : complex
The scalar :math:\alpha.

**ap** : complex, array-like, shape :math:\left(n\times \left(n+1\right)/2\right)
The :math:n\times n Hermitian matrix :math:A, packed by columns.

**x** : complex, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:x.

**beta** : complex
The scalar :math:\beta.

**y** : None or complex, array-like, shape :math:\left(n\right), optional
The :math:n-element vector :math:y, if :math:\mathrm{beta} = 0.0, :math:\mathrm{y} need not be set.

**Returns**
**y** : complex, ndarray, shape :math:\left(n\right)
The updated vector :math:y.

.. _f06se-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{uplo}.

Constraint: :math:\mathrm{uplo} = \texttt{'U'} or :math:\texttt{'L'}.

(errno :math:2)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

(errno :math:6)
On entry, error in parameter :math:\textit{incx}.

Constraint: :math:\textit{incx}\neq 0.

(errno :math:9)
On entry, error in parameter :math:\textit{incy}.

Constraint: :math:\textit{incy}\neq 0.

.. _f06se-py2-py-notes:

**Notes**
In the NAG Library the traditional C interface for this routine uses a different algorithmic base. Please contact NAG if you have any questions about compatibility.

zhpmv performs the matrix-vector operation

.. math::
y←\alpha Ax+\beta y\text{,}

where :math:A is an :math:n\times n complex Hermitian matrix stored in packed form, :math:x and :math:y are :math:n-element complex vectors, and :math:\alpha and :math:\beta are complex scalars.
"""
raise NotImplementedError

[docs]def ztrmv(uplo, trans, diag, a, x):
r"""
ztrmv computes the matrix-vector product for a complex triangular matrix, its transpose or its conjugate transpose.

.. _f06sf-py2-py-doc:

For full information please refer to the NAG Library document for f06sf

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06sff.html

.. _f06sf-py2-py-parameters:

**Parameters**
**uplo** : str, length 1
Specifies whether :math:A is upper or lower triangular.

:math:\mathrm{uplo} = \texttt{'U'}

:math:A is upper triangular.

:math:\mathrm{uplo} = \texttt{'L'}

:math:A is lower triangular.

**trans** : str, length 1
Specifies the operation to be performed.

:math:\mathrm{trans} = \texttt{'N'}

:math:x←Ax.

:math:\mathrm{trans} = \texttt{'T'}

:math:x←A^\mathrm{T}x.

:math:\mathrm{trans} = \texttt{'C'}

:math:x←A^\mathrm{H}x.

**diag** : str, length 1
Specifies whether :math:A has nonunit or unit diagonal elements.

:math:\mathrm{diag} = \texttt{'N'}

The diagonal elements are stored explicitly.

:math:\mathrm{diag} = \texttt{'U'}

The diagonal elements are assumed to be :math:1, and are not referenced.

**a** : complex, array-like, shape :math:\left(n, n\right)
The :math:n\times n triangular matrix :math:A.

**x** : complex, array-like, shape :math:\left(n\right)
The vector :math:x.

**Returns**
**x** : complex, ndarray, shape :math:\left(n\right)
The updated vector :math:x.

.. _f06sf-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{uplo}.

Constraint: :math:\mathrm{uplo} = \texttt{'U'} or :math:\texttt{'L'}.

(errno :math:2)
On entry, error in parameter :math:\mathrm{trans}.

Constraint: :math:\mathrm{trans} = \texttt{'N'}, :math:\texttt{'T'} or :math:\texttt{'C'}.

(errno :math:3)
On entry, error in parameter :math:\mathrm{diag}.

Constraint: :math:\mathrm{diag} = \texttt{'N'} or :math:\texttt{'U'}.

(errno :math:4)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

(errno :math:8)
On entry, error in parameter :math:\textit{incx}.

Constraint: :math:\textit{incx}\neq 0.

.. _f06sf-py2-py-notes:

**Notes**
In the NAG Library the traditional C interface for this routine uses a different algorithmic base. Please contact NAG if you have any questions about compatibility.

ztrmv performs one of the matrix-vector operations

.. math::

where :math:A is an :math:n\times n complex triangular matrix, and :math:x is an :math:n-element complex vector.
"""
raise NotImplementedError

[docs]def ztbmv(uplo, trans, diag, k, a, x):
r"""
ztbmv computes the matrix-vector product for a complex triangular band matrix, its transpose or its conjugate transpose.

.. _f06sg-py2-py-doc:

For full information please refer to the NAG Library document for f06sg

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06sgf.html

.. _f06sg-py2-py-parameters:

**Parameters**
**uplo** : str, length 1
Specifies whether :math:A is upper or lower triangular.

:math:\mathrm{uplo} = \texttt{'U'}

:math:A is upper triangular.

:math:\mathrm{uplo} = \texttt{'L'}

:math:A is lower triangular.

**trans** : str, length 1
Specifies the operation to be performed.

:math:\mathrm{trans} = \texttt{'N'}

:math:x←Ax.

:math:\mathrm{trans} = \texttt{'T'}

:math:x←A^\mathrm{T}x.

:math:\mathrm{trans} = \texttt{'C'}

:math:x←A^\mathrm{H}x.

**diag** : str, length 1
Specifies whether :math:A has nonunit or unit diagonal elements.

:math:\mathrm{diag} = \texttt{'N'}

The diagonal elements are stored explicitly.

:math:\mathrm{diag} = \texttt{'U'}

The diagonal elements are assumed to be :math:1, and are not referenced.

**k** : int
:math:k, the number of subdiagonals or superdiagonals of the matrix :math:A.

**a** : complex, array-like, shape :math:\left(\mathrm{k}+1, n\right)
The :math:n\times n triangular band matrix :math:A

**x** : complex, array-like, shape :math:\left(n\right)
The vector :math:x.

**Returns**
**x** : complex, ndarray, shape :math:\left(n\right)
The updated vector :math:x.

.. _f06sg-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{uplo}.

Constraint: :math:\mathrm{uplo} = \texttt{'U'} or :math:\texttt{'L'}.

(errno :math:2)
On entry, error in parameter :math:\mathrm{trans}.

Constraint: :math:\mathrm{trans} = \texttt{'N'}, :math:\texttt{'T'} or :math:\texttt{'C'}.

(errno :math:3)
On entry, error in parameter :math:\mathrm{diag}.

Constraint: :math:\mathrm{diag} = \texttt{'N'} or :math:\texttt{'U'}.

(errno :math:4)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

(errno :math:5)
On entry, error in parameter :math:\mathrm{k}.

Constraint: :math:\mathrm{k}\geq 0.

(errno :math:9)
On entry, error in parameter :math:\textit{incx}.

Constraint: :math:\textit{incx}\neq 0.

.. _f06sg-py2-py-notes:

**Notes**
In the NAG Library the traditional C interface for this routine uses a different algorithmic base. Please contact NAG if you have any questions about compatibility.

ztbmv performs one of the matrix-vector operations

.. math::

where :math:A is an :math:n\times n complex triangular band matrix with :math:k subdiagonals or superdiagonals, and :math:x is an :math:n-element complex vector.
"""
raise NotImplementedError

[docs]def ztpmv(uplo, trans, diag, ap, x):
r"""
ztpmv computes the matrix-vector product for a complex triangular matrix, its transpose or its conjugate transpose, stored in packed form.

.. _f06sh-py2-py-doc:

For full information please refer to the NAG Library document for f06sh

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06shf.html

.. _f06sh-py2-py-parameters:

**Parameters**
**uplo** : str, length 1
Specifies whether :math:A is upper or lower triangular.

:math:\mathrm{uplo} = \texttt{'U'}

:math:A is upper triangular.

:math:\mathrm{uplo} = \texttt{'L'}

:math:A is lower triangular.

**trans** : str, length 1
Specifies the operation to be performed.

:math:\mathrm{trans} = \texttt{'N'}

:math:x←Ax.

:math:\mathrm{trans} = \texttt{'T'}

:math:x←A^\mathrm{T}x.

:math:\mathrm{trans} = \texttt{'C'}

:math:x←A^\mathrm{H}x.

**diag** : str, length 1
Specifies whether :math:A has nonunit or unit diagonal elements.

:math:\mathrm{diag} = \texttt{'N'}

The diagonal elements are stored explicitly.

:math:\mathrm{diag} = \texttt{'U'}

The diagonal elements are assumed to be :math:1, and are not referenced.

**ap** : complex, array-like, shape :math:\left(n\times \left(n+1\right)/2\right)
The :math:n\times n triangular matrix :math:A, packed by columns.

**x** : complex, array-like, shape :math:\left(n\right)
The vector :math:x.

**Returns**
**x** : complex, ndarray, shape :math:\left(n\right)
The updated vector :math:x.

.. _f06sh-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{uplo}.

Constraint: :math:\mathrm{uplo} = \texttt{'U'} or :math:\texttt{'L'}.

(errno :math:2)
On entry, error in parameter :math:\mathrm{trans}.

Constraint: :math:\mathrm{trans} = \texttt{'N'}, :math:\texttt{'T'} or :math:\texttt{'C'}.

(errno :math:3)
On entry, error in parameter :math:\mathrm{diag}.

Constraint: :math:\mathrm{diag} = \texttt{'N'} or :math:\texttt{'U'}.

(errno :math:4)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

(errno :math:7)
On entry, error in parameter :math:\textit{incx}.

Constraint: :math:\textit{incx}\neq 0.

.. _f06sh-py2-py-notes:

**Notes**
In the NAG Library the traditional C interface for this routine uses a different algorithmic base. Please contact NAG if you have any questions about compatibility.

ztpmv performs one of the matrix-vector operations

.. math::

where :math:A is an :math:n\times n complex triangular matrix, stored in packed form, and :math:x is an :math:n-element complex vector.
"""
raise NotImplementedError

[docs]def ztrsv(uplo, trans, diag, a, x):
r"""
ztrsv solves a complex triangular system of equations with a single right-hand side.

.. _f06sj-py2-py-doc:

For full information please refer to the NAG Library document for f06sj

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06sjf.html

.. _f06sj-py2-py-parameters:

**Parameters**
**uplo** : str, length 1
Specifies whether :math:A is upper or lower triangular.

:math:\mathrm{uplo} = \texttt{'U'}

:math:A is upper triangular.

:math:\mathrm{uplo} = \texttt{'L'}

:math:A is lower triangular.

**trans** : str, length 1
Specifies the operation to be performed.

:math:\mathrm{trans} = \texttt{'N'}

:math:x←A^{-1}x.

:math:\mathrm{trans} = \texttt{'T'}

:math:x←A^{-\mathrm{T}}x.

:math:\mathrm{trans} = \texttt{'C'}

:math:x←A^{-\mathrm{H}}x.

**diag** : str, length 1
Specifies whether :math:A has nonunit or unit diagonal elements.

:math:\mathrm{diag} = \texttt{'N'}

The diagonal elements are stored explicitly.

:math:\mathrm{diag} = \texttt{'U'}

The diagonal elements are assumed to be :math:1, and are not referenced.

**a** : complex, array-like, shape :math:\left(n, n\right)
The :math:n\times n triangular matrix :math:A.

**x** : complex, array-like, shape :math:\left(n\right)
The vector :math:x.

**Returns**
**x** : complex, ndarray, shape :math:\left(n\right)
The updated vector :math:x.

.. _f06sj-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{uplo}.

Constraint: :math:\mathrm{uplo} = \texttt{'U'} or :math:\texttt{'L'}.

(errno :math:2)
On entry, error in parameter :math:\mathrm{trans}.

Constraint: :math:\mathrm{trans} = \texttt{'N'}, :math:\texttt{'T'} or :math:\texttt{'C'}.

(errno :math:3)
On entry, error in parameter :math:\mathrm{diag}.

Constraint: :math:\mathrm{diag} = \texttt{'N'} or :math:\texttt{'U'}.

(errno :math:4)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

(errno :math:8)
On entry, error in parameter :math:\textit{incx}.

Constraint: :math:\textit{incx}\neq 0.

.. _f06sj-py2-py-notes:

**Notes**
In the NAG Library the traditional C interface for this routine uses a different algorithmic base. Please contact NAG if you have any questions about compatibility.

ztrsv performs one of the matrix-vector operations

.. math::

where :math:A is an :math:n\times n complex triangular matrix, and :math:x is an :math:n-element complex vector. :math:A^{-\mathrm{T}} denotes :math:\left(A^\mathrm{T}\right)^{-1} or equivalently :math:\left(A^{-1}\right)^\mathrm{T}; :math:A^{-\mathrm{H}} denotes :math:\left(A^\mathrm{H}\right)^{-1} or equivalently :math:\left(A^{-1}\right)^\mathrm{H}.

No test for singularity or near-singularity of :math:A is included in this function.
Such tests must be performed before calling this function.
"""
raise NotImplementedError

[docs]def ztbsv(uplo, trans, diag, k, a, x):
r"""
ztbsv solves a complex triangular banded system of equations with a single right-hand side.

.. _f06sk-py2-py-doc:

For full information please refer to the NAG Library document for f06sk

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06skf.html

.. _f06sk-py2-py-parameters:

**Parameters**
**uplo** : str, length 1
Specifies whether :math:A is upper or lower triangular.

:math:\mathrm{uplo} = \texttt{'U'}

:math:A is upper triangular.

:math:\mathrm{uplo} = \texttt{'L'}

:math:A is lower triangular.

**trans** : str, length 1
Specifies the operation to be performed.

:math:\mathrm{trans} = \texttt{'N'}

:math:x←A^{-1}x.

:math:\mathrm{trans} = \texttt{'T'}

:math:x←A^{-\mathrm{T}}x.

:math:\mathrm{trans} = \texttt{'C'}

:math:x←A^{-\mathrm{H}}x.

**diag** : str, length 1
Specifies whether :math:A has nonunit or unit diagonal elements.

:math:\mathrm{diag} = \texttt{'N'}

The diagonal elements are stored explicitly.

:math:\mathrm{diag} = \texttt{'U'}

The diagonal elements are assumed to be :math:1, and are not referenced.

**k** : int
:math:k, the number of subdiagonals or superdiagonals of the matrix :math:A.

**a** : complex, array-like, shape :math:\left(\mathrm{k}+1, n\right)
The :math:n\times n triangular band matrix :math:A

**x** : complex, array-like, shape :math:\left(n\right)
The vector :math:x.

**Returns**
**x** : complex, ndarray, shape :math:\left(n\right)
The updated vector :math:x.

.. _f06sk-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{uplo}.

Constraint: :math:\mathrm{uplo} = \texttt{'U'} or :math:\texttt{'L'}.

(errno :math:2)
On entry, error in parameter :math:\mathrm{trans}.

Constraint: :math:\mathrm{trans} = \texttt{'N'}, :math:\texttt{'T'} or :math:\texttt{'C'}.

(errno :math:3)
On entry, error in parameter :math:\mathrm{diag}.

Constraint: :math:\mathrm{diag} = \texttt{'N'} or :math:\texttt{'U'}.

(errno :math:4)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

(errno :math:5)
On entry, error in parameter :math:\mathrm{k}.

Constraint: :math:\mathrm{k}\geq 0.

(errno :math:9)
On entry, error in parameter :math:\textit{incx}.

Constraint: :math:\textit{incx}\neq 0.

.. _f06sk-py2-py-notes:

**Notes**
In the NAG Library the traditional C interface for this routine uses a different algorithmic base. Please contact NAG if you have any questions about compatibility.

ztbsv performs one of the matrix-vector operations

.. math::

where :math:A is an :math:n\times n complex triangular band matrix with :math:k subdiagonals or superdiagonals, and :math:x is an :math:n-element complex vector. :math:A^{-\mathrm{T}} denotes :math:\left(A^\mathrm{T}\right)^{-1} or equivalently :math:\left(A^{-1}\right)^\mathrm{T}; :math:A^{-\mathrm{H}} denotes :math:\left(A^\mathrm{H}\right)^{-1} or equivalently :math:\left(A^{-1}\right)^\mathrm{H}.

No test for singularity or near-singularity of :math:A is included in this function.
Such tests must be performed before calling this function.
"""
raise NotImplementedError

[docs]def ztpsv(uplo, trans, diag, ap, x):
r"""
ztpsv solves a complex triangular system of equations, stored in packed form, with a single right-hand side.

.. _f06sl-py2-py-doc:

For full information please refer to the NAG Library document for f06sl

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06slf.html

.. _f06sl-py2-py-parameters:

**Parameters**
**uplo** : str, length 1
Specifies whether :math:A is upper or lower triangular.

:math:\mathrm{uplo} = \texttt{'U'}

:math:A is upper triangular.

:math:\mathrm{uplo} = \texttt{'L'}

:math:A is lower triangular.

**trans** : str, length 1
Specifies the operation to be performed.

:math:\mathrm{trans} = \texttt{'N'}

:math:x←A^{-1}x.

:math:\mathrm{trans} = \texttt{'T'}

:math:x←A^{-\mathrm{T}}x.

:math:\mathrm{trans} = \texttt{'C'}

:math:x←A^{-\mathrm{H}}x.

**diag** : str, length 1
Specifies whether :math:A has nonunit or unit diagonal elements.

:math:\mathrm{diag} = \texttt{'N'}

The diagonal elements are stored explicitly.

:math:\mathrm{diag} = \texttt{'U'}

The diagonal elements are assumed to be :math:1, and are not referenced.

**ap** : complex, array-like, shape :math:\left(n\times \left(n+1\right)/2\right)
The :math:n\times n triangular matrix :math:A, packed by columns.

**x** : complex, array-like, shape :math:\left(n\right)
The vector :math:x.

**Returns**
**x** : complex, ndarray, shape :math:\left(n\right)
The updated vector :math:x.

.. _f06sl-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{uplo}.

Constraint: :math:\mathrm{uplo} = \texttt{'U'} or :math:\texttt{'L'}.

(errno :math:2)
On entry, error in parameter :math:\mathrm{trans}.

Constraint: :math:\mathrm{trans} = \texttt{'N'}, :math:\texttt{'T'} or :math:\texttt{'C'}.

(errno :math:3)
On entry, error in parameter :math:\mathrm{diag}.

Constraint: :math:\mathrm{diag} = \texttt{'N'} or :math:\texttt{'U'}.

(errno :math:4)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

(errno :math:7)
On entry, error in parameter :math:\textit{incx}.

Constraint: :math:\textit{incx}\neq 0.

.. _f06sl-py2-py-notes:

**Notes**
In the NAG Library the traditional C interface for this routine uses a different algorithmic base. Please contact NAG if you have any questions about compatibility.

ztpsv performs one of the matrix-vector operations

.. math::

where :math:A is an :math:n\times n complex triangular matrix, stored in packed form, and :math:x is an :math:n-element complex vector. :math:A^{-\mathrm{T}} denotes :math:\left(A^\mathrm{T}\right)^{-1} or equivalently :math:\left(A^{-1}\right)^\mathrm{T}; :math:A^{-\mathrm{H}} denotes :math:\left(A^\mathrm{H}\right)^{-1} or equivalently :math:\left(A^{-1}\right)^\mathrm{H}.

No test for singularity or near-singularity of :math:A is included in this function.
Such tests must be performed before calling this function.
"""
raise NotImplementedError

[docs]def zgeru(alpha, x, y, a):
r"""
zgeru computes the rank-1 update of a complex general matrix using an unconjugated vector.

.. _f06sm-py2-py-doc:

For full information please refer to the NAG Library document for f06sm

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06smf.html

.. _f06sm-py2-py-parameters:

**Parameters**
**alpha** : complex
The scalar :math:\alpha.

**x** : complex, array-like, shape :math:\left(m\right)
The :math:m element vector :math:x.

Intermediate elements of X are not referenced.

**y** : complex, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:y.

**a** : complex, array-like, shape :math:\left(m, n\right)
The :math:m\times n matrix :math:A.

**Returns**
**a** : complex, ndarray, shape :math:\left(m, n\right)
The updated matrix :math:A.

.. _f06sm-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\textit{m}.

Constraint: :math:m\geq 0.

(errno :math:2)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

(errno :math:5)
On entry, error in parameter :math:\textit{incx}.

Constraint: :math:\textit{incx}\neq 0.

(errno :math:7)
On entry, error in parameter :math:\textit{incy}.

Constraint: :math:\textit{incy}\neq 0.

.. _f06sm-py2-py-notes:

**Notes**
In the NAG Library the traditional C interface for this routine uses a different algorithmic base. Please contact NAG if you have any questions about compatibility.

zgeru performs the rank-1 update operation

.. math::
A←\alpha xy^\mathrm{T}+A\text{,}

where :math:A is an :math:m\times n complex matrix, :math:x is an :math:m element complex vector, :math:y is an :math:n-element complex vector, and :math:\alpha is a complex scalar.
"""
raise NotImplementedError

[docs]def zgerc(alpha, x, y, a):
r"""
zgerc computes the rank-1 update of a complex general matrix using a conjugated vector.

.. _f06sn-py2-py-doc:

For full information please refer to the NAG Library document for f06sn

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06snf.html

.. _f06sn-py2-py-parameters:

**Parameters**
**alpha** : complex
The scalar :math:\alpha.

**x** : complex, array-like, shape :math:\left(m\right)
The :math:m element vector :math:x.

Intermediate elements of X are not referenced.

**y** : complex, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:y.

**a** : complex, array-like, shape :math:\left(m, n\right)
The :math:m\times n matrix :math:A.

**Returns**
**a** : complex, ndarray, shape :math:\left(m, n\right)
The updated matrix :math:A.

.. _f06sn-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\textit{m}.

Constraint: :math:m\geq 0.

(errno :math:2)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

(errno :math:5)
On entry, error in parameter :math:\textit{incx}.

Constraint: :math:\textit{incx}\neq 0.

(errno :math:7)
On entry, error in parameter :math:\textit{incy}.

Constraint: :math:\textit{incy}\neq 0.

.. _f06sn-py2-py-notes:

**Notes**
In the NAG Library the traditional C interface for this routine uses a different algorithmic base. Please contact NAG if you have any questions about compatibility.

zgerc performs the rank-1 update operation

.. math::
A←\alpha xy^\mathrm{H}+A\text{,}

where :math:A is an :math:m\times n complex matrix, :math:x is an :math:m element complex vector, :math:y is an :math:n-element complex vector, and :math:\alpha is a complex scalar.
"""
raise NotImplementedError

[docs]def zher(uplo, alpha, x, a):
r"""
zher computes the rank-1 update of a complex Hermitian matrix.

.. _f06sp-py2-py-doc:

For full information please refer to the NAG Library document for f06sp

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06spf.html

.. _f06sp-py2-py-parameters:

**Parameters**
**uplo** : str, length 1
Specifies whether the upper or lower triangular part of :math:A is stored.

:math:\mathrm{uplo} = \texttt{'U'}

The upper triangular part of :math:A is stored.

:math:\mathrm{uplo} = \texttt{'L'}

The lower triangular part of :math:A is stored.

**alpha** : float
The scalar :math:\alpha.

**x** : complex, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:x.

**a** : complex, array-like, shape :math:\left(n, n\right)
The :math:n\times n Hermitian matrix :math:A.

**Returns**
**a** : complex, ndarray, shape :math:\left(n, n\right)
The updated matrix :math:A. The imaginary parts of the diagonal elements are set to zero.

.. _f06sp-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{uplo}.

Constraint: :math:\mathrm{uplo} = \texttt{'U'} or :math:\texttt{'L'}.

(errno :math:2)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

(errno :math:5)
On entry, error in parameter :math:\textit{incx}.

Constraint: :math:\textit{incx}\neq 0.

.. _f06sp-py2-py-notes:

**Notes**
In the NAG Library the traditional C interface for this routine uses a different algorithmic base. Please contact NAG if you have any questions about compatibility.

zher performs the Hermitian rank-1 update operation

.. math::
A←\alpha xx^\mathrm{H}+A\text{,}

where :math:A is an :math:n\times n complex Hermitian matrix, :math:x is an :math:n-element complex vector, and :math:\alpha is a real scalar.
"""
raise NotImplementedError

[docs]def zhpr(uplo, alpha, x, ap):
r"""
zhpr computes the rank-1 update of a complex Hermitian matrix stored in packed form.

.. _f06sq-py2-py-doc:

For full information please refer to the NAG Library document for f06sq

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06sqf.html

.. _f06sq-py2-py-parameters:

**Parameters**
**uplo** : str, length 1
Specifies whether the upper or lower triangular part of :math:A is stored.

:math:\mathrm{uplo} = \texttt{'U'}

The upper triangular part of :math:A is stored.

:math:\mathrm{uplo} = \texttt{'L'}

The lower triangular part of :math:A is stored.

**alpha** : float
The scalar :math:\alpha.

**x** : complex, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:x.

**ap** : complex, array-like, shape :math:\left(n\times \left(n+1\right)/2\right)
The :math:n\times n Hermitian matrix :math:A, packed by columns.

**Returns**
**ap** : complex, ndarray, shape :math:\left(n\times \left(n+1\right)/2\right)
The updated matrix :math:A. The imaginary parts of the diagonal elements are set to zero.

.. _f06sq-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{uplo}.

Constraint: :math:\mathrm{uplo} = \texttt{'U'} or :math:\texttt{'L'}.

(errno :math:2)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

(errno :math:5)
On entry, error in parameter :math:\textit{incx}.

Constraint: :math:\textit{incx}\neq 0.

.. _f06sq-py2-py-notes:

**Notes**
In the NAG Library the traditional C interface for this routine uses a different algorithmic base. Please contact NAG if you have any questions about compatibility.

zhpr performs the Hermitian rank-1 update operation

.. math::
A←\alpha xx^\mathrm{H}+A\text{,}

where :math:A is an :math:n\times n complex Hermitian matrix, stored in packed form, :math:x is an :math:n-element complex vector, and :math:\alpha is a real scalar.
"""
raise NotImplementedError

[docs]def zher2(uplo, alpha, x, y, a):
r"""
zher2 computes the rank-2 update of a complex Hermitian matrix.

.. _f06sr-py2-py-doc:

For full information please refer to the NAG Library document for f06sr

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06srf.html

.. _f06sr-py2-py-parameters:

**Parameters**
**uplo** : str, length 1
Specifies whether the upper or lower triangular part of :math:A is stored.

:math:\mathrm{uplo} = \texttt{'U'}

The upper triangular part of :math:A is stored.

:math:\mathrm{uplo} = \texttt{'L'}

The lower triangular part of :math:A is stored.

**alpha** : complex
The scalar :math:\alpha.

**x** : complex, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:x.

**y** : complex, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:y.

**a** : complex, array-like, shape :math:\left(n, n\right)
The :math:n\times n Hermitian matrix :math:A.

**Returns**
**a** : complex, ndarray, shape :math:\left(n, n\right)
The updated matrix :math:A. The imaginary parts of the diagonal elements are set to zero.

.. _f06sr-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{uplo}.

Constraint: :math:\mathrm{uplo} = \texttt{'U'} or :math:\texttt{'L'}.

(errno :math:2)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

(errno :math:5)
On entry, error in parameter :math:\textit{incx}.

Constraint: :math:\textit{incx}\neq 0.

(errno :math:7)
On entry, error in parameter :math:\textit{incy}.

Constraint: :math:\textit{incy}\neq 0.

.. _f06sr-py2-py-notes:

**Notes**
In the NAG Library the traditional C interface for this routine uses a different algorithmic base. Please contact NAG if you have any questions about compatibility.

zher2 performs the Hermitian rank-2 update operation

.. math::
A←\alpha xy^\mathrm{H}+\bar{\alpha }yx^\mathrm{H}+A\text{,}

where :math:A is an :math:n\times n complex Hermitian matrix, :math:x and :math:y are :math:n-element complex vectors, and :math:\alpha is a complex scalar.
"""
raise NotImplementedError

[docs]def zhpr2(uplo, alpha, x, y, ap):
r"""
zhpr2 computes the rank-2 update of a complex Hermitian matrix stored in packed form.

.. _f06ss-py2-py-doc:

For full information please refer to the NAG Library document for f06ss

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06ssf.html

.. _f06ss-py2-py-parameters:

**Parameters**
**uplo** : str, length 1
Specifies whether the upper or lower triangular part of :math:A is stored.

:math:\mathrm{uplo} = \texttt{'U'}

The upper triangular part of :math:A is stored.

:math:\mathrm{uplo} = \texttt{'L'}

The lower triangular part of :math:A is stored.

**alpha** : complex
The scalar :math:\alpha.

**x** : complex, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:x.

**y** : complex, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:y.

**ap** : complex, array-like, shape :math:\left(n\times \left(n+1\right)/2\right)
The :math:n\times n Hermitian matrix :math:A, packed by columns.

**Returns**
**ap** : complex, ndarray, shape :math:\left(n\times \left(n+1\right)/2\right)
The updated matrix :math:A. The imaginary parts of the diagonal elements are set to zero.

.. _f06ss-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{uplo}.

Constraint: :math:\mathrm{uplo} = \texttt{'U'} or :math:\texttt{'L'}.

(errno :math:2)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

(errno :math:5)
On entry, error in parameter :math:\textit{incx}.

Constraint: :math:\textit{incx}\neq 0.

(errno :math:7)
On entry, error in parameter :math:\textit{incy}.

Constraint: :math:\textit{incy}\neq 0.

.. _f06ss-py2-py-notes:

**Notes**
In the NAG Library the traditional C interface for this routine uses a different algorithmic base. Please contact NAG if you have any questions about compatibility.

zhpr2 performs the Hermitian rank-2 update operation

.. math::
A←\alpha xy^\mathrm{H}+\bar{\alpha }yx^\mathrm{H}+A\text{,}

where :math:A is an :math:n\times n complex Hermitian matrix, stored in packed form, :math:x and :math:y are :math:n-element complex vectors, and :math:\alpha is a complex scalar.
"""
raise NotImplementedError

[docs]def zsymv(uplo, alpha, a, x, beta, y):
r"""
zsymv performs the matrix-vector operation

.. math::
y←\alpha Ax+\beta y\text{,}

where :math:A is an :math:n\times n complex symmetric matrix, :math:x and :math:y are :math:n-element complex vectors, and :math:\alpha and :math:\beta are complex scalars.

.. _f06ta-py2-py-doc:

For full information please refer to the NAG Library document for f06ta

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06taf.html

.. _f06ta-py2-py-parameters:

**Parameters**
**uplo** : str, length 1
Specifies whether the upper or lower triangular part of :math:A is stored.

:math:\mathrm{uplo} = \texttt{'U'}

The upper triangular part of :math:A is stored.

:math:\mathrm{uplo} = \texttt{'L'}

The lower triangular part of :math:A is stored.

**alpha** : complex
The scalar :math:\alpha.

**a** : complex, array-like, shape :math:\left(n, n\right)
The :math:n\times n symmetric matrix :math:A.

**x** : complex, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:x.

**beta** : complex
The scalar :math:\beta.

**y** : complex, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:y.

**Returns**
**y** : complex, ndarray, shape :math:\left(n\right)
The updated vector :math:y.

.. _f06ta-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{uplo}.

Constraint: :math:\mathrm{uplo} = \texttt{'U'} or :math:\texttt{'L'}.

(errno :math:2)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

(errno :math:7)
On entry, error in parameter :math:\textit{incx}.

Constraint: :math:\textit{incx}\neq 0.

(errno :math:10)
On entry, error in parameter :math:\textit{incy}.

Constraint: :math:\textit{incy}\neq 0.

.. _f06ta-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.
"""
raise NotImplementedError

[docs]def zsyr(uplo, alpha, x, a):
r"""
zsyr performs the symmetric rank-1 update operation

.. math::
A←\alpha xx^\mathrm{T}+A\text{,}

where :math:A is an :math:n\times n complex symmetric matrix, :math:x is an :math:n-element complex vector, and :math:\alpha is a complex scalar.

.. _f06tb-py2-py-doc:

For full information please refer to the NAG Library document for f06tb

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06tbf.html

.. _f06tb-py2-py-parameters:

**Parameters**
**uplo** : str, length 1
Specifies whether the upper or lower triangular part of :math:A is stored.

:math:\mathrm{uplo} = \texttt{'U'}

The upper triangular part of :math:A is stored.

:math:\mathrm{uplo} = \texttt{'L'}

The lower triangular part of :math:A is stored.

**alpha** : complex
The scalar :math:\alpha.

**x** : complex, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:x.

**a** : complex, array-like, shape :math:\left(n, n\right)
The :math:n\times n symmetric matrix :math:A.

**Returns**
**a** : complex, ndarray, shape :math:\left(n, n\right)
The updated matrix :math:A.

.. _f06tb-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{uplo}.

Constraint: :math:\mathrm{uplo} = \texttt{'U'} or :math:\texttt{'L'}.

(errno :math:2)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

(errno :math:5)
On entry, error in parameter :math:\textit{incx}.

Constraint: :math:\textit{incx}\neq 0.

.. _f06tb-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.
"""
raise NotImplementedError

[docs]def zspmv(uplo, alpha, ap, x, beta, y):
r"""
zspmv performs the matrix-vector operation

.. math::
y←\alpha Ax+\beta y

where :math:A is an :math:n\times n complex symmetric matrix stored in packed form, :math:x and :math:y are :math:n-element complex vectors, and :math:\alpha and :math:\beta are complex scalars.

.. _f06tc-py2-py-doc:

For full information please refer to the NAG Library document for f06tc

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06tcf.html

.. _f06tc-py2-py-parameters:

**Parameters**
**uplo** : str, length 1
Specifies whether the upper or lower triangular part of :math:A is stored.

:math:\mathrm{uplo} = \texttt{'U'}

The upper triangular part of :math:A is stored.

:math:\mathrm{uplo} = \texttt{'L'}

The lower triangular part of :math:A is stored.

**alpha** : complex
The scalar :math:\alpha.

**ap** : complex, array-like, shape :math:\left(n\times \left(n+1\right)/2\right)
The :math:n\times n symmetric matrix :math:A, packed by columns.

**x** : complex, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:x.

**beta** : complex
The scalar :math:\beta.

**y** : complex, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:y.

**Returns**
**y** : complex, ndarray, shape :math:\left(n\right)
The updated vector :math:y.

.. _f06tc-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{uplo}.

Constraint: :math:\mathrm{uplo} = \texttt{'U'} or :math:\texttt{'L'}.

(errno :math:2)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

(errno :math:6)
On entry, error in parameter :math:\textit{incx}.

Constraint: :math:\textit{incx}\neq 0.

(errno :math:9)
On entry, error in parameter :math:\textit{incy}.

Constraint: :math:\textit{incy}\neq 0.

.. _f06tc-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.
"""
raise NotImplementedError

[docs]def zspr(uplo, alpha, x, ap):
r"""
zspr performs the symmetric rank-1 update operation

.. math::
A←\alpha xx^\mathrm{T}+A\text{,}

where :math:A is an :math:n\times n complex symmetric matrix, stored in packed form, :math:x is an :math:n-element complex vector, and :math:\alpha is a complex scalar.

.. _f06td-py2-py-doc:

For full information please refer to the NAG Library document for f06td

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06tdf.html

.. _f06td-py2-py-parameters:

**Parameters**
**uplo** : str, length 1
Specifies whether the upper or lower triangular part of :math:A is stored.

:math:\mathrm{uplo} = \texttt{'U'}

The upper triangular part of :math:A is stored.

:math:\mathrm{uplo} = \texttt{'L'}

The lower triangular part of :math:A is stored.

**alpha** : complex
The scalar :math:\alpha.

**x** : complex, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:x.

**ap** : complex, array-like, shape :math:\left(n\times \left(n+1\right)/2\right)
The :math:n\times n symmetric matrix :math:A, packed by columns.

**Returns**
**ap** : complex, ndarray, shape :math:\left(n\times \left(n+1\right)/2\right)
The updated matrix :math:A.

.. _f06td-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{uplo}.

Constraint: :math:\mathrm{uplo} = \texttt{'U'} or :math:\texttt{'L'}.

(errno :math:2)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

(errno :math:5)
On entry, error in parameter :math:\textit{incx}.

Constraint: :math:\textit{incx}\neq 0.

.. _f06td-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.
"""
raise NotImplementedError

[docs]def zmcopy(matrix, m, a):
r"""
zmcopy performs the matrix-copy operation

.. math::
B←A

where :math:A and :math:B are :math:m\times n complex general or trapezoidal matrices.

.. _f06tf-py2-py-doc:

For full information please refer to the NAG Library document for f06tf

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06tff.html

.. _f06tf-py2-py-parameters:

**Parameters**
**matrix** : str, length 1
The matrix type.

:math:\mathrm{matrix} = \texttt{'G'}

General matrix.

:math:\mathrm{matrix} = \texttt{'U'}

Upper trapezoidal matrix (upper triangular if :math:m = n).

:math:\mathrm{matrix} = \texttt{'L'}

Lower trapezoidal matrix (lower triangular if :math:m = n).

**m** : int
:math:m, the number of rows of the matrices :math:A and :math:B.

**a** : complex, array-like, shape :math:\left(\mathrm{m}, n\right)
The :math:m\times n general or trapezoidal matrix :math:A.

**Returns**
**b** : complex, ndarray, shape :math:\left(\mathrm{m}, n\right)
The :math:m\times n general or trapezoidal matrix :math:B.

.. _f06tf-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{matrix}.

Constraint: :math:\mathrm{matrix} = \texttt{'G'}, :math:\texttt{'U'} or :math:\texttt{'L'}.

(errno :math:2)
On entry, error in parameter :math:\mathrm{m}.

Constraint: :math:\mathrm{m}\geq 0.

(errno :math:3)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

.. _f06tf-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.
"""
raise NotImplementedError

[docs]def zmload(matrix, m, n, con, diag):
r"""
zmload forms the complex :math:m\times n rectangular or trapezoidal matrix :math:A given by

.. math::
a_{{ij}} = \left\{\begin{array}{rr}\mathrm{diag}&\text{if }i = j\\\mathrm{const}&\text{if }i\neq j\end{array}\right. \text{.}

.. _f06th-py2-py-doc:

For full information please refer to the NAG Library document for f06th

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06thf.html

.. _f06th-py2-py-parameters:

**Parameters**
**matrix** : str, length 1
The matrix type.

:math:\mathrm{matrix} = \texttt{'G'}

General matrix.

:math:\mathrm{matrix} = \texttt{'U'}

Upper trapezoidal matrix (upper triangular if :math:m = n).

:math:\mathrm{matrix} = \texttt{'L'}

Lower trapezoidal matrix (lower triangular if :math:m = n).

**m** : int
:math:m, the number of rows of the matrix :math:A.

**n** : int
:math:n, the number of columns of the matrix :math:A.

**con** : complex
The value to be assigned to the off-diagonal elements of :math:A.

**diag** : complex
The value to be assigned to the diagonal elements of :math:A.

**Returns**
**a** : complex, ndarray, shape :math:\left(\mathrm{m}, \mathrm{n}\right)
The :math:m\times n general or trapezoidal matrix :math:A.

.. _f06th-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{matrix}.

Constraint: :math:\mathrm{matrix} = \texttt{'G'}, :math:\texttt{'U'} or :math:\texttt{'L'}.

(errno :math:2)
On entry, error in parameter :math:\mathrm{m}.

Constraint: :math:\mathrm{m}\geq 0.

(errno :math:3)
On entry, error in parameter :math:\mathrm{n}.

Constraint: :math:\mathrm{n}\geq 0.

.. _f06th-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.
"""
raise NotImplementedError

[docs]def zhesrc(uplo, pivot, direct, k1, k2, c, s, a):
r"""
zhesrc performs a Unitary similarity transformation (as a sequence of plane rotations) of a complex Hermitian matrix.

.. _f06tm-py2-py-doc:

For full information please refer to the NAG Library document for f06tm

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06tmf.html

.. _f06tm-py2-py-parameters:

**Parameters**
**uplo** : str, length 1
Specifies whether the upper or lower triangular part of :math:A is stored.

:math:\mathrm{uplo} = \texttt{'U'}

The upper triangular part of :math:A is stored.

:math:\mathrm{uplo} = \texttt{'L'}

The lower triangular part of :math:A is stored.

**pivot** : str, length 1
Specifies the plane rotated by :math:P_k.

:math:\mathrm{pivot} = \texttt{'V'} (variable pivot)

:math:P_k rotates the :math:\left(k, {k+1}\right) plane.

:math:\mathrm{pivot} = \texttt{'T'} (top pivot)

:math:P_k rotates the :math:\left(k_1, {k+1}\right) plane.

:math:\mathrm{pivot} = \texttt{'B'} (bottom pivot)

:math:P_k rotates the :math:\left(k, k_2\right) plane.

**direct** : str, length 1
Specifies the sequence direction.

:math:\mathrm{direct} = \texttt{'F'} (forward sequence)

:math:P = P_{{k_2-1}} \cdots P_{{k_1+1}}P_{k_1}.

:math:\mathrm{direct} = \texttt{'B'} (backward sequence)

:math:P = P_{k_1}P_{{k_1+1}} \cdots P_{{k_2-1}}.

**k1** : int
The value :math:k_1.

**k2** : int
The value :math:k_2.

**c** : float, array-like, shape :math:\left(\mathrm{k2}-1\right)
:math:\mathrm{c}[\textit{k}] must hold :math:c_{\textit{k}}, the cosine of the rotation :math:P_{\textit{k}}, for :math:\textit{k} = \textit{k}_1,\ldots,\textit{k}_2-1.

**s** : complex, array-like, shape :math:\left(\mathrm{k2}-1\right)
:math:\mathrm{s}[\textit{k}] must hold :math:s_{\textit{k}}, the sine of the rotation :math:P_{\textit{k}}, for :math:\textit{k} = \textit{k}_1,\ldots,\textit{k}_2-1.

**a** : complex, array-like, shape :math:\left(n, n\right)
The :math:n\times n Hermitian matrix :math:A.

**Returns**
**a** : complex, ndarray, shape :math:\left(n, n\right)
The transformed matrix :math:A. The imaginary parts of the diagonal elements are set to zero.

.. _f06tm-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{uplo}.

Constraint: :math:\mathrm{uplo} = \texttt{'U'} or :math:\texttt{'L'}.

(errno :math:2)
On entry, error in parameter :math:\mathrm{pivot}.

Constraint: :math:\mathrm{pivot} = \texttt{'V'}, :math:\texttt{'T'} or :math:\texttt{'B'}.

(errno :math:3)
On entry, error in parameter :math:\mathrm{direct}.

Constraint: :math:\mathrm{direct} = \texttt{'F'} or :math:\texttt{'B'}.

(errno :math:4)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

.. _f06tm-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

zhesrc performs the transformation

.. math::
A←PAP^\mathrm{H}

where :math:A is an :math:n\times n complex Hermitian matrix, and :math:P is a complex unitary matrix defined as a sequence of plane rotations, :math:P_k, applied in planes :math:k_1 to :math:k_2.

The :math:2\times 2 plane rotation part of :math:P_k is assumed to have the form

.. math::
\begin{pmatrix}c_k&\bar{s}_k\\-s_k&c_k\end{pmatrix}

with :math:c_k real.
"""
raise NotImplementedError

[docs]def zutr1(alpha, x, y, a):
r"""
zutr1 performs a :math:QR factorization (as a sequence of plane rotations) of a complex upper triangular matrix that has been modified by a rank-1 update.

.. _f06tp-py2-py-doc:

For full information please refer to the NAG Library document for f06tp

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06tpf.html

.. _f06tp-py2-py-parameters:

**Parameters**
**alpha** : complex
The scalar :math:\alpha.

**x** : complex, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:x.

**y** : complex, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:y.

**a** : complex, array-like, shape :math:\left(n, n\right)
The :math:n\times n upper triangular matrix :math:U. The imaginary parts of the diagonal elements must be zero.

**Returns**
**x** : complex, ndarray, shape :math:\left(n\right)
The referenced elements are overwritten by details of the sequence of plane rotations.

**a** : complex, ndarray, shape :math:\left(n, n\right)
The upper triangular matrix :math:R. The imaginary parts of the diagonal elements must be zero.

**c** : float, ndarray, shape :math:\left(n-1\right)
The cosines of the rotations :math:Q_{\textit{k}}, for :math:\textit{k} = 1,2,\ldots,n-1.

**s** : complex, ndarray, shape :math:\left(n\right)
The sines of the rotations :math:Q_{\textit{k}}, for :math:\textit{k} = 1,2,\ldots,n-1; :math:\mathrm{s}[n] holds :math:d_n, the :math:n\ th diagonal element of :math:D.

.. _f06tp-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

(errno :math:4)
On entry, error in parameter :math:\textit{incx}.

Constraint: :math:\textit{incx} > 0.

(errno :math:6)
On entry, error in parameter :math:\textit{incy}.

Constraint: :math:\textit{incy} > 0.

.. _f06tp-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

zutr1 performs a :math:QR factorization of an upper triangular matrix which has been modified by a rank-1 update:

.. math::
\alpha xy^\mathrm{T}+U = QR

where :math:U and :math:R are :math:n\times n complex upper triangular matrices with real diagonal elements, :math:x and :math:y are :math:n-element complex vectors, :math:\alpha is a complex scalar, and :math:Q is an :math:n\times n complex unitary matrix.

:math:Q is formed as the product of two sequences of plane rotations and a unitary diagonal matrix :math:D:

.. math::
Q^\mathrm{H} = DQ_{{n-1}} \cdots Q_2Q_1P_1P_2 \cdots P_{{n-1}}

where

:math:P_k is a rotation in the :math:\left(k, n\right) plane, chosen to annihilate :math:x_k: thus :math:Px = \beta e_n, where :math:P = P_1P_2 \cdots P_{{n-1}} and :math:e_n is the last column of the unit matrix;

:math:Q_k is a rotation in the :math:\left(k, n\right) plane, chosen to annihilate the :math:\left(n, k\right) element of :math:\left(\alpha \beta e_ny^\mathrm{T}+PU\right), and thus restore it to upper triangular form;

:math:D = \mathrm{diag}\left(1,\ldots,1,d_n\right), with :math:d_n chosen to make :math:r_{{nn}} real; :math:\left\lvert d_n\right\rvert = 1.

The :math:2\times 2 plane rotation part of :math:P_k or :math:Q_k has the form

.. math::
\begin{pmatrix}c_k&\bar{s}_k\\-s_k&c_k\end{pmatrix}

with :math:c_k real.
The tangents of the rotations :math:P_k are returned in the array :math:\mathrm{x}; the cosines and sines of these rotations can be recovered by calling :meth:dcsg.
The cosines and sines of the rotations :math:Q_k are returned directly in the arrays :math:\mathrm{c} and :math:\mathrm{s}.
"""
raise NotImplementedError

[docs]def zutupd(alpha, x, a):
r"""
zutupd performs a :math:QR factorization (as a sequence of plane rotations) of a complex upper triangular matrix that has been augmented by a full row.

.. _f06tq-py2-py-doc:

For full information please refer to the NAG Library document for f06tq

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06tqf.html

.. _f06tq-py2-py-parameters:

**Parameters**
**alpha** : complex
The scalar :math:\alpha.

**x** : complex, array-like, shape :math:\left(n\right)
The :math:n-element vector :math:x.

**a** : complex, array-like, shape :math:\left(n, n\right)
The :math:n\times n upper triangular matrix :math:U.

**Returns**
**x** : complex, ndarray, shape :math:\left(n\right)
The referenced elements are overwritten by details of the sequence of plane rotations.

**a** : complex, ndarray, shape :math:\left(n, n\right)
The upper triangular matrix :math:R.

**c** : float, ndarray, shape :math:\left(n\right)
The values :math:c_{\textit{k}}, the cosines of the rotations :math:Q_{\textit{k}}, for :math:\textit{k} = 1,2,\ldots,n.

**s** : complex, ndarray, shape :math:\left(n\right)
The values :math:s_{\textit{k}}, the sines of the rotations :math:Q_{\textit{k}}, for :math:\textit{k} = 1,2,\ldots,n.

.. _f06tq-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

(errno :math:4)
On entry, error in parameter :math:\textit{incx}.

Constraint: :math:\textit{incx} > 0.

.. _f06tq-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

zutupd performs the factorization

.. math::
\begin{pmatrix}U\\\alpha x^\mathrm{T}\end{pmatrix} = Q\begin{pmatrix}R\\0\end{pmatrix}

where :math:U and :math:R are :math:n\times n complex upper triangular matrices, :math:x is an :math:n-element complex vector, :math:\alpha is a complex scalar, and :math:Q is a complex unitary matrix.
If :math:U has real diagonal elements, then so does :math:R.

:math:Q is formed as a sequence of plane rotations

.. math::
Q^\mathrm{H} = Q_n \cdots Q_2Q_1

where :math:Q_k is a rotation in the :math:\left(k, {n+1}\right) plane, chosen to annihilate :math:x_k.

The :math:2\times 2 plane rotation part of :math:Q_k has the form

.. math::
\begin{pmatrix}c_k&\bar{s}_k\\-s_k&c_k\end{pmatrix}

with :math:c_k real.
"""
raise NotImplementedError

[docs]def zuhqr(side, k1, k2, s, a):
r"""
zuhqr performs a :math:QR or :math:RQ factorization (as a sequence of plane rotations) of a complex upper Hessenberg matrix.

.. _f06tr-py2-py-doc:

For full information please refer to the NAG Library document for f06tr

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06trf.html

.. _f06tr-py2-py-parameters:

**Parameters**
**side** : str, length 1
Specifies whether :math:H is operated on from the left or the right.

:math:\mathrm{side} = \texttt{'L'}

:math:H is pre-multiplied from the left.

:math:\mathrm{side} = \texttt{'R'}

:math:H is post-multiplied from the right.

**k1** : int
The value :math:k_1.

**k2** : int
The value :math:k_2.

**s** : float, array-like, shape :math:\left(\mathrm{k2}-1\right)
The nonzero subdiagonal elements of :math:H: :math:\mathrm{s}[\textit{k}] must hold :math:h_{{\textit{k}+1,\textit{k}}}, for :math:\textit{k} = \textit{k}_1,\ldots,\textit{k}_2-1.

**a** : complex, array-like, shape :math:\left(n, n\right)
The upper triangular part of the :math:n\times n upper Hessenberg matrix :math:H.

**Returns**
**c** : complex, ndarray, shape :math:\left(\mathrm{k2}\right)
:math:\mathrm{c}[\textit{k}] holds :math:c_{\textit{k}}, the cosine of the rotation :math:P_{\textit{k}}, for :math:\textit{k} = \textit{k}_1,\ldots,\textit{k}_2-1; :math:\mathrm{c}[k_2] holds :math:d_{k_2}, the :math:k_2\ th diagonal element of :math:D, if :math:\mathrm{side} = \texttt{'L'}, or :math:d_{k_1}, the :math:k_1\ th diagonal element of :math:D, if :math:\mathrm{side} = \texttt{'R'}.

**s** : float, ndarray, shape :math:\left(\mathrm{k2}-1\right)
:math:\mathrm{s}[\textit{k}] holds :math:s_{\textit{k}}, the sine of the rotation :math:P_{\textit{k}}, for :math:\textit{k} = \textit{k}_1,\ldots,\textit{k}_2-1.

**a** : complex, ndarray, shape :math:\left(n, n\right)
The upper triangular matrix :math:R. The imaginary parts of the diagonal elements are set to zero.

.. _f06tr-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{side}.

Constraint: :math:\mathrm{side} = \texttt{'L'} or :math:\texttt{'R'}.

(errno :math:2)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

.. _f06tr-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

zuhqr transforms an :math:n\times n complex upper Hessenberg matrix :math:H to upper triangular form :math:R by applying a unitary matrix :math:P from the left or the right. :math:H is assumed to have real nonzero subdiagonal elements :math:h_{{\textit{k}+1,\textit{k}}}, for :math:\textit{k} = \textit{k}_1,\ldots,\textit{k}_2-1, only; :math:R has real diagonal elements. :math:P is formed as a sequence of plane rotations in planes :math:k_1 to :math:k_2.

If :math:\mathrm{side} = \texttt{'L'}, the rotations are applied from the left:

.. math::
PH = R\text{,}

where :math:P = DP_{{k_2-1}} \cdots P_{{k_1+1}}P_{k_1} and :math:D = \mathrm{diag}\left(1,\ldots,1,d_{k_2},1,\ldots,1\right) with :math:\left\lvert d_{k_2}\right\rvert = 1.

If :math:\mathrm{side} = \texttt{'R'}, the rotations are applied from the right:

.. math::
HP^\mathrm{H} = R\text{,}

where :math:P = DP_{k_1}P_{{k_1+1}} \cdots P_{{k_2-1}} and :math:D = \mathrm{diag}\left(1,\ldots,1,d_{k_1},1,\ldots,1\right) with :math:\left\lvert d_{k_1}\right\rvert = 1.

In either case, :math:P_k is a rotation in the :math:\left(k, {k+1}\right) plane, chosen to annihilate :math:h_{{k+1,k}}.

The :math:2\times 2 plane rotation part of :math:P_k has the form

.. math::
\begin{pmatrix}\bar{c}_k&s_k\\-s_k&c_k\end{pmatrix}

with :math:s_k real.
"""
raise NotImplementedError

[docs]def zusqr(side, k1, k2, s, a):
r"""
zusqr performs a :math:QR or :math:RQ factorization (as a sequence of plane rotations) of a complex upper spiked matrix.

.. _f06ts-py2-py-doc:

For full information please refer to the NAG Library document for f06ts

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06tsf.html

.. _f06ts-py2-py-parameters:

**Parameters**
**side** : str, length 1
Specifies whether :math:H is operated on from the left or the right.

:math:\mathrm{side} = \texttt{'L'}

:math:H is pre-multiplied from the left.

:math:\mathrm{side} = \texttt{'R'}

:math:H is post-multiplied from the right.

**k1** : int
The value :math:k_1.

**k2** : int
The value :math:k_2.

**s** : complex, array-like, shape :math:\left(\mathrm{k2}\right)
The nonzero elements of the spike of :math:H: :math:\mathrm{s}[\textit{k}] must hold :math:h_{{\textit{k}_2,\textit{k}}} if :math:\mathrm{side} = \texttt{'L'}, and :math:h_{{\textit{k}+1,\textit{k}_1}} if :math:\mathrm{side} = \texttt{'R'}, for :math:\textit{k} = \textit{k}_1,\ldots,\textit{k}_2-1.

**a** : complex, array-like, shape :math:\left(n, n\right)
The upper triangular part of the :math:n\times n upper spiked matrix :math:H. The imaginary parts of the diagonal elements must be zero, except for the :math:\left(k_2, k_2\right) element if :math:\mathrm{side} = \texttt{'L'}, or the :math:\left(k_1, k_1\right) element if :math:\mathrm{side} = \texttt{'R'}.

**Returns**
**c** : float, ndarray, shape :math:\left(\mathrm{k2}-1\right)
:math:\mathrm{c}[\textit{k}] holds :math:c_{\textit{k}}, the cosine of the rotation :math:P_{\textit{k}}, for :math:\textit{k} = \textit{k}_1,\ldots,\textit{k}_2-1.

**s** : complex, ndarray, shape :math:\left(\mathrm{k2}\right)
:math:\mathrm{s}[\textit{k}] holds :math:s_{\textit{k}}, the sine of the rotation :math:P_{\textit{k}}, for :math:\textit{k} = \textit{k}_1,\ldots,\textit{k}_2-1; :math:\mathrm{s}[\textit{k}_2] holds :math:d_{k_2}, the :math:k_2\ th diagonal element of :math:D, if :math:\mathrm{side} = \texttt{'L'}, or :math:d_{k_1}, the :math:k_1\ th diagonal element of :math:D, if :math:\mathrm{side} = \texttt{'R'}.

**a** : complex, ndarray, shape :math:\left(n, n\right)
The upper triangular matrix :math:R. The imaginary parts of the diagonal elements are set to zero.

.. _f06ts-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{side}.

Constraint: :math:\mathrm{side} = \texttt{'L'} or :math:\texttt{'R'}.

(errno :math:2)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

.. _f06ts-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

zusqr transforms an :math:n\times n complex upper spiked matrix :math:H to upper triangular form :math:R by applying a complex unitary matrix :math:P from the left or the right. :math:H is assumed to have real diagonal elements except where the spike joins the diagonal; :math:R has real diagonal elements. :math:P is formed as a sequence of plane rotations in planes :math:k_1 to :math:k_2.

If :math:\mathrm{side} = \texttt{'L'}, :math:H is assumed to have a row spike, with nonzero elements :math:h_{{\textit{k}_2,\textit{k}}}, for :math:\textit{k} = \textit{k}_1,\ldots,\textit{k}_2-1.
The rotations are applied from the left:

.. math::
PH = R\text{,}

where :math:P = DP_{{k_2-1}} \cdots P_{{k_1+1}}P_{k_1}, :math:P_k is a rotation in the :math:\left(k, k_2\right) plane and :math:D = \mathrm{diag}\left(1,\ldots,1,d_{k_2},1,\ldots,1\right) with :math:\left\lvert d_{k_2}\right\rvert = 1.

If :math:\mathrm{side} = \texttt{'R'}, :math:H is assumed to have a column spike, with nonzero elements :math:h_{{\textit{k}+1,\textit{k}_1}}, for :math:\textit{k} = \textit{k}_1,\ldots,\textit{k}_2-1.
The rotations are applied from the right:

.. math::
HP^\mathrm{H} = R\text{,}

where :math:P = DP_{k_1}P_{{k_1+1}} \cdots P_{{k_2-1}}, :math:P_k is a rotation in the :math:\left(k_1, {k+1}\right) plane and :math:D = \mathrm{diag}\left(1,\ldots,1,d_{k_1},1,\ldots,1\right) with :math:\left\lvert d_{k_1}\right\rvert = 1.

The :math:2\times 2 plane rotation part of :math:P_k has the form

.. math::
\begin{pmatrix}c_k&\bar{s}_k\\-s_k&c_k\end{pmatrix}

with :math:c_k real.
"""
raise NotImplementedError

[docs]def zutsqr(side, k1, k2, c, s, a):
r"""
zutsqr performs a :math:QR or :math:RQ factorization of the product of a complex upper triangular matrix and a complex matrix of plane rotations.

.. _f06tt-py2-py-doc:

For full information please refer to the NAG Library document for f06tt

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06ttf.html

.. _f06tt-py2-py-parameters:

**Parameters**
**side** : str, length 1
Specifies whether :math:P is applied from the left or the right in the transformation.

:math:\mathrm{side} = \texttt{'L'}

:math:P is applied from the left.

:math:\mathrm{side} = \texttt{'R'}

:math:P is applied from the right.

**k1** : int
The value :math:k_1.

**k2** : int
The value :math:k_2.

**c** : float, array-like, shape :math:\left(\mathrm{k2}-1\right)
:math:\mathrm{c}[\textit{k}] must hold the cosine of the rotation :math:P_{\textit{k}}, for :math:\textit{k} = \textit{k}_1,\ldots,\textit{k}_2-1.

**s** : complex, array-like, shape :math:\left(\mathrm{k2}-1\right)
:math:\mathrm{s}[\textit{k}] must hold the sine of the rotation :math:P_{\textit{k}}, for :math:\textit{k} = \textit{k}_1,\ldots,\textit{k}_2-1.

**a** : complex, array-like, shape :math:\left(n, n\right)
The :math:n\times n upper triangular matrix :math:U.

**Returns**
**c** : float, ndarray, shape :math:\left(\mathrm{k2}-1\right)
:math:\mathrm{c}[\textit{k}] holds the cosine of the rotation :math:Q_{\textit{k}}, for :math:\textit{k} = \textit{k}_1,\ldots,\textit{k}_2-1.

**s** : complex, ndarray, shape :math:\left(\mathrm{k2}-1\right)
:math:\mathrm{s}[\textit{k}] holds the sine of the rotation :math:Q_{\textit{k}}, for :math:\textit{k} = \textit{k}_1,\ldots,\textit{k}_2-1.

**a** : complex, ndarray, shape :math:\left(n, n\right)
The upper triangular matrix :math:R.

.. _f06tt-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{side}.

Constraint: :math:\mathrm{side} = \texttt{'L'} or :math:\texttt{'R'}.

(errno :math:2)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

.. _f06tt-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

zutsqr performs one of the transformations

.. math::

where :math:U is a given :math:n\times n complex upper triangular matrix, :math:P is a given complex unitary matrix, and :math:Q is a complex unitary matrix chosen to make :math:R upper triangular.
Both :math:P and :math:Q are represented as sequences of plane rotations in planes :math:k_1 to :math:k_2.

If :math:\mathrm{side} = \texttt{'L'},

.. math::
R←PUQ^\mathrm{H}\text{,}

where :math:P = P_{{k_2-1}}\ldots P_{{k_1+1}}P_{k_1} and :math:Q = Q_{{k_2-1}}\ldots Q_{{k_1+1}}Q_{k_1}.

If :math:\mathrm{side} = \texttt{'R'},

.. math::
R←QUP^\mathrm{H}\text{,}

where :math:P = P_{k_1}P_{{k_1+1}}\ldots P_{{k_2-1}} and :math:Q = Q_{k_1}Q_{{k_1+1}}\ldots Q_{{k_2-1}}.

In either case :math:P_k and :math:Q_k are rotations in the :math:\left(k, {k+1}\right) plane.

The :math:2\times 2 rotation part of :math:P_k or :math:Q_k has the form

.. math::
\begin{pmatrix}c_k&\bar{s}_k\\-s_k&c_k\end{pmatrix}

with :math:c_k real.
"""
raise NotImplementedError

[docs]def zutsrh(side, k1, k2, c, s, a):
r"""
zutsrh transforms a complex upper triangular matrix to an upper Hessenberg matrix by applying a given sequence of plane rotations.

.. _f06tv-py2-py-doc:

For full information please refer to the NAG Library document for f06tv

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06tvf.html

.. _f06tv-py2-py-parameters:

**Parameters**
**side** : str, length 1
Specifies whether :math:U is operated on from the left or the right.

:math:\mathrm{side} = \texttt{'L'}

:math:U is pre-multiplied from the left.

:math:\mathrm{side} = \texttt{'R'}

:math:U is post-multiplied from the right.

**k1** : int
The value :math:k_1.

**k2** : int
The value :math:k_2.

**c** : complex, array-like, shape :math:\left(\mathrm{k2}-1\right)
:math:\mathrm{c}[\textit{k}] must hold :math:c_{\textit{k}}, the cosine of the rotation :math:P_{\textit{k}}, for :math:\textit{k} = \textit{k}_1,\ldots,\textit{k}_2-1.

**s** : float, array-like, shape :math:\left(\mathrm{k2}-1\right)
:math:\mathrm{s}[\textit{k}] must hold :math:s_{\textit{k}}, the sine of the rotation :math:P_{\textit{k}}, for :math:\textit{k} = \textit{k}_1,\ldots,\textit{k}_2-1.

**a** : complex, array-like, shape :math:\left(n, n\right)
The :math:n\times n upper triangular matrix :math:U. The imaginary parts of the diagonal elements must be zero.

**Returns**
**s** : float, ndarray, shape :math:\left(\mathrm{k2}-1\right)
:math:\mathrm{s}[\textit{k}] holds :math:h_{{\textit{k}+1,\textit{k}}}, the subdiagonal element of :math:H, for :math:\textit{k} = \textit{k}_1,\ldots,\textit{k}_2-1.

**a** : complex, ndarray, shape :math:\left(n, n\right)
The upper triangular part of the upper Hessenberg matrix :math:H.

.. _f06tv-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{side}.

Constraint: :math:\mathrm{side} = \texttt{'L'} or :math:\texttt{'R'}.

(errno :math:2)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

.. _f06tv-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

zutsrh transforms an :math:n\times n complex upper triangular matrix :math:U with real diagonal elements, to an upper Hessenberg matrix :math:H, by applying a given sequence of plane rotations from either the left or the right, in planes :math:\textit{k}_1 to :math:\textit{k}_2; :math:H has real nonzero subdiagonal elements :math:h_{{\textit{k}+1,\textit{k}}}, for :math:\textit{k} = \textit{k}_1,\ldots,\textit{k}_2-1 only.

If :math:\mathrm{side} = \texttt{'L'}, the rotations are applied from the left:

.. math::
H = PU\text{,}

where :math:P = P_{k_1}P_{{k_1+1}} \cdots P_{{k_2-1}}.

If :math:\mathrm{side} = \texttt{'R'}, the rotations are applied from the right:

.. math::
H = UP^\mathrm{H}\text{,}

where :math:P = P_{{k_2-1}} \cdots P_{{k_1+1}}P_{k_1}.

In either case, :math:P_k is a rotation in the :math:\left(k, {k+1}\right) plane.

The :math:2\times 2 plane rotation part of :math:P_k has the form

.. math::
\begin{pmatrix}\bar{c}_k&s_k\\-s_k&c_k\end{pmatrix}

with :math:s_k real.
"""
raise NotImplementedError

[docs]def zutsrs(side, k1, k2, c, s, a):
r"""
zutsrs transforms a complex upper triangular matrix to an upper spiked matrix by applying a given sequence of plane rotations.

.. _f06tw-py2-py-doc:

For full information please refer to the NAG Library document for f06tw

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06twf.html

.. _f06tw-py2-py-parameters:

**Parameters**
**side** : str, length 1
Specifies whether :math:U is operated on from the left or the right.

:math:\mathrm{side} = \texttt{'L'}

:math:U is pre-multiplied from the left.

:math:\mathrm{side} = \texttt{'R'}

:math:U is post-multiplied from the right.

**k1** : int
The value :math:k_1.

**k2** : int
The value :math:k_2.

**c** : float, array-like, shape :math:\left(\mathrm{k2}-1\right)
:math:\mathrm{c}[\textit{k}] must hold :math:c_{\textit{k}}, the cosine of the rotation :math:P_{\textit{k}}, for :math:\textit{k} = \textit{k}_1,\ldots,\textit{k}_2-1.

**s** : complex, array-like, shape :math:\left(\mathrm{k2}-1\right)
:math:\mathrm{s}[\textit{k}] must hold :math:s_{\textit{k}}, the sine of the rotation :math:P_{\textit{k}}, for :math:\textit{k} = \textit{k}_1,\ldots,\textit{k}_2-1.

**a** : complex, array-like, shape :math:\left(n, n\right)
The :math:n\times n upper triangular matrix :math:U. The imaginary parts of the diagonal elements must be zero.

**Returns**
**s** : complex, ndarray, shape :math:\left(\mathrm{k2}-1\right)
:math:\mathrm{s}[\textit{k}] holds a nonzero element of the spike of :math:H: :math:h_{{\textit{k}_2,\textit{k}}} if :math:\mathrm{side} = \texttt{'L'}, or :math:h_{{\textit{k}+1,\textit{k}_1}} if :math:\mathrm{side} = \texttt{'R'}, for :math:\textit{k} = \textit{k}_1,\ldots,\textit{k}_2-1.

**a** : complex, ndarray, shape :math:\left(n, n\right)
The upper triangular part of the upper spiked matrix :math:H. The imaginary parts of the diagonal elements are set to zero except for the :math:\left(k_2, k_2\right) element if :math:\mathrm{side} = \texttt{'L'}, or the :math:\left(k_1, k_1\right) element if :math:\mathrm{side} = \texttt{'R'}.

.. _f06tw-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{side}.

Constraint: :math:\mathrm{side} = \texttt{'L'} or :math:\texttt{'R'}.

(errno :math:2)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

.. _f06tw-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

zutsrs transforms an :math:n\times n complex upper triangular matrix :math:U with real diagonal elements, to an upper spiked matrix :math:H, by applying a given sequence of plane rotations from either the left or the right, in planes :math:k_1 to :math:k_2. :math:H has real diagonal elements except where the spike joins the diagonal.

If :math:\mathrm{side} = \texttt{'L'}, :math:H has a row spike, with nonzero elements :math:h_{{k_2,k}}, for :math:k = k_1,k_1+1,\ldots,k_2-1.
The rotations are applied from the left:

.. math::
H = PU\text{,}

where :math:P = P_{k_1}P_{{k_1+1}} \cdots P_{{k_2-1}} and :math:P_k is a rotation in the :math:\left(k, k_2\right) plane.

If :math:\mathrm{side} = \texttt{'R'}, :math:H has a column spike, with nonzero elements :math:h_{{k+1,k_1}}, for :math:k = k_1,k_1+1,\ldots,k_2-1.
The rotations are applied from the right:

.. math::
HP^\mathrm{H} = R\text{,}

where :math:P = P_{{k_2-1}} \cdots P_{{k_1+1}}P_{k_1} and :math:P_k is a rotation in the :math:\left(k_1, {k+1}\right) plane.

The :math:2\times 2 plane rotation part of :math:P_k has the form

.. math::
\begin{pmatrix}c_k&\bar{s}_k\\-s_k&c_k\end{pmatrix}

with :math:c_k real.
"""
raise NotImplementedError

[docs]def zgesrc(side, pivot, direct, m, k1, k2, c, s, a):
r"""
zgesrc applies to a complex rectangular matrix a sequence of plane rotations having real cosines and complex sines.

.. _f06tx-py2-py-doc:

For full information please refer to the NAG Library document for f06tx

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06txf.html

.. _f06tx-py2-py-parameters:

**Parameters**
**side** : str, length 1
Specifies whether :math:A is operated on from the left or the right.

:math:\mathrm{side} = \texttt{'L'}

:math:A is pre-multiplied from the left.

:math:\mathrm{side} = \texttt{'R'}

:math:A is post-multiplied from the right.

**pivot** : str, length 1
Specifies the plane rotated by :math:P_k.

:math:\mathrm{pivot} = \texttt{'V'} (variable pivot)

:math:P_k rotates the :math:\left(k, {k+1}\right) plane.

:math:\mathrm{pivot} = \texttt{'T'} (top pivot)

:math:P_k rotates the :math:\left(k_1, {k+1}\right) plane.

:math:\mathrm{pivot} = \texttt{'B'} (bottom pivot)

:math:P_k rotates the :math:\left(k, k_2\right) plane.

**direct** : str, length 1
Specifies the sequence direction.

:math:\mathrm{direct} = \texttt{'F'} (forward sequence)

:math:P = P_{{k_2-1}} \cdots P_{{k_1+1}}P_{k_1}.

:math:\mathrm{direct} = \texttt{'B'} (backward sequence)

:math:P = P_{k_1}P_{{k_1+1}} \cdots P_{{k_2-1}}.

**m** : int
:math:m, the number of rows of the matrix :math:A.

**k1** : int
The value :math:k_1.

**k2** : int
The value :math:k_2.

**c** : float, array-like, shape :math:\left(\mathrm{k2}-1\right)
:math:\mathrm{c}[\textit{k}] must hold :math:c_{\textit{k}}, the cosine of the rotation :math:P_{\textit{k}}, for :math:\textit{k} = \textit{k}_1,\ldots,\textit{k}_2-1.

**s** : complex, array-like, shape :math:\left(\mathrm{k2}-1\right)
:math:\mathrm{s}[\textit{k}] must hold :math:s_{\textit{k}}, the sine of the rotation :math:P_{\textit{k}}, for :math:\textit{k} = \textit{k}_1,\ldots,\textit{k}_2-1.

**a** : complex, array-like, shape :math:\left(\mathrm{m}, n\right)
The :math:m\times n matrix :math:A.

**Returns**
**a** : complex, ndarray, shape :math:\left(\mathrm{m}, n\right)
The transformed matrix :math:A.

.. _f06tx-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{side}.

Constraint: :math:\mathrm{side} = \texttt{'L'} or :math:\texttt{'R'}.

(errno :math:2)
On entry, error in parameter :math:\mathrm{pivot}.

Constraint: :math:\mathrm{pivot} = \texttt{'V'}, :math:\texttt{'T'} or :math:\texttt{'B'}.

(errno :math:3)
On entry, error in parameter :math:\mathrm{direct}.

Constraint: :math:\mathrm{direct} = \texttt{'F'} or :math:\texttt{'B'}.

(errno :math:4)
On entry, error in parameter :math:\mathrm{m}.

Constraint: :math:\mathrm{m}\geq 0.

(errno :math:5)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

.. _f06tx-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

zgesrc performs the transformation

.. math::

where :math:A is an :math:m\times n complex matrix and :math:P is a complex unitary matrix, defined as a sequence of complex plane rotations, :math:P_k, with real cosines, applied in planes :math:k_1 to :math:k_2.

The :math:2\times 2 plane rotation part of :math:P_k is assumed to have the form

.. math::
\begin{pmatrix}c_k&\bar{s}_k\\-s_k&c_k\end{pmatrix}

with :math:c_k real.
"""
raise NotImplementedError

[docs]def zgesrs(side, pivot, direct, m, k1, k2, c, s, a):
r"""
zgesrs applies to a complex rectangular matrix a sequence of plane rotations having real sines and complex cosines.

.. _f06ty-py2-py-doc:

For full information please refer to the NAG Library document for f06ty

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06tyf.html

.. _f06ty-py2-py-parameters:

**Parameters**
**side** : str, length 1
Specifies whether :math:A is operated on from the left or the right.

:math:\mathrm{side} = \texttt{'L'}

:math:A is pre-multiplied from the left.

:math:\mathrm{side} = \texttt{'R'}

:math:A is post-multiplied from the right.

**pivot** : str, length 1
Specifies the plane rotated by :math:P_k.

:math:\mathrm{pivot} = \texttt{'V'} (variable pivot)

:math:P_k rotates the :math:\left(k, {k+1}\right) plane.

:math:\mathrm{pivot} = \texttt{'T'} (top pivot)

:math:P_k rotates the :math:\left(k_1, {k+1}\right) plane.

:math:\mathrm{pivot} = \texttt{'B'} (bottom pivot)

:math:P_k rotates the :math:\left(k, k_2\right) plane.

**direct** : str, length 1
Specifies the sequence direction.

:math:\mathrm{direct} = \texttt{'F'} (forward sequence)

:math:P = P_{{k_2-1}} \cdots P_{{k_1+1}}P_{k_1}.

:math:\mathrm{direct} = \texttt{'B'} (backward sequence)

:math:P = P_{k_1}P_{{k_1+1}} \cdots P_{{k_2-1}}.

**m** : int
:math:m, the number of rows of the matrix :math:A.

**k1** : int
The value :math:k_1.

**k2** : int
The value :math:k_2.

**c** : complex, array-like, shape :math:\left(\mathrm{k2}-1\right)
:math:\mathrm{c}[\textit{k}] must hold :math:c_{\textit{k}}, the cosine of the rotation :math:P_{\textit{k}}, for :math:\textit{k} = \textit{k}_1,\ldots,\textit{k}_2-1.

**s** : float, array-like, shape :math:\left(\mathrm{k2}-1\right)
:math:\mathrm{s}[\textit{k}] must hold :math:s_{\textit{k}}, the sine of the rotation :math:P_{\textit{k}}, for :math:\textit{k} = \textit{k}_1,\ldots,\textit{k}_2-1.

**a** : complex, array-like, shape :math:\left(\mathrm{m}, n\right)
The :math:m\times n matrix :math:A.

**Returns**
**a** : complex, ndarray, shape :math:\left(\mathrm{m}, n\right)
The transformed matrix :math:A.

.. _f06ty-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{side}.

Constraint: :math:\mathrm{side} = \texttt{'L'} or :math:\texttt{'R'}.

(errno :math:2)
On entry, error in parameter :math:\mathrm{pivot}.

Constraint: :math:\mathrm{pivot} = \texttt{'V'}, :math:\texttt{'T'} or :math:\texttt{'B'}.

(errno :math:3)
On entry, error in parameter :math:\mathrm{direct}.

Constraint: :math:\mathrm{direct} = \texttt{'F'} or :math:\texttt{'B'}.

(errno :math:4)
On entry, error in parameter :math:\mathrm{m}.

Constraint: :math:\mathrm{m}\geq 0.

(errno :math:5)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

.. _f06ty-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

zgesrs performs the transformation

.. math::

where :math:A is an :math:m\times n complex matrix and :math:P is a complex unitary matrix, defined as a sequence of complex plane rotations, :math:P_k, with real sines, applied in planes :math:k_1 to :math:k_2.

The :math:2\times 2 plane rotation part of :math:P_k is assumed to have the form

.. math::
\begin{pmatrix}\bar{c}_k&s_k\\-s_k&c_k\end{pmatrix}

with :math:s_k real.
"""
raise NotImplementedError

[docs]def zlange(norm, m, a):
r"""
zlange returns the value of the :math:1-norm, the :math:\infty-norm, the Frobenius norm, or the maximum absolute value of the elements of a complex :math:m\times n matrix.

.. _f06ua-py2-py-doc:

For full information please refer to the NAG Library document for f06ua

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06uaf.html

.. _f06ua-py2-py-parameters:

**Parameters**
**norm** : str, length 1
Specifies the value to be returned.

:math:\mathrm{norm} = \texttt{'1'} or :math:\texttt{'O'}

The :math:1-norm.

:math:\mathrm{norm} = \texttt{'I'}

The :math:\infty-norm.

:math:\mathrm{norm} = \texttt{'F'} or :math:\texttt{'E'}

The Frobenius (or Euclidean) norm.

:math:\mathrm{norm} = \texttt{'M'}

The value :math:\mathrm{max}_{{i,j}}\left(\left\lvert a_{{ij}}\right\rvert \right) (not a norm).

**m** : int
:math:m, the number of rows of the matrix :math:A.

When :math:\mathrm{m} = 0, zlange is set to zero.

**a** : complex, array-like, shape :math:\left(\mathrm{m}, n\right)
The :math:m\times n matrix :math:A.

**Returns**
**nrm** : float
The value of the :math:1-norm, the :math:\infty-norm, the Frobenius norm, or the maximum absolute value of the elements of the complex :math:m\times n matrix.

.. _f06ua-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{norm}.

Constraint: :math:\mathrm{norm} = \texttt{'1'}, :math:\texttt{'O'}, :math:\texttt{'I'}, :math:\texttt{'F'}, :math:\texttt{'E'} or :math:\texttt{'M'}.

(errno :math:2)
On entry, error in parameter :math:\mathrm{m}.

Constraint: :math:\mathrm{m}\geq 0.

(errno :math:3)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

.. _f06ua-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.
"""
raise NotImplementedError

[docs]def zlangb(norm, kl, ku, ab):
r"""
zlangb returns the value of the :math:1-norm, the :math:\infty-norm, the Frobenius norm, or the maximum absolute value of the elements of a complex :math:n\times n band matrix.

.. _f06ub-py2-py-doc:

For full information please refer to the NAG Library document for f06ub

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06ubf.html

.. _f06ub-py2-py-parameters:

**Parameters**
**norm** : str, length 1
Specifies the value to be returned.

:math:\mathrm{norm} = \texttt{'1'} or :math:\texttt{'O'}

The :math:1-norm.

:math:\mathrm{norm} = \texttt{'I'}

The :math:\infty-norm.

:math:\mathrm{norm} = \texttt{'F'} or :math:\texttt{'E'}

The Frobenius (or Euclidean) norm.

:math:\mathrm{norm} = \texttt{'M'}

The value :math:\mathrm{max}_{{i,j}}\left(\left\lvert a_{{ij}}\right\rvert \right) (not a norm).

**kl** : int
:math:k_l, the number of subdiagonals within the band of :math:A.

**ku** : int
:math:k_u, the number of superdiagonals within the band of :math:A.

**ab** : complex, array-like, shape :math:\left(\mathrm{kl}+\mathrm{ku}+1, n\right)
The :math:n\times n band matrix :math:A.

**Returns**
**nrm** : float
The value of the :math:1-norm, the :math:\infty-norm, the Frobenius norm, or the maximum absolute value of the elements of the complex :math:n\times n band matrix.

.. _f06ub-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{norm}.

Constraint: :math:\mathrm{norm} = \texttt{'1'}, :math:\texttt{'O'}, :math:\texttt{'I'}, :math:\texttt{'F'}, :math:\texttt{'E'} or :math:\texttt{'M'}.

(errno :math:2)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

(errno :math:3)
On entry, error in parameter :math:\mathrm{kl}.

Constraint: :math:\mathrm{kl}\geq 0.

(errno :math:4)
On entry, error in parameter :math:\mathrm{ku}.

Constraint: :math:\mathrm{ku}\geq 0.

.. _f06ub-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.
"""
raise NotImplementedError

[docs]def zlanhe(norm, uplo, a):
r"""
zlanhe returns the value of the :math:1-norm, the :math:\infty-norm, the Frobenius norm, or the maximum absolute value of the elements of a complex :math:n\times n Hermitian matrix.

.. _f06uc-py2-py-doc:

For full information please refer to the NAG Library document for f06uc

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06ucf.html

.. _f06uc-py2-py-parameters:

**Parameters**
**norm** : str, length 1
Specifies the value to be returned.

:math:\mathrm{norm} = \texttt{'1'} or :math:\texttt{'O'}

The :math:1-norm.

:math:\mathrm{norm} = \texttt{'I'}

The :math:\infty-norm (= the :math:1-norm for a Hermitian matrix).

:math:\mathrm{norm} = \texttt{'F'} or :math:\texttt{'E'}

The Frobenius (or Euclidean) norm.

:math:\mathrm{norm} = \texttt{'M'}

The value :math:\mathrm{max}_{{i,j}}\left(\left\lvert a_{{ij}}\right\rvert \right) (not a norm).

**uplo** : str, length 1
Specifies whether the upper or lower triangular part of :math:A is stored.

:math:\mathrm{uplo} = \texttt{'U'}

The upper triangular part of :math:A is stored.

:math:\mathrm{uplo} = \texttt{'L'}

The lower triangular part of :math:A is stored.

**a** : complex, array-like, shape :math:\left(n, n\right)
The :math:n\times n Hermitian matrix :math:A.

**Returns**
**nrm** : float
The value of the :math:1-norm, the :math:\infty-norm, the Frobenius norm, or the maximum absolute value of the elements of the complex :math:n\times n Hermitian matrix.

.. _f06uc-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{norm}.

Constraint: :math:\mathrm{norm} = \texttt{'1'}, :math:\texttt{'O'}, :math:\texttt{'I'}, :math:\texttt{'F'}, :math:\texttt{'E'} or :math:\texttt{'M'}.

(errno :math:2)
On entry, error in parameter :math:\mathrm{uplo}.

Constraint: :math:\mathrm{uplo} = \texttt{'U'} or :math:\texttt{'L'}.

(errno :math:3)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

.. _f06uc-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.
"""
raise NotImplementedError

[docs]def zlanhp(norm, uplo, n, ap):
r"""
zlanhp returns the value of the :math:1-norm, the :math:\infty-norm, the Frobenius norm, or the maximum absolute value of the elements of a complex :math:n\times n Hermitian matrix, stored in packed form.

.. _f06ud-py2-py-doc:

For full information please refer to the NAG Library document for f06ud

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06udf.html

.. _f06ud-py2-py-parameters:

**Parameters**
**norm** : str, length 1
Specifies the value to be returned.

:math:\mathrm{norm} = \texttt{'1'} or :math:\texttt{'O'}

The :math:1-norm.

:math:\mathrm{norm} = \texttt{'I'}

The :math:\infty-norm (= the :math:1-norm for a Hermitian matrix).

:math:\mathrm{norm} = \texttt{'F'} or :math:\texttt{'E'}

The Frobenius (or Euclidean) norm.

:math:\mathrm{norm} = \texttt{'M'}

The value :math:\mathrm{max}_{{i,j}}\left(\left\lvert a_{{ij}}\right\rvert \right) (not a norm).

**uplo** : str, length 1
Specifies whether the upper or lower triangular part of :math:A is stored.

:math:\mathrm{uplo} = \texttt{'U'}

The upper triangular part of :math:A is stored.

:math:\mathrm{uplo} = \texttt{'L'}

The lower triangular part of :math:A is stored.

**n** : int
:math:n, the order of the matrix :math:A.

When :math:\mathrm{n} = 0, zlanhp returns zero.

**ap** : complex, array-like, shape :math:\left(\mathrm{n}\times \left(\mathrm{n}+1\right)/2\right)
The :math:n\times n Hermitian matrix :math:A, packed by columns.

**Returns**
**nrm** : float
The value of the :math:1-norm, the :math:\infty-norm, the Frobenius norm, or the maximum absolute value of the elements of the complex :math:n\times n Hermitian matrix, stored in packed form.

.. _f06ud-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{norm}.

Constraint: :math:\mathrm{norm} = \texttt{'1'}, :math:\texttt{'O'}, :math:\texttt{'I'}, :math:\texttt{'F'}, :math:\texttt{'E'} or :math:\texttt{'M'}.

(errno :math:2)
On entry, error in parameter :math:\mathrm{uplo}.

Constraint: :math:\mathrm{uplo} = \texttt{'U'} or :math:\texttt{'L'}.

(errno :math:3)
On entry, error in parameter :math:\mathrm{n}.

Constraint: :math:\mathrm{n}\geq 0.

.. _f06ud-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.
"""
raise NotImplementedError

[docs]def zlanhb(norm, uplo, k, ab):
r"""
zlanhb returns the value of the :math:1-norm, the :math:\infty-norm, the Frobenius norm, or the maximum absolute value of the elements of a complex :math:n\times n Hermitian band matrix.

.. _f06ue-py2-py-doc:

For full information please refer to the NAG Library document for f06ue

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06uef.html

.. _f06ue-py2-py-parameters:

**Parameters**
**norm** : str, length 1
Specifies the value to be returned.

:math:\mathrm{norm} = \texttt{'1'} or :math:\texttt{'O'}

The :math:1-norm.

:math:\mathrm{norm} = \texttt{'I'}

The :math:\infty-norm (= the :math:1-norm for a Hermitian matrix).

:math:\mathrm{norm} = \texttt{'F'} or :math:\texttt{'E'}

The Frobenius (or Euclidean) norm.

:math:\mathrm{norm} = \texttt{'M'}

The value :math:\mathrm{max}_{{i,j}}\left(\left\lvert a_{{ij}}\right\rvert \right) (not a norm).

**uplo** : str, length 1
Specifies whether the upper or lower triangular part of :math:A is stored.

:math:\mathrm{uplo} = \texttt{'U'}

The upper triangular part of :math:A is stored.

:math:\mathrm{uplo} = \texttt{'L'}

The lower triangular part of :math:A is stored.

**k** : int
:math:k, the number of subdiagonals or superdiagonals of the matrix :math:A.

**ab** : complex, array-like, shape :math:\left(\mathrm{k}+1, n\right)
The :math:n\times n Hermitian band matrix :math:A.

**Returns**
**nrm** : float
The value of the :math:1-norm, the :math:\infty-norm, the Frobenius norm, or the maximum absolute value of the elements of the complex :math:n\times n Hermitian band matrix.

.. _f06ue-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{norm}.

Constraint: :math:\mathrm{norm} = \texttt{'1'}, :math:\texttt{'O'}, :math:\texttt{'I'}, :math:\texttt{'F'}, :math:\texttt{'E'} or :math:\texttt{'M'}.

(errno :math:2)
On entry, error in parameter :math:\mathrm{uplo}.

Constraint: :math:\mathrm{uplo} = \texttt{'U'} or :math:\texttt{'L'}.

(errno :math:3)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

(errno :math:4)
On entry, error in parameter :math:\mathrm{k}.

Constraint: :math:\mathrm{k}\geq 0.

.. _f06ue-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.
"""
raise NotImplementedError

[docs]def zlansy(norm, uplo, a):
r"""
zlansy returns the value of the :math:1-norm, the :math:\infty-norm, the Frobenius norm, or the maximum absolute value of the elements of a complex :math:n\times n symmetric matrix.

.. _f06uf-py2-py-doc:

For full information please refer to the NAG Library document for f06uf

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06uff.html

.. _f06uf-py2-py-parameters:

**Parameters**
**norm** : str, length 1
Specifies the value to be returned.

:math:\mathrm{norm} = \texttt{'1'} or :math:\texttt{'O'}

The :math:1-norm.

:math:\mathrm{norm} = \texttt{'I'}

The :math:\infty-norm (= the :math:1-norm for a symmetric matrix).

:math:\mathrm{norm} = \texttt{'F'} or :math:\texttt{'E'}

The Frobenius (or Euclidean) norm.

:math:\mathrm{norm} = \texttt{'M'}

The value :math:\mathrm{max}_{{i,j}}\left(\left\lvert a_{{ij}}\right\rvert \right) (not a norm).

**uplo** : str, length 1
Specifies whether the upper or lower triangular part of :math:A is stored.

:math:\mathrm{uplo} = \texttt{'U'}

The upper triangular part of :math:A is stored.

:math:\mathrm{uplo} = \texttt{'L'}

The lower triangular part of :math:A is stored.

**a** : complex, array-like, shape :math:\left(n, n\right)
The :math:n\times n symmetric matrix :math:A.

**Returns**
**nrm** : float
The value of the :math:1-norm, the :math:\infty-norm, the Frobenius norm, or the maximum absolute value of the elements of the complex :math:n\times n symmetric matrix.

.. _f06uf-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{norm}.

Constraint: :math:\mathrm{norm} = \texttt{'1'}, :math:\texttt{'O'}, :math:\texttt{'I'}, :math:\texttt{'F'}, :math:\texttt{'E'} or :math:\texttt{'M'}.

(errno :math:2)
On entry, error in parameter :math:\mathrm{uplo}.

Constraint: :math:\mathrm{uplo} = \texttt{'U'} or :math:\texttt{'L'}.

(errno :math:3)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

.. _f06uf-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.
"""
raise NotImplementedError

[docs]def zlansp(norm, uplo, n, ap):
r"""
zlansp returns the value of the :math:1-norm, the :math:\infty-norm, the Frobenius norm, or the maximum absolute value of the elements of a complex :math:n\times n symmetric matrix, stored in packed form.

.. _f06ug-py2-py-doc:

For full information please refer to the NAG Library document for f06ug

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06ugf.html

.. _f06ug-py2-py-parameters:

**Parameters**
**norm** : str, length 1
Specifies the value to be returned.

:math:\mathrm{norm} = \texttt{'1'} or :math:\texttt{'O'}

The :math:1-norm.

:math:\mathrm{norm} = \texttt{'I'}

The :math:\infty-norm (= the :math:1-norm for a symmetric matrix).

:math:\mathrm{norm} = \texttt{'F'} or :math:\texttt{'E'}

The Frobenius (or Euclidean) norm.

:math:\mathrm{norm} = \texttt{'M'}

The value :math:\mathrm{max}_{{i,j}}\left(\left\lvert a_{{ij}}\right\rvert \right) (not a norm).

**uplo** : str, length 1
Specifies whether the upper or lower triangular part of :math:A is stored.

:math:\mathrm{uplo} = \texttt{'U'}

The upper triangular part of :math:A is stored.

:math:\mathrm{uplo} = \texttt{'L'}

The lower triangular part of :math:A is stored.

**n** : int
:math:n, the order of the matrix :math:A.

When :math:\mathrm{n} = 0, zlansp returns zero.

**ap** : complex, array-like, shape :math:\left(\mathrm{n}\times \left(\mathrm{n}+1\right)/2\right)
The :math:n\times n symmetric matrix :math:A, packed by columns.

**Returns**
**nrm** : float
The value of the :math:1-norm, the :math:\infty-norm, the Frobenius norm, or the maximum absolute value of the elements of the complex :math:n\times n symmetric matrix, stored in packed form.

.. _f06ug-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{norm}.

Constraint: :math:\mathrm{norm} = \texttt{'1'}, :math:\texttt{'O'}, :math:\texttt{'I'}, :math:\texttt{'F'}, :math:\texttt{'E'} or :math:\texttt{'M'}.

(errno :math:2)
On entry, error in parameter :math:\mathrm{uplo}.

Constraint: :math:\mathrm{uplo} = \texttt{'U'} or :math:\texttt{'L'}.

(errno :math:3)
On entry, error in parameter :math:\mathrm{n}.

Constraint: :math:\mathrm{n}\geq 0.

.. _f06ug-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.
"""
raise NotImplementedError

[docs]def zlansb(norm, uplo, k, ab):
r"""
zlansb returns the value of the :math:1-norm, the :math:\infty-norm, the Frobenius norm, or the maximum absolute value of the elements of a complex :math:n\times n symmetric band matrix.

.. _f06uh-py2-py-doc:

For full information please refer to the NAG Library document for f06uh

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06uhf.html

.. _f06uh-py2-py-parameters:

**Parameters**
**norm** : str, length 1
Specifies the value to be returned.

:math:\mathrm{norm} = \texttt{'1'} or :math:\texttt{'O'}

The :math:1-norm.

:math:\mathrm{norm} = \texttt{'I'}

The :math:\infty-norm (= the :math:1-norm for a symmetric matrix).

:math:\mathrm{norm} = \texttt{'F'} or :math:\texttt{'E'}

The Frobenius (or Euclidean) norm.

:math:\mathrm{norm} = \texttt{'M'}

The value :math:\mathrm{max}_{{i,j}}\left(\left\lvert a_{{ij}}\right\rvert \right) (not a norm).

**uplo** : str, length 1
Specifies whether the upper or lower triangular part of :math:A is stored.

:math:\mathrm{uplo} = \texttt{'U'}

The upper triangular part of :math:A is stored.

:math:\mathrm{uplo} = \texttt{'L'}

The lower triangular part of :math:A is stored.

**k** : int
:math:k, the number of subdiagonals or superdiagonals of the matrix :math:A.

**ab** : complex, array-like, shape :math:\left(\mathrm{k}+1, n\right)
The :math:n\times n symmetric band matrix :math:A.

**Returns**
**nrm** : float
The value of the :math:1-norm, the :math:\infty-norm, the Frobenius norm, or the maximum absolute value of the elements of the complex :math:n\times n symmetric band matrix.

.. _f06uh-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{norm}.

Constraint: :math:\mathrm{norm} = \texttt{'1'}, :math:\texttt{'O'}, :math:\texttt{'I'}, :math:\texttt{'F'}, :math:\texttt{'E'} or :math:\texttt{'M'}.

(errno :math:2)
On entry, error in parameter :math:\mathrm{uplo}.

Constraint: :math:\mathrm{uplo} = \texttt{'U'} or :math:\texttt{'L'}.

(errno :math:3)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

(errno :math:4)
On entry, error in parameter :math:\mathrm{k}.

Constraint: :math:\mathrm{k}\geq 0.

.. _f06uh-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.
"""
raise NotImplementedError

[docs]def zlantr(norm, uplo, diag, m, a):
r"""
zlantr returns the value of the :math:1-norm, the :math:\infty-norm, the Frobenius norm, or the maximum absolute value of the elements of a complex :math:m\times n trapezoidal matrix (triangular if :math:m = n).

.. _f06uj-py2-py-doc:

For full information please refer to the NAG Library document for f06uj

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06ujf.html

.. _f06uj-py2-py-parameters:

**Parameters**
**norm** : str, length 1
Specifies the value to be returned.

:math:\mathrm{norm} = \texttt{'1'} or :math:\texttt{'O'}

The :math:1-norm.

:math:\mathrm{norm} = \texttt{'I'}

The :math:\infty-norm.

:math:\mathrm{norm} = \texttt{'F'} or :math:\texttt{'E'}

The Frobenius (or Euclidean) norm.

:math:\mathrm{norm} = \texttt{'M'}

The value :math:\mathrm{max}_{{i,j}}\left(\left\lvert a_{{ij}}\right\rvert \right) (not a norm).

**uplo** : str, length 1
Specifies whether :math:A is upper or lower trapezoidal.

:math:\mathrm{uplo} = \texttt{'U'}

:math:A is upper trapezoidal.

:math:\mathrm{uplo} = \texttt{'L'}

:math:A is lower trapezoidal.

**diag** : str, length 1
Specifies whether :math:A has nonunit or unit diagonal elements.

:math:\mathrm{diag} = \texttt{'N'}

The diagonal elements are stored explicitly.

:math:\mathrm{diag} = \texttt{'U'}

The diagonal elements are assumed to be :math:1, and are not referenced.

**m** : int
:math:m, the number of rows of the matrix :math:A.

When :math:\mathrm{m} = 0, zlantr is set to zero.

**a** : complex, array-like, shape :math:\left(\mathrm{m}, n\right)
The :math:m\times n trapezoidal matrix :math:A.

**Returns**
**nrm** : float
The value of the :math:1-norm, the :math:\infty-norm, the Frobenius norm, or the maximum absolute value of the elements of the complex :math:m\times n trapezoidal matrix (triangular if :math:m = n).

.. _f06uj-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{norm}.

Constraint: :math:\mathrm{norm} = \texttt{'1'}, :math:\texttt{'O'}, :math:\texttt{'I'}, :math:\texttt{'F'}, :math:\texttt{'E'} or :math:\texttt{'M'}.

(errno :math:2)
On entry, error in parameter :math:\mathrm{uplo}.

Constraint: :math:\mathrm{uplo} = \texttt{'U'} or :math:\texttt{'L'}.

(errno :math:3)
On entry, error in parameter :math:\mathrm{diag}.

Constraint: :math:\mathrm{diag} = \texttt{'N'} or :math:\texttt{'U'}.

(errno :math:4)
On entry, error in parameter :math:\mathrm{m}.

Constraint: :math:\mathrm{m}\geq 0.

(errno :math:5)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

.. _f06uj-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.
"""
raise NotImplementedError

[docs]def zlantp(norm, uplo, diag, n, ap):
r"""
zlantp returns the value of the :math:1-norm, the :math:\infty-norm, the Frobenius norm, or the maximum absolute value of the elements of a complex :math:n\times n triangular matrix, stored in packed form.

.. _f06uk-py2-py-doc:

For full information please refer to the NAG Library document for f06uk

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06ukf.html

.. _f06uk-py2-py-parameters:

**Parameters**
**norm** : str, length 1
Specifies the value to be returned.

:math:\mathrm{norm} = \texttt{'1'} or :math:\texttt{'O'}

The :math:1-norm.

:math:\mathrm{norm} = \texttt{'I'}

The :math:\infty-norm.

:math:\mathrm{norm} = \texttt{'F'} or :math:\texttt{'E'}

The Frobenius (or Euclidean) norm.

:math:\mathrm{norm} = \texttt{'M'}

The value :math:\mathrm{max}_{{i,j}}\left(\left\lvert a_{{ij}}\right\rvert \right) (not a norm).

**uplo** : str, length 1
Specifies whether :math:A is upper or lower triangular.

:math:\mathrm{uplo} = \texttt{'U'}

:math:A is upper triangular.

:math:\mathrm{uplo} = \texttt{'L'}

:math:A is lower triangular.

**diag** : str, length 1
Specifies whether :math:A has nonunit or unit diagonal elements.

:math:\mathrm{diag} = \texttt{'N'}

The diagonal elements are stored explicitly.

:math:\mathrm{diag} = \texttt{'U'}

The diagonal elements are assumed to be :math:1, and are not referenced.

**n** : int
:math:n, the order of the matrix :math:A.

When :math:\mathrm{n} = 0, zlantp returns zero.

**ap** : complex, array-like, shape :math:\left(\mathrm{n}\times \left(\mathrm{n}+1\right)/2\right)
The :math:n\times n triangular matrix :math:A, packed by columns.

**Returns**
**nrm** : float
The value of the :math:1-norm, the :math:\infty-norm, the Frobenius norm, or the maximum absolute value of the elements of the complex :math:n\times n triangular matrix, stored in packed form.

.. _f06uk-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{norm}.

Constraint: :math:\mathrm{norm} = \texttt{'1'}, :math:\texttt{'O'}, :math:\texttt{'I'}, :math:\texttt{'F'}, :math:\texttt{'E'} or :math:\texttt{'M'}.

(errno :math:2)
On entry, error in parameter :math:\mathrm{uplo}.

Constraint: :math:\mathrm{uplo} = \texttt{'U'} or :math:\texttt{'L'}.

(errno :math:3)
On entry, error in parameter :math:\mathrm{diag}.

Constraint: :math:\mathrm{diag} = \texttt{'N'} or :math:\texttt{'U'}.

(errno :math:4)
On entry, error in parameter :math:\mathrm{n}.

Constraint: :math:\mathrm{n}\geq 0.

.. _f06uk-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.
"""
raise NotImplementedError

[docs]def zlantb(norm, uplo, diag, k, ab):
r"""
zlantb returns the value of the :math:1-norm, the :math:\infty-norm, the Frobenius norm, or the maximum absolute value of the elements of a complex :math:n\times n triangular band matrix.

.. _f06ul-py2-py-doc:

For full information please refer to the NAG Library document for f06ul

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06ulf.html

.. _f06ul-py2-py-parameters:

**Parameters**
**norm** : str, length 1
Specifies the value to be returned.

:math:\mathrm{norm} = \texttt{'1'} or :math:\texttt{'O'}

The :math:1-norm.

:math:\mathrm{norm} = \texttt{'I'}

The :math:\infty-norm.

:math:\mathrm{norm} = \texttt{'F'} or :math:\texttt{'E'}

The Frobenius (or Euclidean) norm.

:math:\mathrm{norm} = \texttt{'M'}

The value :math:\mathrm{max}_{{i,j}}\left(\left\lvert a_{{ij}}\right\rvert \right) (not a norm).

**uplo** : str, length 1
Specifies whether :math:A is upper or lower triangular.

:math:\mathrm{uplo} = \texttt{'U'}

:math:A is upper triangular.

:math:\mathrm{uplo} = \texttt{'L'}

:math:A is lower triangular.

**diag** : str, length 1
Specifies whether :math:A has nonunit or unit diagonal elements.

:math:\mathrm{diag} = \texttt{'N'}

The diagonal elements are stored explicitly.

:math:\mathrm{diag} = \texttt{'U'}

The diagonal elements are assumed to be :math:1, and are not referenced.

**k** : int
:math:k, the number of subdiagonals or superdiagonals of the matrix :math:A.

**ab** : complex, array-like, shape :math:\left(\mathrm{k}+1, n\right)
The :math:n\times n triangular band matrix :math:A

**Returns**
**nrm** : float
The value of the :math:1-norm, the :math:\infty-norm, the Frobenius norm, or the maximum absolute value of the elements of the complex :math:n\times n triangular band matrix.

.. _f06ul-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{norm}.

Constraint: :math:\mathrm{norm} = \texttt{'1'}, :math:\texttt{'O'}, :math:\texttt{'I'}, :math:\texttt{'F'}, :math:\texttt{'E'} or :math:\texttt{'M'}.

(errno :math:2)
On entry, error in parameter :math:\mathrm{uplo}.

Constraint: :math:\mathrm{uplo} = \texttt{'U'} or :math:\texttt{'L'}.

(errno :math:3)
On entry, error in parameter :math:\mathrm{diag}.

Constraint: :math:\mathrm{diag} = \texttt{'N'} or :math:\texttt{'U'}.

(errno :math:4)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

(errno :math:5)
On entry, error in parameter :math:\mathrm{k}.

Constraint: :math:\mathrm{k}\geq 0.

.. _f06ul-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.
"""
raise NotImplementedError

[docs]def zlanhs(norm, a):
r"""
zlanhs returns the value of the :math:1-norm, the :math:\infty-norm, the Frobenius norm, or the maximum absolute value of the elements of a complex :math:n\times n upper Hessenberg matrix.

.. _f06um-py2-py-doc:

For full information please refer to the NAG Library document for f06um

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06umf.html

.. _f06um-py2-py-parameters:

**Parameters**
**norm** : str, length 1
Specifies the value to be returned.

:math:\mathrm{norm} = \texttt{'1'} or :math:\texttt{'O'}

The :math:1-norm.

:math:\mathrm{norm} = \texttt{'I'}

The :math:\infty-norm.

:math:\mathrm{norm} = \texttt{'F'} or :math:\texttt{'E'}

The Frobenius (or Euclidean) norm.

:math:\mathrm{norm} = \texttt{'M'}

The value :math:\mathrm{max}_{{i,j}}\left(\left\lvert a_{{ij}}\right\rvert \right) (not a norm).

**a** : complex, array-like, shape :math:\left(n, n\right)
The :math:n\times n upper Hessenberg matrix :math:A; elements of the array below the first subdiagonal are not referenced.

**Returns**
**nrm** : float
The value of the :math:1-norm, the :math:\infty-norm, the Frobenius norm, or the maximum absolute value of the elements of the complex :math:n\times n upper Hessenberg matrix.

.. _f06um-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{norm}.

Constraint: :math:\mathrm{norm} = \texttt{'1'}, :math:\texttt{'O'}, :math:\texttt{'I'}, :math:\texttt{'F'}, :math:\texttt{'E'} or :math:\texttt{'M'}.

(errno :math:2)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

.. _f06um-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.
"""
raise NotImplementedError

[docs]def zlangt(norm, dl, d, du):
r"""
zlangt returns the value of the :math:1-norm, the :math:\infty-norm, the Frobenius norm, or the maximum absolute value of the elements of a complex :math:n\times n tridiagonal matrix :math:A.

.. _f06un-py2-py-doc:

For full information please refer to the NAG Library document for f06un

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06unf.html

.. _f06un-py2-py-parameters:

**Parameters**
**norm** : str, length 1
Specifies the value to be returned.

:math:\mathrm{norm} = \texttt{'1'} or :math:\texttt{'O'}

The :math:1-norm.

:math:\mathrm{norm} = \texttt{'I'}

The :math:\infty-norm.

:math:\mathrm{norm} = \texttt{'F'} or :math:\texttt{'E'}

The Frobenius (or Euclidean) norm.

:math:\mathrm{norm} = \texttt{'M'}

The value :math:\mathrm{max}_{{i,j}}\left(\left\lvert a_{{ij}}\right\rvert \right) (not a norm).

**dl** : complex, array-like, shape :math:\left(n-1\right)
The (:math:n-1) subdiagonal elements of :math:A.

**d** : complex, array-like, shape :math:\left(n\right)
The :math:n diagonal elements of :math:A.

**du** : complex, array-like, shape :math:\left(n-1\right)
The (:math:n-1) superdiagonal elements of :math:A.

**Returns**
**nrm** : float
The value of the :math:1-norm, the :math:\infty-norm, the Frobenius norm, or the maximum absolute value of the elements of the complex :math:n\times n tridiagonal matrix :math:A.

.. _f06un-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{norm}.

Constraint: :math:\mathrm{norm} = \texttt{'1'}, :math:\texttt{'O'}, :math:\texttt{'I'}, :math:\texttt{'F'}, :math:\texttt{'E'} or :math:\texttt{'M'}.

(errno :math:2)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

.. _f06un-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.
"""
raise NotImplementedError

[docs]def zlanht(norm, d, e):
r"""
zlanht returns the value of the :math:1-norm, the :math:\infty-norm, the Frobenius norm, or the maximum absolute value of the elements of a complex :math:n\times n Hermitian tridiagonal matrix :math:A.

.. _f06up-py2-py-doc:

For full information please refer to the NAG Library document for f06up

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06upf.html

.. _f06up-py2-py-parameters:

**Parameters**
**norm** : str, length 1
Specifies the value to be returned.

:math:\mathrm{norm} = \texttt{'1'} or :math:\texttt{'O'}

The :math:1-norm.

:math:\mathrm{norm} = \texttt{'I'}

The :math:\infty-norm.

:math:\mathrm{norm} = \texttt{'F'} or :math:\texttt{'E'}

The Frobenius (or Euclidean) norm.

:math:\mathrm{norm} = \texttt{'M'}

The value :math:\mathrm{max}_{{i,j}}\left(\left\lvert a_{{ij}}\right\rvert \right) (not a norm).

**d** : float, array-like, shape :math:\left(n\right)
The :math:n diagonal elements of the tridiagonal matrix :math:A.

**e** : complex, array-like, shape :math:\left(n-1\right)
The (:math:n-1) subdiagonal or superdiagonal elements of the tridiagonal matrix :math:A.

**Returns**
**nrm** : float
The value of the :math:1-norm, the :math:\infty-norm, the Frobenius norm, or the maximum absolute value of the elements of the complex :math:n\times n Hermitian tridiagonal matrix :math:A.

.. _f06up-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{norm}.

Constraint: :math:\mathrm{norm} = \texttt{'1'}, :math:\texttt{'O'}, :math:\texttt{'I'}, :math:\texttt{'F'}, :math:\texttt{'E'} or :math:\texttt{'M'}.

(errno :math:2)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

.. _f06up-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.
"""
raise NotImplementedError

[docs]def zgeap(side, trans, perm, k, b):
r"""
zgeap permutes the rows or columns of a complex rectangular matrix using an int array of permutations.

.. _f06vj-py2-py-doc:

For full information please refer to the NAG Library document for f06vj

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06vjf.html

.. _f06vj-py2-py-parameters:

**Parameters**
**side** : str, length 1
Specifies the operation to be performed.

:math:\mathrm{side} = \texttt{'L'} and :math:\mathrm{trans} = \texttt{'T'}

:math:B←P^\mathrm{T}B.

:math:\mathrm{side} = \texttt{'L'} and :math:\mathrm{trans} = \texttt{'N'}

:math:B←PB.

:math:\mathrm{side} = \texttt{'R'} and :math:\mathrm{trans} = \texttt{'T'}

:math:B←BP^\mathrm{T}.

:math:\mathrm{side} = \texttt{'R'} and :math:\mathrm{trans} = \texttt{'N'}

:math:B←BP.

**trans** : str, length 1
Specifies the operation to be performed.

:math:\mathrm{side} = \texttt{'L'} and :math:\mathrm{trans} = \texttt{'T'}

:math:B←P^\mathrm{T}B.

:math:\mathrm{side} = \texttt{'L'} and :math:\mathrm{trans} = \texttt{'N'}

:math:B←PB.

:math:\mathrm{side} = \texttt{'R'} and :math:\mathrm{trans} = \texttt{'T'}

:math:B←BP^\mathrm{T}.

:math:\mathrm{side} = \texttt{'R'} and :math:\mathrm{trans} = \texttt{'N'}

:math:B←BP.

**perm** : int, array-like, shape :math:\left(n\right)
The :math:n indices :math:p_i which define the interchanges in the representation of :math:P. It is usual to have :math:p_i\geq i, but this is not necessary.

**k** : int
:math:k, the number of columns of :math:B if :math:\mathrm{side} = \texttt{'L'}, or the number of rows of :math:B if :math:\mathrm{side} = \texttt{'R'}.

**b** : complex, array-like, shape :math:\left(:, :\right)
Note: the required extent for this argument in dimension 1 is determined as follows: if :math:\mathrm{side}=\texttt{'L'}: :math:\max\left(n,\textit{m}\right); if :math:\mathrm{side}=\texttt{'R'}: :math:\mathrm{k}; otherwise: :math:0.

Note: the required extent for this argument in dimension 2 is determined as follows: if :math:\mathrm{side}=\texttt{'L'}: :math:\mathrm{k}; if :math:\mathrm{side}=\texttt{'R'}: :math:\max\left(n,\max\left(\mathrm{perm}\right)\right); otherwise: :math:0.

The original matrix :math:B; :math:B is :math:\textit{m}\times k if :math:\mathrm{side} = \texttt{'L'}, or :math:k\times \textit{m} if :math:\mathrm{side} = \texttt{'R'}.

**Returns**
**b** : complex, ndarray, shape :math:\left(:, :\right)
The permuted matrix :math:B.

.. _f06vj-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:2)
On entry, error in parameter :math:\mathrm{trans}.

Constraint: :math:\mathrm{side} = \texttt{'L'} or :math:\texttt{'R'}.

(errno :math:2)
On entry, error in parameter :math:\mathrm{trans}.

Constraint: :math:\mathrm{trans} = \texttt{'N'} or :math:\texttt{'T'}.

(errno :math:3)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

(errno :math:4)
On entry, error in parameter :math:\mathrm{perm}.

Constraint: :math:1\leq \mathrm{perm}[i-1]\leq \textit{m}.

(errno :math:5)
On entry, error in parameter :math:\mathrm{k}.

Constraint: :math:\mathrm{k}\geq 0.

.. _f06vj-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

zgeap performs one of the permutation operations

.. math::

where :math:B is a complex matrix, and :math:P is a permutation matrix.

:math:P is represented in the form

.. math::
P = P_{{1,p_1}}P_{{2,p_2}} \cdots P_{{n,p_n}}\text{,}

where :math:P_{{i,j}} is the permutation matrix that interchanges items :math:i and :math:j; that is, :math:P_{{i,j}} is the unit matrix with rows and columns :math:i and :math:j interchanged.
If :math:i = j, :math:P_{{i,j}} = I.

Let :math:\textit{m} denote the number of rows of :math:B if :math:\mathrm{side} = \texttt{'L'}, or the number of columns of :math:B if :math:\mathrm{side} = \texttt{'R'}: the function does not require :math:\textit{m} to be passed as an argument, but assumes that :math:\textit{m}\geq p_{\textit{i}}, for :math:\textit{i} = 1,2,\ldots,n.

This function requires the indices :math:p_i to be supplied in an int array; :meth:zgeapr performs the same operation with the indices supplied in a float array.
"""
raise NotImplementedError

[docs]def zgeapr(side, trans, perm, k, b):
r"""
zgeapr permutes the rows or columns of a complex rectangular matrix using a float array of permutations.

.. _f06vk-py2-py-doc:

For full information please refer to the NAG Library document for f06vk

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06vkf.html

.. _f06vk-py2-py-parameters:

**Parameters**
**side** : str, length 1
Specifies the operation to be performed.

:math:\mathrm{side} = \texttt{'L'} and :math:\mathrm{trans} = \texttt{'T'}

:math:B←P^\mathrm{T}B.

:math:\mathrm{side} = \texttt{'L'} and :math:\mathrm{trans} = \texttt{'N'}

:math:B←PB.

:math:\mathrm{side} = \texttt{'R'} and :math:\mathrm{trans} = \texttt{'T'}

:math:B←BP^\mathrm{T}.

:math:\mathrm{side} = \texttt{'R'} and :math:\mathrm{trans} = \texttt{'N'}

:math:B←BP.

**trans** : str, length 1
Specifies the operation to be performed.

:math:\mathrm{side} = \texttt{'L'} and :math:\mathrm{trans} = \texttt{'T'}

:math:B←P^\mathrm{T}B.

:math:\mathrm{side} = \texttt{'L'} and :math:\mathrm{trans} = \texttt{'N'}

:math:B←PB.

:math:\mathrm{side} = \texttt{'R'} and :math:\mathrm{trans} = \texttt{'T'}

:math:B←BP^\mathrm{T}.

:math:\mathrm{side} = \texttt{'R'} and :math:\mathrm{trans} = \texttt{'N'}

:math:B←BP.

**perm** : float, array-like, shape :math:\left(n\right)
The :math:n indices :math:p_i which define the interchanges in the representation of :math:P. It is usual to have :math:p_i\geq i, but this is not necessary.

**k** : int
:math:k, the number of columns of :math:B if :math:\mathrm{side} = \texttt{'L'}, or the number of rows of :math:B if :math:\mathrm{side} = \texttt{'R'}.

**b** : complex, array-like, shape :math:\left(:, :\right)
Note: the required extent for this argument in dimension 1 is determined as follows: if :math:\mathrm{side}=\texttt{'L'}: :math:\max\left(n,\textit{m}\right); if :math:\mathrm{side}=\texttt{'R'}: :math:\mathrm{k}; otherwise: :math:0.

Note: the required extent for this argument in dimension 2 is determined as follows: if :math:\mathrm{side}=\texttt{'L'}: :math:\mathrm{k}; if :math:\mathrm{side}=\texttt{'R'}: :math:\max\left(n,\mathrm{int}\left(\max\left(\mathrm{perm}\right)\right)\right); otherwise: :math:0.

The original matrix :math:B; :math:B is :math:\textit{m}\times k if :math:\mathrm{side} = \texttt{'L'}, or :math:k\times \textit{m} if :math:\mathrm{side} = \texttt{'R'}.

**Returns**
**b** : complex, ndarray, shape :math:\left(:, :\right)
The permuted matrix :math:B.

.. _f06vk-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:2)
On entry, error in parameter :math:\mathrm{trans}.

Constraint: :math:\mathrm{side} = \texttt{'L'} or :math:\texttt{'R'}.

(errno :math:2)
On entry, error in parameter :math:\mathrm{trans}.

Constraint: :math:\mathrm{trans} = \texttt{'N'} or :math:\texttt{'T'}.

(errno :math:3)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

(errno :math:4)
On entry, error in parameter :math:\mathrm{perm}.

Constraint: :math:1\leq \mathrm{perm}[i-1]\leq \textit{m}.

(errno :math:5)
On entry, error in parameter :math:\mathrm{k}.

Constraint: :math:\mathrm{k}\geq 0.

.. _f06vk-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

zgeapr performs one of the permutation operations

.. math::

where :math:B is a complex matrix, and :math:P is a permutation matrix.

:math:P is represented in the form

.. math::
P = P_{{1,p_1}}P_{{2,p_2}} \cdots P_{{n,p_n}}\text{,}

where :math:P_{{i,j}} is the permutation matrix that interchanges items :math:i and :math:j; that is, :math:P_{{i,j}} is the unit matrix with rows and columns :math:i and :math:j interchanged.
If :math:i = j, :math:P_{{i,j}} = I.

Let :math:\textit{m} denote the number of rows of :math:B if :math:\mathrm{side} = \texttt{'L'}, or the number of columns of :math:B if :math:\mathrm{side} = \texttt{'R'}: the function does not require :math:\textit{m} to be passed as an argument, but assumes that :math:\textit{m}\geq p_{\textit{i}}, for :math:\textit{i} = 1,2,\ldots,n.

This function requires the indices :math:p_i to be supplied in a float array (the function takes the integer part of the array elements); :meth:zgeap performs the same operation with the indices supplied in an int array.
"""
raise NotImplementedError

[docs]def zsgesr(side, pivot, direct, m, k1, k2, c, s, a):
r"""
zsgesr applies to a complex rectangular matrix a sequence of plane rotations having real cosines and complex sines.

.. _f06vx-py2-py-doc:

For full information please refer to the NAG Library document for f06vx

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06vxf.html

.. _f06vx-py2-py-parameters:

**Parameters**
**side** : str, length 1
Specifies whether :math:A is operated on from the left or the right.

:math:\mathrm{side} = \texttt{'L'}

:math:A is pre-multiplied from the left.

:math:\mathrm{side} = \texttt{'R'}

:math:A is post-multiplied from the right.

**pivot** : str, length 1
Specifies the plane rotated by :math:P_k.

:math:\mathrm{pivot} = \texttt{'V'} (variable pivot)

:math:P_k rotates the :math:\left(k, {k+1}\right) plane.

:math:\mathrm{pivot} = \texttt{'T'} (top pivot)

:math:P_k rotates the :math:\left(k_1, {k+1}\right) plane.

:math:\mathrm{pivot} = \texttt{'B'} (bottom pivot)

:math:P_k rotates the :math:\left(k, k_2\right) plane.

**direct** : str, length 1
Specifies the sequence direction.

:math:\mathrm{direct} = \texttt{'F'} (forward sequence)

:math:P = P_{{k_2-1}} \cdots P_{{k_1+1}}P_{k_1}.

:math:\mathrm{direct} = \texttt{'B'} (backward sequence)

:math:P = P_{k_1}P_{{k_1+1}} \cdots P_{{k_2-1}}.

**m** : int
:math:m, the number of rows of the matrix :math:A.

**k1** : int
The value :math:k_1.

**k2** : int
The value :math:k_2.

**c** : float, array-like, shape :math:\left(\mathrm{k2}-1\right)
:math:\mathrm{c}[\textit{k}] must hold :math:c_{\textit{k}}, the cosine of the rotation :math:P_{\textit{k}}, for :math:\textit{k} = \textit{k}_1,\ldots,\textit{k}_2-1.

**s** : float, array-like, shape :math:\left(\mathrm{k2}-1\right)
:math:\mathrm{s}[\textit{k}] must hold :math:s_{\textit{k}}, the sine of the rotation :math:P_{\textit{k}}, for :math:\textit{k} = \textit{k}_1,\ldots,\textit{k}_2-1.

**a** : complex, array-like, shape :math:\left(\mathrm{m}, n\right)
The :math:m\times n matrix :math:A.

**Returns**
**a** : complex, ndarray, shape :math:\left(\mathrm{m}, n\right)
The transformed matrix :math:A.

.. _f06vx-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{side}.

Constraint: :math:\mathrm{side} = \texttt{'L'} or :math:\texttt{'R'}.

(errno :math:2)
On entry, error in parameter :math:\mathrm{pivot}.

Constraint: :math:\mathrm{pivot} = \texttt{'V'}, :math:\texttt{'T'} or :math:\texttt{'B'}.

(errno :math:3)
On entry, error in parameter :math:\mathrm{direct}.

Constraint: :math:\mathrm{direct} = \texttt{'F'} or :math:\texttt{'B'}.

(errno :math:4)
On entry, error in parameter :math:\mathrm{m}.

Constraint: :math:\mathrm{m}\geq 0.

(errno :math:5)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

.. _f06vx-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

zsgesr performs the transformation

.. math::

where :math:A is an :math:m\times n complex matrix and :math:P is a real orthogonal matrix, defined as a sequence of real plane rotations, :math:P_k, applied in planes :math:k_1 to :math:k_2.

The :math:2\times 2 plane rotation part of :math:P_k is assumed to have the form

.. math::
\begin{pmatrix}c_k&s_k\\-s_k&c_k\end{pmatrix}

with :math:c_k and :math:s_k real.
"""
raise NotImplementedError

[docs]def dlansf(norm, transr, uplo, n, a):
r"""
dlansf returns the value of the :math:1-norm, the :math:\infty-norm, the Frobenius norm, or the maximum absolute value of the elements of a real symmetric matrix :math:A stored in Rectangular Full Packed (RFP) format.

.. _f06wa-py2-py-doc:

For full information please refer to the NAG Library document for f06wa

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06waf.html

.. _f06wa-py2-py-parameters:

**Parameters**
**norm** : str, length 1
Specifies the value to be returned.

:math:\mathrm{norm} = \texttt{'1'} or :math:\texttt{'O'}

The :math:1-norm.

:math:\mathrm{norm} = \texttt{'I'}

The :math:\infty-norm.

:math:\mathrm{norm} = \texttt{'F'} or :math:\texttt{'E'}

The Frobenius (or Euclidean) norm.

:math:\mathrm{norm} = \texttt{'M'}

The value :math:\mathrm{max}_{{i,j}}\left(\left\lvert a_{{ij}}\right\rvert \right) (not a norm).

**transr** : str, length 1
Specifies whether the RFP representation of :math:A is normal or transposed.

:math:\mathrm{transr} = \texttt{'N'}

The matrix :math:A is stored in normal RFP format.

:math:\mathrm{transr} = \texttt{'T'}

The matrix :math:A is stored in transposed RFP format.

**uplo** : str, length 1
Specifies whether the upper or lower triangular part of :math:A is stored.

:math:\mathrm{uplo} = \texttt{'U'}

The upper triangular part of :math:A is stored.

:math:\mathrm{uplo} = \texttt{'L'}

The lower triangular part of :math:A is stored.

**n** : int
:math:n, the order of the matrix :math:A.

When :math:\mathrm{n} = 0, dlansf returns zero.

**a** : float, array-like, shape :math:\left(\mathrm{n}\times \left(\mathrm{n}+1\right)/2\right)
The upper or lower triangular part (as specified by :math:\mathrm{uplo}) of the :math:n\times n symmetric matrix :math:A, in either normal or transposed RFP format (as specified by :math:\mathrm{transr}). The storage format is described in detail in the F07 Introduction <https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f07/f07intro.html#recomm_32a>__.

**Returns**
**nrm** : float
The :math:\infty-norm, the Frobenius norm, or the maximum absolute value of the elements of the real symmetric matrix :math:A stored in Rectangular Full Packed (RFP) format.

.. _f06wa-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{norm}.

Constraint: :math:\mathrm{norm} = \texttt{'1'}, :math:\texttt{'O'}, :math:\texttt{'I'}, :math:\texttt{'F'}, :math:\texttt{'E'} or :math:\texttt{'M'}.

(errno :math:2)
On entry, error in parameter :math:\mathrm{transr}.

Constraint: :math:\mathrm{transr} = \texttt{'N'} or :math:\texttt{'T'}.

(errno :math:3)
On entry, error in parameter :math:\mathrm{uplo}.

Constraint: :math:\mathrm{uplo} = \texttt{'U'} or :math:\texttt{'L'}.

(errno :math:4)
On entry, error in parameter :math:\mathrm{n}.

Constraint: :math:\mathrm{n}\geq 0.

.. _f06wa-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

Given a real :math:n\times n symmetric matrix, :math:A, dlansf calculates one of the values given by

.. rst-class:: nag-rules-none

+-------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------+
|:math:\left\lVert A\right\rVert_1 = \mathrm{max}_j\left({\sum_{{i = 1}}^n\left\lvert a_{{ij}}\right\rvert }\right)           |(the :math:1-norm of :math:A),                |
+-------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------+
|:math:\left\lVert A\right\rVert_\infty = \mathrm{max}_i\left({\sum_{{j = 1}}^n\left\lvert a_{{ij}}\right\rvert }\right)      |(the :math:\infty-norm of :math:A),           |
+-------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------+
|:math:\left\lVert A\right\rVert_F = \left(\sum_{{i = 1}}^n{\sum_{{j = 1}}^n\left\lvert a_{{ij}}\right\rvert^2}\right)^{{1/2}}|(the Frobenius norm of :math:A), or             |
+-------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------+
|:math:\mathrm{max}_{{i,j}}\left(\left\lvert a_{{ij}}\right\rvert \right)                                                     |(the maximum absolute element value of :math:A).|
+-------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------+

:math:A is stored in compact form using the RFP format. The RFP storage format is described in the F07 Introduction <https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f07/f07intro.html#recomm_32a>__.

.. _f06wa-py2-py-references:

**References**
Basic Linear Algebra Subprograms Technical (BLAST) Forum, 2001, Basic Linear Algebra Subprograms Technical (BLAST) Forum Standard, University of Tennessee, Knoxville, Tennessee, https://www.netlib.org/blas/blast-forum/blas-report.pdf

Gustavson, F G, Waśniewski, J, Dongarra, J J and Langou, J, 2010, Rectangular full packed format for Cholesky's algorithm: factorization, solution, and inversion, ACM Trans. Math. Software (37, 2)
"""
raise NotImplementedError

[docs]def dtfsm(transr, side, uplo, trans, diag, alpha, a, b):
r"""
dtfsm performs one of the matrix-matrix operations

.. math::
\begin{array}{ll} B←\alpha A^{-1}B \text{,} & B←\alpha A^{-\mathrm{T}}B \text{,} \\ B←\alpha BA^{-1} \quad \text{ or} & B←\alpha BA^{-\mathrm{T}} \text{,} \end{array}

where :math:A is a real triangular matrix stored in Rectangular Full Packed (RFP) format, :math:B is an :math:m\times n real matrix, and :math:\alpha is a real scalar. :math:A^{-\mathrm{T}} denotes :math:\left(A^\mathrm{T}\right)^{-1} or equivalently :math:\left(A^{-1}\right)^\mathrm{T}.

No test for singularity or near-singularity of :math:A is included in this function.
Such tests must be performed before calling this function.

.. _f06wb-py2-py-doc:

For full information please refer to the NAG Library document for f06wb

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06wbf.html

.. _f06wb-py2-py-parameters:

**Parameters**
**transr** : str, length 1
Specifies whether the RFP representation of :math:A is normal or transposed.

:math:\mathrm{transr} = \texttt{'N'}

The matrix :math:A is stored in normal RFP format.

:math:\mathrm{transr} = \texttt{'T'}

The matrix :math:A is stored in transposed RFP format.

**side** : str, length 1
Specifies whether :math:B is operated on from the left or the right, or similarly whether :math:A (or its transpose) appears to the left or right of the solution matrix in the linear system to be solved.

:math:\mathrm{side} = \texttt{'L'}

:math:B is pre-multiplied from the left. The system to be solved has the form :math:AX = \alpha B or :math:A^\mathrm{T}X = \alpha B.

:math:\mathrm{side} = \texttt{'R'}

:math:B is post-multiplied from the right. The system to be solved has the form :math:XA = \alpha B or :math:XA^\mathrm{T} = \alpha B.

**uplo** : str, length 1
Specifies whether :math:A is upper or lower triangular.

:math:\mathrm{uplo} = \texttt{'U'}

:math:A is upper triangular.

:math:\mathrm{uplo} = \texttt{'L'}

:math:A is lower triangular.

**trans** : str, length 1
Specifies whether the operation involves :math:A^{-1} or :math:A^{-\mathrm{T}}, i.e., whether or not :math:A is transposed in the linear system to be solved.

:math:\mathrm{trans} = \texttt{'N'}

The operation involves :math:A^{-1}, i.e., :math:A is not transposed.

:math:\mathrm{trans} = \texttt{'T'}

The operation involves :math:A^{-\mathrm{T}}, i.e., :math:A is transposed.

**diag** : str, length 1
Specifies whether :math:A has nonunit or unit diagonal elements.

:math:\mathrm{diag} = \texttt{'N'}

The diagonal elements of :math:A are stored explicitly.

:math:\mathrm{diag} = \texttt{'U'}

The diagonal elements of :math:A are assumed to be :math:1, the corresponding elements of :math:\mathrm{a} are not referenced.

**alpha** : float
The scalar :math:\alpha.

**a** : float, array-like, shape :math:\left(:\right)
Note: the required length for this argument is determined as follows: if :math:\mathrm{side}=\texttt{'L'}: :math:{ m \times \left(m+1\right) / 2 }; if :math:\mathrm{side}=\texttt{'R'}: :math:{ n \times \left(n+1\right) / 2 }; otherwise: :math:0.

:math:A, the :math:m\times m triangular matrix :math:A if :math:\mathrm{side} = \texttt{'L'} or the :math:n\times n triangular matrix :math:A if :math:\mathrm{side} = \texttt{'R'}, stored in RFP format (as specified by :math:\mathrm{transr}). The storage format is described in detail in the F07 Introduction <https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f07/f07intro.html#recomm_32a>__. If :math:\mathrm{alpha} = 0.0, :math:\mathrm{a} is not referenced.

**b** : float, array-like, shape :math:\left(m, n\right)
The :math:m\times n matrix :math:B.

If :math:\mathrm{alpha} = 0, :math:\mathrm{b} need not be set.

**Returns**
**b** : float, ndarray, shape :math:\left(m, n\right)
The updated matrix :math:B, or similarly the solution matrix :math:X.

.. _f06wb-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{transr}.

Constraint: :math:\mathrm{transr} = \texttt{'N'} or :math:\texttt{'T'}.

(errno :math:2)
On entry, error in parameter :math:\mathrm{side}.

Constraint: :math:\mathrm{side} = \texttt{'L'} or :math:\texttt{'R'}.

(errno :math:3)
On entry, error in parameter :math:\mathrm{uplo}.

Constraint: :math:\mathrm{uplo} = \texttt{'U'} or :math:\texttt{'L'}.

(errno :math:4)
On entry, error in parameter :math:\mathrm{trans}.

Constraint: :math:\mathrm{trans} = \texttt{'N'} or :math:\texttt{'T'}.

(errno :math:5)
On entry, error in parameter :math:\mathrm{diag}.

Constraint: :math:\mathrm{diag} = \texttt{'N'} or :math:\texttt{'U'}.

(errno :math:6)
On entry, error in parameter :math:\textit{m}.

Constraint: :math:m\geq 0.

(errno :math:7)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

.. _f06wb-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

dtfsm solves (for :math:X) a triangular linear system of one of the forms

.. math::
\begin{array}{ll} AX = \alpha B \text{,} & A^\mathrm{T}X = \alpha B \text{,} \\ XA = \alpha B \quad \text{ or} & XA^\mathrm{T} = \alpha B \text{,} \end{array}

where :math:A is a real triangular matrix stored in RFP format, :math:B, :math:X are :math:m\times n real matrices, and :math:\alpha is a real scalar. The RFP storage format is described in the F07 Introduction <https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f07/f07intro.html#recomm_32a>__.

.. _f06wb-py2-py-references:

**References**
Gustavson, F G, Waśniewski, J, Dongarra, J J and Langou, J, 2010, Rectangular full packed format for Cholesky's algorithm: factorization, solution, and inversion, ACM Trans. Math. Software (37, 2)
"""
raise NotImplementedError

[docs]def dsfrk(transr, uplo, trans, k, alpha, a, beta, c):
r"""
dsfrk performs one of the symmetric rank-:math:k update operations

.. math::

where :math:A is a real matrix, :math:C is an :math:n\times n real symmetric matrix stored in Rectangular Full Packed (RFP) format, and :math:\alpha and :math:\beta are real scalars.

.. _f06wc-py2-py-doc:

For full information please refer to the NAG Library document for f06wc

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06wcf.html

.. _f06wc-py2-py-parameters:

**Parameters**
**transr** : str, length 1
Specifies whether the RFP representation of :math:C is normal or transposed.

:math:\mathrm{transr} = \texttt{'N'}

The matrix :math:C is stored in normal RFP format.

:math:\mathrm{transr} = \texttt{'T'}

The matrix :math:C is stored in transposed RFP format.

**uplo** : str, length 1
Specifies whether the upper or lower triangular part of :math:C is stored in RFP format.

:math:\mathrm{uplo} = \texttt{'U'}

The upper triangular part of :math:C is stored in RFP format.

:math:\mathrm{uplo} = \texttt{'L'}

The lower triangular part of :math:C is stored in RFP format.

**trans** : str, length 1
Specifies the operation to be performed.

:math:\mathrm{trans} = \texttt{'N'}

:math:C←\alpha AA^\mathrm{T}+\beta C.

:math:\mathrm{trans} = \texttt{'T'}

:math:C←\alpha A^\mathrm{T}A+\beta C.

**k** : int
:math:k, the number of columns of :math:A if :math:\mathrm{trans} = \texttt{'N'}, or the number of rows of :math:A if :math:\mathrm{trans} = \texttt{'T'}.

**alpha** : float
The scalar :math:\alpha.

**a** : float, array-like, shape :math:\left(:, :\right)
Note: the required extent for this argument in dimension 1 is determined as follows: if :math:\mathrm{trans}=\texttt{'N'}: :math:n; if :math:\mathrm{trans}=\texttt{'T'}: :math:\mathrm{k}; otherwise: :math:0.

Note: the required extent for this argument in dimension 2 is determined as follows: if :math:\mathrm{trans}=\texttt{'N'}: :math:\mathrm{k}; if :math:\mathrm{trans}=\texttt{'T'}: :math:n; otherwise: :math:0.

The matrix :math:A; :math:A is :math:n\times k if :math:\mathrm{trans} = \texttt{'N'}, or :math:k\times n if :math:\mathrm{trans} = \texttt{'T'}. If :math:\mathrm{alpha} = 0.0, :math:\mathrm{a} is not referenced.

**beta** : float
The scalar :math:\beta.

**c** : float, array-like, shape :math:\left(n\times \left(n+1\right)/2\right)
The upper or lower triangular part (as specified by :math:\mathrm{uplo}) of the :math:n\times n symmetric matrix :math:C, stored in RFP format (as specified by :math:\mathrm{transr}). The storage format is described in detail in the F07 Introduction <https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f07/f07intro.html#recomm_32a>__.

**Returns**
**c** : float, ndarray, shape :math:\left(n\times \left(n+1\right)/2\right)
The updated matrix :math:C, that is its upper or lower triangular part stored in RFP format.

.. _f06wc-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{transr}.

Constraint: :math:\mathrm{transr} = \texttt{'N'} or :math:\texttt{'T'}.

(errno :math:2)
On entry, error in parameter :math:\mathrm{uplo}.

Constraint: :math:\mathrm{uplo} = \texttt{'U'} or :math:\texttt{'L'}.

(errno :math:3)
On entry, error in parameter :math:\mathrm{trans}.

Constraint: :math:\mathrm{trans} = \texttt{'N'} or :math:\texttt{'T'}.

(errno :math:4)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

(errno :math:5)
On entry, error in parameter :math:\mathrm{k}.

Constraint: :math:\mathrm{k}\geq 0.

.. _f06wc-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

dsfrk performs one of the symmetric rank-:math:k update operations

.. math::

where :math:A is a real matrix, :math:C is an :math:n\times n real symmetric matrix stored in Rectangular Full Packed (RFP) format, and :math:\alpha and :math:\beta are real scalars. The RFP storage format is described in the F07 Introduction <https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f07/f07intro.html#recomm_32a>__.

If :math:n = 0 or if :math:\beta = 1.0 and either :math:k = 0 or :math:\alpha = 0.0 then dsfrk returns immediately.
If :math:\beta = 0.0 and either :math:k = 0 or :math:\alpha = 0.0 then :math:C is set to the zero matrix.

.. _f06wc-py2-py-references:

**References**
Gustavson, F G, Waśniewski, J, Dongarra, J J and Langou, J, 2010, Rectangular full packed format for Cholesky's algorithm: factorization, solution, and inversion, ACM Trans. Math. Software (37, 2)
"""
raise NotImplementedError

[docs]def zlanhf(norm, transr, uplo, n, a):
r"""
zlanhf returns the value of the :math:1-norm, the :math:\infty-norm, the Frobenius norm, or the maximum absolute value of the elements of a complex Hermitian matrix :math:A stored in Rectangular Full Packed (RFP) format.

.. _f06wn-py2-py-doc:

For full information please refer to the NAG Library document for f06wn

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06wnf.html

.. _f06wn-py2-py-parameters:

**Parameters**
**norm** : str, length 1
Specifies the value to be returned.

:math:\mathrm{norm} = \texttt{'1'} or :math:\texttt{'O'}

The :math:1-norm.

:math:\mathrm{norm} = \texttt{'I'}

The :math:\infty-norm.

:math:\mathrm{norm} = \texttt{'F'} or :math:\texttt{'E'}

The Frobenius (or Euclidean) norm.

:math:\mathrm{norm} = \texttt{'M'}

The value :math:\mathrm{max}_{{i,j}}\left(\left\lvert a_{{ij}}\right\rvert \right) (not a norm).

**transr** : str, length 1
Specifies whether the normal RFP representation of :math:A or its conjugate transpose is stored.

:math:\mathrm{transr} = \texttt{'N'}

The matrix :math:A is stored in normal RFP format.

:math:\mathrm{transr} = \texttt{'C'}

The conjugate transpose of the RFP representation of the matrix :math:A is stored.

**uplo** : str, length 1
Specifies whether the upper or lower triangular part of :math:A is stored.

:math:\mathrm{uplo} = \texttt{'U'}

The upper triangular part of :math:A is stored.

:math:\mathrm{uplo} = \texttt{'L'}

The lower triangular part of :math:A is stored.

**n** : int
:math:n, the order of the matrix :math:A.

When :math:\mathrm{n} = 0, zlanhf returns zero.

**a** : complex, array-like, shape :math:\left(\mathrm{n}\times \left(\mathrm{n}+1\right)/2\right)
The upper or lower triangular part (as specified by :math:\mathrm{uplo}) of the :math:n\times n Hermitian matrix :math:A, in either normal or transposed RFP format (as specified by :math:\mathrm{transr}). The storage format is described in detail in the F07 Introduction <https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f07/f07intro.html#recomm_32a>__.

**Returns**
**nrm** : float
The :math:\infty-norm, the Frobenius norm, or the maximum absolute value of the elements of the complex Hermitian matrix :math:A stored in Rectangular Full Packed (RFP) format.

.. _f06wn-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{norm}.

Constraint: :math:\mathrm{norm} = \texttt{'1'}, :math:\texttt{'O'}, :math:\texttt{'I'}, :math:\texttt{'F'}, :math:\texttt{'E'} or :math:\texttt{'M'}.

(errno :math:2)
On entry, error in parameter :math:\mathrm{transr}.

Constraint: :math:\mathrm{transr} = \texttt{'N'} or :math:\texttt{'C'}.

(errno :math:3)
On entry, error in parameter :math:\mathrm{uplo}.

Constraint: :math:\mathrm{uplo} = \texttt{'U'} or :math:\texttt{'L'}.

(errno :math:4)
On entry, error in parameter :math:\mathrm{n}.

Constraint: :math:\mathrm{n}\geq 0.

.. _f06wn-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

Given a complex :math:n\times n symmetric matrix, :math:A, zlanhf calculates one of the values given by

.. rst-class:: nag-rules-none

+-------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------+
|:math:\left\lVert A\right\rVert_1 = \mathrm{max}_j\left({\sum_{{i = 1}}^n\left\lvert a_{{ij}}\right\rvert }\right)           |(the :math:1-norm of :math:A),                |
+-------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------+
|:math:\left\lVert A\right\rVert_\infty = \mathrm{max}_i\left({\sum_{{j = 1}}^n\left\lvert a_{{ij}}\right\rvert }\right)      |(the :math:\infty-norm of :math:A),           |
+-------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------+
|:math:\left\lVert A\right\rVert_F = \left(\sum_{{i = 1}}^n{\sum_{{j = 1}}^n\left\lvert a_{{ij}}\right\rvert^2}\right)^{{1/2}}|(the Frobenius norm of :math:A), or             |
+-------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------+
|:math:\mathrm{max}_{{i,j}}\left(\left\lvert a_{{ij}}\right\rvert \right)                                                     |(the maximum absolute element value of :math:A).|
+-------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------+

:math:A is stored in compact form using the RFP format. The RFP storage format is described in the F07 Introduction <https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f07/f07intro.html#recomm_32a>__.

.. _f06wn-py2-py-references:

**References**
Basic Linear Algebra Subprograms Technical (BLAST) Forum, 2001, Basic Linear Algebra Subprograms Technical (BLAST) Forum Standard, University of Tennessee, Knoxville, Tennessee, https://www.netlib.org/blas/blast-forum/blas-report.pdf

Gustavson, F G, Waśniewski, J, Dongarra, J J and Langou, J, 2010, Rectangular full packed format for Cholesky's algorithm: factorization, solution, and inversion, ACM Trans. Math. Software (37, 2)
"""
raise NotImplementedError

[docs]def ztfsm(transr, side, uplo, trans, diag, alpha, a, b):
r"""
ztfsm performs one of the matrix-matrix operations

.. math::
\begin{array}{ll} B←\alpha A^{-1}B \text{,} & B←\alpha A^{-\mathrm{H}}B \text{,} \\ B←\alpha BA^{-1} \quad \text{ or} & B←\alpha BA^{-\mathrm{H}} \text{,} \end{array}

where :math:A is a complex triangular matrix stored in Rectangular Full Packed (RFP) format, :math:B is an :math:m\times n complex matrix, and :math:\alpha is a complex scalar. :math:A^{-\mathrm{H}} denotes :math:\left(A^\mathrm{H}\right)^{-1} or equivalently :math:\left(A^{-1}\right)^\mathrm{H}.

No test for singularity or near-singularity of :math:A is included in this function.
Such tests must be performed before calling this function.

.. _f06wp-py2-py-doc:

For full information please refer to the NAG Library document for f06wp

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06wpf.html

.. _f06wp-py2-py-parameters:

**Parameters**
**transr** : str, length 1
Specifies whether the normal RFP representation of :math:A or its conjugate transpose is stored.

:math:\mathrm{transr} = \texttt{'N'}

The matrix :math:A is stored in normal RFP format.

:math:\mathrm{transr} = \texttt{'C'}

The conjugate transpose of the RFP representation of the matrix :math:A is stored.

**side** : str, length 1
Specifies whether :math:B is operated on from the left or the right, or similarly whether :math:A (or its transpose) appears to the left or right of the solution matrix in the linear system to be solved.

:math:\mathrm{side} = \texttt{'L'}

:math:B is pre-multiplied from the left. The system to be solved has the form :math:AX = \alpha B or :math:A^\mathrm{H}X = \alpha B.

:math:\mathrm{side} = \texttt{'R'}

:math:B is post-multiplied from the right. The system to be solved has the form :math:XA = \alpha B or :math:XA^\mathrm{H} = \alpha B.

**uplo** : str, length 1
Specifies whether :math:A is upper or lower triangular.

:math:\mathrm{uplo} = \texttt{'U'}

:math:A is upper triangular.

:math:\mathrm{uplo} = \texttt{'L'}

:math:A is lower triangular.

**trans** : str, length 1
Specifies whether the operation involves :math:A^{-1} or :math:A^{-\mathrm{H}}, i.e., whether or not :math:A is transpose conjugated in the linear system to be solved.

:math:\mathrm{trans} = \texttt{'N'}

The operation involves :math:A^{-1}, i.e., :math:A is not transpose conjugated.

:math:\mathrm{trans} = \texttt{'C'}

The operation involves :math:A^{-\mathrm{H}}, i.e., :math:A is transpose conjugated.

**diag** : str, length 1
Specifies whether :math:A has nonunit or unit diagonal elements.

:math:\mathrm{diag} = \texttt{'N'}

The diagonal elements of :math:A are stored explicitly.

:math:\mathrm{diag} = \texttt{'U'}

The diagonal elements of :math:A are assumed to be :math:1, the corresponding elements of :math:\mathrm{a} are not referenced.

**alpha** : complex
The scalar :math:\alpha.

**a** : complex, array-like, shape :math:\left(:\right)
Note: the required length for this argument is determined as follows: if :math:\mathrm{side}=\texttt{'L'}: :math:{ m \times \left(m+1\right) / 2 }; if :math:\mathrm{side}=\texttt{'R'}: :math:{ n \times \left(n+1\right) / 2 }; otherwise: :math:0.

:math:A, the :math:m\times m triangular matrix :math:A if :math:\mathrm{side} = \texttt{'L'} or the :math:n\times n triangular matrix :math:A if :math:\mathrm{side} = \texttt{'R'}, stored in RFP format (as specified by :math:\mathrm{transr}). The storage format is described in detail in the F07 Introduction <https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f07/f07intro.html#recomm_32a>__. If :math:\mathrm{alpha} = 0.0, :math:\mathrm{a} is not referenced.

**b** : complex, array-like, shape :math:\left(m, n\right)
The :math:m\times n matrix :math:B.

If :math:\mathrm{alpha} = 0, :math:\mathrm{b} need not be set.

**Returns**
**b** : complex, ndarray, shape :math:\left(m, n\right)
The updated matrix :math:B, or similarly the solution matrix :math:X.

.. _f06wp-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{transr}.

Constraint: :math:\mathrm{transr} = \texttt{'N'} or :math:\texttt{'C'}.

(errno :math:2)
On entry, error in parameter :math:\mathrm{side}.

Constraint: :math:\mathrm{side} = \texttt{'L'} or :math:\texttt{'R'}.

(errno :math:3)
On entry, error in parameter :math:\mathrm{uplo}.

Constraint: :math:\mathrm{uplo} = \texttt{'U'} or :math:\texttt{'L'}.

(errno :math:4)
On entry, error in parameter :math:\mathrm{trans}.

Constraint: :math:\mathrm{trans} = \texttt{'N'} or :math:\texttt{'C'}.

(errno :math:5)
On entry, error in parameter :math:\mathrm{diag}.

Constraint: :math:\mathrm{diag} = \texttt{'N'} or :math:\texttt{'U'}.

(errno :math:6)
On entry, error in parameter :math:\textit{m}.

Constraint: :math:m\geq 0.

(errno :math:7)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

.. _f06wp-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

ztfsm solves (for :math:X) a triangular linear system of one of the forms

.. math::
\begin{array}{ll} AX = \alpha B \text{,} & A^\mathrm{H}X = \alpha B \text{,} \\ XA = \alpha B \quad \text{ or} & XA^\mathrm{H} = \alpha B \text{,} \end{array}

where :math:A is a complex triangular matrix stored in RFP format, :math:B, :math:X are :math:m\times n complex matrices, and :math:\alpha is a complex scalar. The RFP storage format is described in the F07 Introduction <https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f07/f07intro.html#recomm_32a>__.

.. _f06wp-py2-py-references:

**References**
Gustavson, F G, Waśniewski, J, Dongarra, J J and Langou, J, 2010, Rectangular full packed format for Cholesky's algorithm: factorization, solution, and inversion, ACM Trans. Math. Software (37, 2)
"""
raise NotImplementedError

[docs]def zhfrk(transr, uplo, trans, k, alpha, a, beta, c):
r"""
zhfrk performs one of the Hermitian rank-:math:k update operations

.. math::

where :math:A is a complex matrix, :math:C is an :math:n\times n complex Hermitian matrix stored in Rectangular Full Packed (RFP) format, and :math:\alpha and :math:\beta are real scalars.

.. _f06wq-py2-py-doc:

For full information please refer to the NAG Library document for f06wq

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06wqf.html

.. _f06wq-py2-py-parameters:

**Parameters**
**transr** : str, length 1
Specifies whether the normal RFP representation of :math:C or its conjugate transpose is stored.

:math:\mathrm{transr} = \texttt{'N'}

The matrix :math:C is stored in normal RFP format.

:math:\mathrm{transr} = \texttt{'C'}

The conjugate transpose of the RFP representation of the matrix :math:C is stored.

**uplo** : str, length 1
Specifies whether the upper or lower triangular part of :math:C is stored in RFP format.

:math:\mathrm{uplo} = \texttt{'U'}

The upper triangular part of :math:C is stored in RFP format.

:math:\mathrm{uplo} = \texttt{'L'}

The lower triangular part of :math:C is stored in RFP format.

**trans** : str, length 1
Specifies the operation to be performed.

:math:\mathrm{trans} = \texttt{'N'}

:math:C←\alpha AA^\mathrm{H}+\beta C.

:math:\mathrm{trans} = \texttt{'C'}

:math:C←\alpha A^\mathrm{H}A+\beta C.

**k** : int
:math:k, the number of columns of :math:A if :math:\mathrm{trans} = \texttt{'N'}, or the number of rows of :math:A if :math:\mathrm{trans} = \texttt{'C'}.

**alpha** : float
The scalar :math:\alpha.

**a** : complex, array-like, shape :math:\left(:, :\right)
Note: the required extent for this argument in dimension 1 is determined as follows: if :math:\mathrm{trans}=\texttt{'N'}: :math:\max\left(1,n\right); if :math:\mathrm{trans}=\texttt{'C'}: :math:\max\left(1,\mathrm{k}\right); otherwise: :math:1.

Note: the required extent for this argument in dimension 2 is determined as follows: if :math:\mathrm{trans}=\texttt{'N'}: :math:\max\left(1,\mathrm{k}\right); if :math:\mathrm{trans}=\texttt{'C'}: :math:\max\left(1,n\right); otherwise: :math:1.

The matrix :math:A; :math:A is :math:n\times k if :math:\mathrm{trans} = \texttt{'N'}, or :math:k\times n if :math:\mathrm{trans} = \texttt{'C'}. If :math:\mathrm{alpha} = 0.0, :math:\mathrm{a} is not referenced.

**beta** : float
The scalar :math:\beta.

**c** : complex, array-like, shape :math:\left(n\times \left(n+1\right)/2\right)
The upper or lower triangular part (as specified by :math:\mathrm{uplo}) of the :math:n\times n Hermitian matrix :math:C, stored in RFP format (as specified by :math:\mathrm{transr}). The storage format is described in detail in the F07 Introduction <https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f07/f07intro.html#recomm_32a>__.

**Returns**
**c** : complex, ndarray, shape :math:\left(n\times \left(n+1\right)/2\right)
The updated matrix :math:C, that is its upper or lower triangular part stored in RFP format.

.. _f06wq-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{transr}.

Constraint: :math:\mathrm{transr} = \texttt{'N'} or :math:\texttt{'C'}.

(errno :math:2)
On entry, error in parameter :math:\mathrm{uplo}.

Constraint: :math:\mathrm{uplo} = \texttt{'U'} or :math:\texttt{'L'}.

(errno :math:3)
On entry, error in parameter :math:\mathrm{trans}.

Constraint: :math:\mathrm{trans} = \texttt{'N'} or :math:\texttt{'C'}.

(errno :math:4)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

(errno :math:5)
On entry, error in parameter :math:\mathrm{k}.

Constraint: :math:\mathrm{k}\geq 0.

.. _f06wq-py2-py-notes:

**Notes**
No equivalent traditional C interface for this routine exists in the NAG Library.

zhfrk performs one of the Hermitian rank-:math:k update operations

.. math::

where :math:A is a complex matrix, :math:C is an :math:n\times n complex Hermitian matrix stored in Rectangular Full Packed (RFP) format, and :math:\alpha and :math:\beta are real scalars. The RFP storage format is described in the F07 Introduction <https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f07/f07intro.html#recomm_32a>__.

If :math:n = 0 or if :math:\beta = 1.0 and either :math:k = 0 or :math:\alpha = 0.0 then zhfrk returns immediately.
If :math:\beta = 0.0 and either :math:k = 0 or :math:\alpha = 0.0 then :math:C is set to the zero matrix.

.. _f06wq-py2-py-references:

**References**
Gustavson, F G, Waśniewski, J, Dongarra, J J and Langou, J, 2010, Rectangular full packed format for Cholesky's algorithm: factorization, solution, and inversion, ACM Trans. Math. Software (37, 2)
"""
raise NotImplementedError

[docs]def dgemm(transa, transb, alpha, a, b, beta, c=None):
r"""
dgemm performs one of the matrix-matrix operations

.. math::
\begin{array}{ll}C←\alpha AB+\beta C\text{,}&C←\alpha A^\mathrm{T}B+\beta C\text{,}\\C←\alpha AB^\mathrm{T}+\beta C\quad \text{ or}&C←\alpha A^\mathrm{T}B^\mathrm{T}+\beta C\text{,}\end{array}

where :math:A, :math:B and :math:C are real matrices, and :math:\alpha and :math:\beta are real scalars; :math:C is always :math:m\times n.

.. _f06ya-py2-py-doc:

For full information please refer to the NAG Library document for f06ya

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06yaf.html

.. _f06ya-py2-py-parameters:

**Parameters**
**transa** : str, length 1
Specifies whether the operation involves :math:A or :math:A^\mathrm{T}.

:math:\mathrm{transa} = \texttt{'N'}

The operation involves :math:A.

:math:\mathrm{transa} = \texttt{'T'} or :math:\texttt{'C'}

The operation involves :math:A^\mathrm{T}.

**transb** : str, length 1
Specifies whether the operation involves :math:B or :math:B^\mathrm{T}.

:math:\mathrm{transb} = \texttt{'N'}

The operation involves :math:B.

:math:\mathrm{transb} = \texttt{'T'} or :math:\texttt{'C'}

The operation involves :math:B^\mathrm{T}.

**alpha** : float
The scalar :math:\alpha.

**a** : float, array-like, shape :math:\left(:, :\right)
Note: the required extent for this argument in dimension 1 is determined as follows: if :math:\mathrm{transa}=\texttt{'N'}: :math:m; if :math:\mathrm{transa}\text{ in } (\texttt{'T'}, \texttt{'C'}): :math:k; otherwise: :math:0.

Note: the required extent for this argument in dimension 2 is determined as follows: if :math:\mathrm{transa}=\texttt{'N'}: :math:k; if :math:\mathrm{transa}\text{ in } (\texttt{'T'}, \texttt{'C'}): :math:m; otherwise: :math:0.

The matrix :math:A; :math:A is :math:m\times k if :math:\mathrm{transa} = \texttt{'N'}, or :math:k\times m if :math:\mathrm{transa} = \texttt{'T'} or :math:\texttt{'C'}.

**b** : float, array-like, shape :math:\left(:, :\right)
Note: the required extent for this argument in dimension 1 is determined as follows: if :math:\mathrm{transb}=\texttt{'N'}: :math:k; if :math:\mathrm{transb}\text{ in } (\texttt{'T'}, \texttt{'C'}): :math:n; otherwise: :math:0.

Note: the required extent for this argument in dimension 2 is determined as follows: if :math:\mathrm{transb}=\texttt{'N'}: :math:n; if :math:\mathrm{transb}\text{ in } (\texttt{'T'}, \texttt{'C'}): :math:k; otherwise: :math:0.

The matrix :math:B; :math:B is :math:k\times n if :math:\mathrm{transb} = \texttt{'N'}, or :math:n\times k if :math:\mathrm{transb} = \texttt{'T'} or :math:\texttt{'C'}.

**beta** : float
The scalar :math:\beta.

**c** : None or float, array-like, shape :math:\left(m, n\right), optional
The :math:m\times n matrix :math:C.

If :math:\mathrm{beta} = 0.0, :math:\mathrm{c} need not be set.

**Returns**
**c** : float, ndarray, shape :math:\left(m, n\right)
The updated matrix :math:C.

.. _f06ya-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{transa}.

Constraint: :math:\mathrm{transa} = \texttt{'N'}, :math:\texttt{'T'} or :math:\texttt{'C'}.

(errno :math:2)
On entry, error in parameter :math:\mathrm{transb}.

Constraint: :math:\mathrm{transb} = \texttt{'N'}, :math:\texttt{'T'} or :math:\texttt{'C'}.

(errno :math:3)
On entry, error in parameter :math:\textit{m}.

Constraint: :math:m\geq 0.

(errno :math:4)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

(errno :math:5)
On entry, error in parameter :math:\textit{k}.

Constraint: :math:k\geq 0.

.. _f06ya-py2-py-notes:

**Notes**
In the NAG Library the traditional C interface for this routine uses a different algorithmic base. Please contact NAG if you have any questions about compatibility.
"""
raise NotImplementedError

[docs]def dsymm(side, uplo, m, alpha, a, b, beta, c=None):
r"""
dsymm performs one of the matrix-matrix operations

.. math::

where :math:A is a real symmetric matrix, :math:B and :math:C are :math:m\times n real matrices, and :math:\alpha and :math:\beta are real scalars.

.. _f06yc-py2-py-doc:

For full information please refer to the NAG Library document for f06yc

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06ycf.html

.. _f06yc-py2-py-parameters:

**Parameters**
**side** : str, length 1
Specifies whether :math:B is operated on from the left or the right.

:math:\mathrm{side} = \texttt{'L'}

:math:B is pre-multiplied from the left.

:math:\mathrm{side} = \texttt{'R'}

:math:B is post-multiplied from the right.

**uplo** : str, length 1
Specifies whether the upper or lower triangular part of :math:A is stored.

:math:\mathrm{uplo} = \texttt{'U'}

The upper triangular part of :math:A is stored.

:math:\mathrm{uplo} = \texttt{'L'}

The lower triangular part of :math:A is stored.

**m** : int
:math:m, the number of rows of the matrices :math:B and :math:C; the order of :math:A if :math:\mathrm{side} = \texttt{'L'}.

**alpha** : float
The scalar :math:\alpha.

**a** : float, array-like, shape :math:\left(:, :\right)
Note: the required extent for this argument in dimension 1 is determined as follows: if :math:\mathrm{side}=\texttt{'L'}: :math:\mathrm{m}; if :math:\mathrm{side}=\texttt{'R'}: :math:n; otherwise: :math:0.

Note: the required extent for this argument in dimension 2 is determined as follows: if :math:\mathrm{side}=\texttt{'L'}: :math:\mathrm{m}; if :math:\mathrm{side}=\texttt{'R'}: :math:n; otherwise: :math:0.

The symmetric matrix :math:A; :math:A is :math:m\times m if :math:\mathrm{side} = \texttt{'L'}, or :math:n\times n if :math:\mathrm{side} = \texttt{'R'}.

**b** : float, array-like, shape :math:\left(\mathrm{m}, n\right)
The :math:m\times n matrix :math:B.

**beta** : float
The scalar :math:\beta.

**c** : None or float, array-like, shape :math:\left(\mathrm{m}, n\right), optional
The :math:m\times n matrix :math:C.

If :math:\mathrm{beta} = 0.0, :math:\mathrm{c} need not be set.

**Returns**
**c** : float, ndarray, shape :math:\left(\mathrm{m}, n\right)
The updated matrix :math:C.

.. _f06yc-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{side}.

Constraint: :math:\mathrm{side} = \texttt{'L'} or :math:\texttt{'R'}.

(errno :math:2)
On entry, error in parameter :math:\mathrm{uplo}.

Constraint: :math:\mathrm{uplo} = \texttt{'U'} or :math:\texttt{'L'}.

(errno :math:3)
On entry, error in parameter :math:\mathrm{m}.

Constraint: :math:\mathrm{m}\geq 0.

(errno :math:4)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

.. _f06yc-py2-py-notes:

**Notes**
In the NAG Library the traditional C interface for this routine uses a different algorithmic base. Please contact NAG if you have any questions about compatibility.
"""
raise NotImplementedError

[docs]def dtrmm(side, uplo, transa, diag, m, alpha, a, b):
r"""
dtrmm performs one of the matrix-matrix operations

.. math::
\begin{array}{ll}B←\alpha AB\text{,}&B←\alpha A^\mathrm{T}B\text{,}\\B←\alpha BA\quad \text{ or}&B←\alpha BA^\mathrm{T}\text{,}\end{array}

where :math:B is an :math:m\times n real matrix, :math:A is a real triangular matrix, and :math:\alpha is a real scalar.

.. _f06yf-py2-py-doc:

For full information please refer to the NAG Library document for f06yf

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06yff.html

.. _f06yf-py2-py-parameters:

**Parameters**
**side** : str, length 1
Specifies whether :math:B is operated on from the left or the right.

:math:\mathrm{side} = \texttt{'L'}

:math:B is pre-multiplied from the left.

:math:\mathrm{side} = \texttt{'R'}

:math:B is post-multiplied from the right.

**uplo** : str, length 1
Specifies whether :math:A is upper or lower triangular.

:math:\mathrm{uplo} = \texttt{'U'}

:math:A is upper triangular.

:math:\mathrm{uplo} = \texttt{'L'}

:math:A is lower triangular.

**transa** : str, length 1
Specifies whether the operation involves :math:A or :math:A^\mathrm{T}.

:math:\mathrm{transa} = \texttt{'N'}

The operation involves :math:A.

:math:\mathrm{transa} = \texttt{'T'} or :math:\texttt{'C'}

The operation involves :math:A^\mathrm{T}.

**diag** : str, length 1
Specifies whether :math:A has nonunit or unit diagonal elements.

:math:\mathrm{diag} = \texttt{'N'}

The diagonal elements are stored explicitly.

:math:\mathrm{diag} = \texttt{'U'}

The diagonal elements are assumed to be :math:1, and are not referenced.

**m** : int
:math:m, the number of rows of the matrix :math:B; the order of :math:A if :math:\mathrm{side} = \texttt{'L'}.

**alpha** : float
The scalar :math:\alpha.

**a** : float, array-like, shape :math:\left(:, :\right)
Note: the required extent for this argument in dimension 1 is determined as follows: if :math:\mathrm{side}=\texttt{'L'}: :math:\mathrm{m}; if :math:\mathrm{side}=\texttt{'R'}: :math:n; otherwise: :math:0.

Note: the required extent for this argument in dimension 2 is determined as follows: if :math:\mathrm{side}=\texttt{'L'}: :math:\mathrm{m}; if :math:\mathrm{side}=\texttt{'R'}: :math:n; otherwise: :math:0.

The triangular matrix :math:A; :math:A is :math:m\times m if :math:\mathrm{side} = \texttt{'L'}, or :math:n\times n if :math:\mathrm{side} = \texttt{'R'}.

**b** : float, array-like, shape :math:\left(\mathrm{m}, n\right)
The :math:m\times n matrix :math:B.

If :math:\mathrm{alpha} = 0, :math:\mathrm{b} need not be set.

**Returns**
**b** : float, ndarray, shape :math:\left(\mathrm{m}, n\right)
The updated matrix :math:B.

.. _f06yf-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{side}.

Constraint: :math:\mathrm{side} = \texttt{'L'} or :math:\texttt{'R'}.

(errno :math:2)
On entry, error in parameter :math:\mathrm{uplo}.

Constraint: :math:\mathrm{uplo} = \texttt{'U'} or :math:\texttt{'L'}.

(errno :math:3)
On entry, error in parameter :math:\mathrm{transa}.

Constraint: :math:\mathrm{transa} = \texttt{'N'}, :math:\texttt{'T'} or :math:\texttt{'C'}.

(errno :math:4)
On entry, error in parameter :math:\mathrm{diag}.

Constraint: :math:\mathrm{diag} = \texttt{'N'} or :math:\texttt{'U'}.

(errno :math:5)
On entry, error in parameter :math:\mathrm{m}.

Constraint: :math:\mathrm{m}\geq 0.

(errno :math:6)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

.. _f06yf-py2-py-notes:

**Notes**
In the NAG Library the traditional C interface for this routine uses a different algorithmic base. Please contact NAG if you have any questions about compatibility.
"""
raise NotImplementedError

[docs]def dtrsm(side, uplo, transa, diag, m, alpha, a, b):
r"""
dtrsm performs one of the matrix-matrix operations

.. math::
\begin{array}{ll}B←\alpha A^{-1}B\text{,}&B←\alpha A^{-\mathrm{T}}B\text{,}\\B←\alpha BA^{-1}\quad \text{ or}&B←\alpha BA^{-\mathrm{T}}\text{,}\end{array}

where :math:A is a real triangular matrix, :math:B is an :math:m\times n real matrix, and :math:\alpha is a real scalar. :math:A^{-\mathrm{T}} denotes :math:\left(A^\mathrm{T}\right)^{-1} or equivalently :math:\left(A^{-1}\right)^\mathrm{T}.

No test for singularity or near-singularity of :math:A is included in this function.
Such tests must be performed before calling this function.

.. _f06yj-py2-py-doc:

For full information please refer to the NAG Library document for f06yj

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06yjf.html

.. _f06yj-py2-py-parameters:

**Parameters**
**side** : str, length 1
Specifies whether :math:B is operated on from the left or the right.

:math:\mathrm{side} = \texttt{'L'}

:math:B is pre-multiplied from the left.

:math:\mathrm{side} = \texttt{'R'}

:math:B is post-multiplied from the right.

**uplo** : str, length 1
Specifies whether :math:A is upper or lower triangular.

:math:\mathrm{uplo} = \texttt{'U'}

:math:A is upper triangular.

:math:\mathrm{uplo} = \texttt{'L'}

:math:A is lower triangular.

**transa** : str, length 1
Specifies whether the operation involves :math:A^{-1} or :math:A^{-\mathrm{T}}.

:math:\mathrm{transa} = \texttt{'N'}

The operation involves :math:A^{-1}.

:math:\mathrm{transa} = \texttt{'T'} or :math:\texttt{'C'}

The operation involves :math:A^{-\mathrm{T}}.

**diag** : str, length 1
Specifies whether :math:A has nonunit or unit diagonal elements.

:math:\mathrm{diag} = \texttt{'N'}

The diagonal elements are stored explicitly.

:math:\mathrm{diag} = \texttt{'U'}

The diagonal elements are assumed to be :math:1, and are not referenced.

**m** : int
:math:m, the number of rows of the matrix :math:B; the order of :math:A if :math:\mathrm{side} = \texttt{'L'}.

**alpha** : float
The scalar :math:\alpha.

**a** : float, array-like, shape :math:\left(:, :\right)
Note: the required extent for this argument in dimension 1 is determined as follows: if :math:\mathrm{side}=\texttt{'L'}: :math:\mathrm{m}; if :math:\mathrm{side}=\texttt{'R'}: :math:n; otherwise: :math:0.

Note: the required extent for this argument in dimension 2 is determined as follows: if :math:\mathrm{side}=\texttt{'L'}: :math:\mathrm{m}; if :math:\mathrm{side}=\texttt{'R'}: :math:n; otherwise: :math:0.

The triangular matrix :math:A; :math:A is :math:m\times m if :math:\mathrm{side} = \texttt{'L'}, or :math:n\times n if :math:\mathrm{side} = \texttt{'R'}.

**b** : float, array-like, shape :math:\left(\mathrm{m}, n\right)
The :math:m\times n matrix :math:B.

If :math:\mathrm{alpha} = 0, :math:\mathrm{b} need not be set.

**Returns**
**b** : float, ndarray, shape :math:\left(\mathrm{m}, n\right)
The updated matrix :math:B.

.. _f06yj-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{side}.

Constraint: :math:\mathrm{side} = \texttt{'L'} or :math:\texttt{'R'}.

(errno :math:2)
On entry, error in parameter :math:\mathrm{uplo}.

Constraint: :math:\mathrm{uplo} = \texttt{'U'} or :math:\texttt{'L'}.

(errno :math:3)
On entry, error in parameter :math:\mathrm{transa}.

Constraint: :math:\mathrm{transa} = \texttt{'N'}, :math:\texttt{'T'} or :math:\texttt{'C'}.

(errno :math:4)
On entry, error in parameter :math:\mathrm{diag}.

Constraint: :math:\mathrm{diag} = \texttt{'N'} or :math:\texttt{'U'}.

(errno :math:5)
On entry, error in parameter :math:\mathrm{m}.

Constraint: :math:\mathrm{m}\geq 0.

(errno :math:6)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

.. _f06yj-py2-py-notes:

**Notes**
In the NAG Library the traditional C interface for this routine uses a different algorithmic base. Please contact NAG if you have any questions about compatibility.
"""
raise NotImplementedError

[docs]def dsyrk(uplo, trans, k, alpha, a, beta, c):
r"""
dsyrk performs one of the symmetric rank-:math:k update operations

.. math::

where :math:A is a real matrix, :math:C is an :math:n\times n real symmetric matrix, and :math:\alpha and :math:\beta are real scalars.

.. _f06yp-py2-py-doc:

For full information please refer to the NAG Library document for f06yp

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06ypf.html

.. _f06yp-py2-py-parameters:

**Parameters**
**uplo** : str, length 1
Specifies whether the upper or lower triangular part of :math:C is stored.

:math:\mathrm{uplo} = \texttt{'U'}

The upper triangular part of :math:C is stored.

:math:\mathrm{uplo} = \texttt{'L'}

The lower triangular part of :math:C is stored.

**trans** : str, length 1
Specifies the operation to be performed.

:math:\mathrm{trans} = \texttt{'N'}

:math:C←\alpha AA^\mathrm{T}+\beta C.

:math:\mathrm{trans} = \texttt{'T'} or :math:\texttt{'C'}

:math:C←\alpha A^\mathrm{T}A+\beta C.

**k** : int
:math:k, the number of columns of :math:A if :math:\mathrm{trans} = \texttt{'N'}, or the number of rows of :math:A if :math:\mathrm{trans} = \texttt{'T'} or :math:\texttt{'C'}.

**alpha** : float
The scalar :math:\alpha.

**a** : float, array-like, shape :math:\left(:, :\right)
Note: the required extent for this argument in dimension 1 is determined as follows: if :math:\mathrm{trans}=\texttt{'N'}: :math:n; if :math:\mathrm{trans}\text{ in } (\texttt{'T'}, \texttt{'C'}): :math:\mathrm{k}; otherwise: :math:0.

Note: the required extent for this argument in dimension 2 is determined as follows: if :math:\mathrm{trans}=\texttt{'N'}: :math:\mathrm{k}; if :math:\mathrm{trans}\text{ in } (\texttt{'T'}, \texttt{'C'}): :math:n; otherwise: :math:0.

The matrix :math:A; :math:A is :math:n\times k if :math:\mathrm{trans} = \texttt{'N'}, or :math:k\times n if :math:\mathrm{trans} = \texttt{'T'} or :math:\texttt{'C'}.

**beta** : float
The scalar :math:\beta.

**c** : float, array-like, shape :math:\left(n, n\right)
The :math:n\times n symmetric matrix :math:C.

**Returns**
**c** : float, ndarray, shape :math:\left(n, n\right)
The updated matrix :math:C.

.. _f06yp-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{uplo}.

Constraint: :math:\mathrm{uplo} = \texttt{'U'} or :math:\texttt{'L'}.

(errno :math:2)
On entry, error in parameter :math:\mathrm{trans}.

Constraint: :math:\mathrm{trans} = \texttt{'N'}, :math:\texttt{'T'} or :math:\texttt{'C'}.

(errno :math:3)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

(errno :math:4)
On entry, error in parameter :math:\mathrm{k}.

Constraint: :math:\mathrm{k}\geq 0.

.. _f06yp-py2-py-notes:

**Notes**
In the NAG Library the traditional C interface for this routine uses a different algorithmic base. Please contact NAG if you have any questions about compatibility.
"""
raise NotImplementedError

[docs]def dsyr2k(uplo, trans, k, alpha, a, b, beta, c):
r"""
dsyr2k performs one of the symmetric rank-:math:2k update operations

.. math::

where :math:A and :math:B are real matrices, :math:C is an :math:n\times n real symmetric matrix, and :math:\alpha and :math:\beta are real scalars.

.. _f06yr-py2-py-doc:

For full information please refer to the NAG Library document for f06yr

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06yrf.html

.. _f06yr-py2-py-parameters:

**Parameters**
**uplo** : str, length 1
Specifies whether the upper or lower triangular part of :math:C is stored.

:math:\mathrm{uplo} = \texttt{'U'}

The upper triangular part of :math:C is stored.

:math:\mathrm{uplo} = \texttt{'L'}

The lower triangular part of :math:C is stored.

**trans** : str, length 1
Specifies the operation to be performed.

:math:\mathrm{trans} = \texttt{'N'}

:math:C←\alpha AB^\mathrm{T}+\alpha BA^\mathrm{T}+\beta C.

:math:\mathrm{trans} = \texttt{'T'} or :math:\texttt{'C'}

:math:C←\alpha A^\mathrm{T}B+\alpha B^\mathrm{T}A+\beta C.

**k** : int
:math:k, the number of columns of :math:A and :math:B if :math:\mathrm{trans} = \texttt{'N'}, or the number of rows of :math:A and :math:B if :math:\mathrm{trans} = \texttt{'T'} or :math:\texttt{'C'}.

**alpha** : float
The scalar :math:\alpha.

**a** : float, array-like, shape :math:\left(:, :\right)
Note: the required extent for this argument in dimension 1 is determined as follows: if :math:\mathrm{trans}=\texttt{'N'}: :math:n; if :math:\mathrm{trans}\text{ in } (\texttt{'T'}, \texttt{'C'}): :math:\mathrm{k}; otherwise: :math:0.

Note: the required extent for this argument in dimension 2 is determined as follows: if :math:\mathrm{trans}=\texttt{'N'}: :math:\mathrm{k}; if :math:\mathrm{trans}\text{ in } (\texttt{'T'}, \texttt{'C'}): :math:n; otherwise: :math:0.

The matrix :math:A; :math:A is :math:n\times k if :math:\mathrm{trans} = \texttt{'N'}, or :math:k\times n if :math:\mathrm{trans} = \texttt{'T'} or :math:\texttt{'C'}.

**b** : float, array-like, shape :math:\left(:, :\right)
Note: the required extent for this argument in dimension 1 is determined as follows: if :math:\mathrm{trans}=\texttt{'N'}: :math:n; if :math:\mathrm{trans}\text{ in } (\texttt{'T'}, \texttt{'C'}): :math:\mathrm{k}; otherwise: :math:0.

Note: the required extent for this argument in dimension 2 is determined as follows: if :math:\mathrm{trans}=\texttt{'N'}: :math:\mathrm{k}; if :math:\mathrm{trans}\text{ in } (\texttt{'T'}, \texttt{'C'}): :math:n; otherwise: :math:0.

The matrix :math:B; :math:B is :math:n\times k if :math:\mathrm{trans} = \texttt{'N'}, or :math:k\times n if :math:\mathrm{trans} = \texttt{'T'} or :math:\texttt{'C'}.

**beta** : float
The scalar :math:\beta.

**c** : float, array-like, shape :math:\left(n, n\right)
The :math:n\times n symmetric matrix :math:C.

**Returns**
**c** : float, ndarray, shape :math:\left(n, n\right)
The updated matrix :math:C.

.. _f06yr-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{uplo}.

Constraint: :math:\mathrm{uplo} = \texttt{'U'} or :math:\texttt{'L'}.

(errno :math:2)
On entry, error in parameter :math:\mathrm{trans}.

Constraint: :math:\mathrm{trans} = \texttt{'N'}, :math:\texttt{'T'} or :math:\texttt{'C'}.

(errno :math:3)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

(errno :math:4)
On entry, error in parameter :math:\mathrm{k}.

Constraint: :math:\mathrm{k}\geq 0.

.. _f06yr-py2-py-notes:

**Notes**
In the NAG Library the traditional C interface for this routine uses a different algorithmic base. Please contact NAG if you have any questions about compatibility.
"""
raise NotImplementedError

[docs]def zgemm(transa, transb, m, k, alpha, a, b, beta, c=None):
r"""
zgemm performs one of the matrix-matrix operations

.. math::
\begin{array}{lll}C←\alpha AB+\beta C\text{,}&C←\alpha A^\mathrm{T}B+\beta C\text{,}&C←\alpha A^\mathrm{H}B+\beta C\text{,}\\C←\alpha AB^\mathrm{T}+\beta C\text{,}&C←\alpha A^\mathrm{T}B^\mathrm{T}+\beta C\text{,}&C←\alpha A^\mathrm{H}B^\mathrm{T}+\beta C\text{,}\\C←\alpha AB^\mathrm{H}+\beta C\text{,}&C←\alpha A^\mathrm{T}B^\mathrm{H}+\beta C\quad \text{ or}&C←\alpha A^\mathrm{H}B^\mathrm{H}+\beta C\text{,}\end{array}

where :math:A, :math:B and :math:C are complex matrices, and :math:\alpha and :math:\beta are complex scalars; :math:C is always :math:m\times n.

.. _f06za-py2-py-doc:

For full information please refer to the NAG Library document for f06za

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06zaf.html

.. _f06za-py2-py-parameters:

**Parameters**
**transa** : str, length 1
Specifies whether the operation involves :math:A, :math:A^\mathrm{T} or :math:A^\mathrm{H}.

:math:\mathrm{transa} = \texttt{'N'}

The operation involves :math:A.

:math:\mathrm{transa} = \texttt{'T'}

The operation involves :math:A^\mathrm{T}.

:math:\mathrm{transa} = \texttt{'C'}

The operation involves :math:A^\mathrm{H}.

**transb** : str, length 1
Specifies whether the operation involves :math:B, :math:B^\mathrm{T} or :math:B^\mathrm{H}.

:math:\mathrm{transb} = \texttt{'N'}

The operation involves :math:B.

:math:\mathrm{transb} = \texttt{'T'}

The operation involves :math:B^\mathrm{T}.

:math:\mathrm{transb} = \texttt{'C'}

The operation involves :math:B^\mathrm{H}.

**m** : int
:math:m, the number of rows of the matrix :math:C; the number of rows of :math:A if :math:\mathrm{transa} = \texttt{'N'}, or the number of columns of :math:A if :math:\mathrm{transa} = \texttt{'T'} or :math:\texttt{'C'}.

**k** : int
:math:k, the number of columns of :math:A if :math:\mathrm{transa} = \texttt{'N'}, or the number of rows of :math:A if :math:\mathrm{transa} = \texttt{'T'} or :math:\texttt{'C'}; the number of rows of :math:B if :math:\mathrm{transb} = \texttt{'N'}, or the number of columns of :math:B if :math:\mathrm{transb} = \texttt{'T'} or :math:\texttt{'C'}.

**alpha** : complex
The scalar :math:\alpha.

**a** : complex, array-like, shape :math:\left(:, :\right)
Note: the required extent for this argument in dimension 1 is determined as follows: if :math:\mathrm{transa}=\texttt{'N'}: :math:\mathrm{m}; if :math:\mathrm{transa}\text{ in } (\texttt{'T'}, \texttt{'C'}): :math:\mathrm{k}; otherwise: :math:0.

Note: the required extent for this argument in dimension 2 is determined as follows: if :math:\mathrm{transa}=\texttt{'N'}: :math:\mathrm{k}; if :math:\mathrm{transa}\text{ in } (\texttt{'T'}, \texttt{'C'}): :math:\mathrm{m}; otherwise: :math:0.

The matrix :math:A; :math:A is :math:m\times k if :math:\mathrm{transa} = \texttt{'N'}, or :math:k\times m if :math:\mathrm{transa} = \texttt{'T'} or :math:\texttt{'C'}.

**b** : complex, array-like, shape :math:\left(:, :\right)
Note: the required extent for this argument in dimension 1 is determined as follows: if :math:\mathrm{transb}=\texttt{'N'}: :math:\mathrm{k}; if :math:\mathrm{transb}\text{ in } (\texttt{'T'}, \texttt{'C'}): :math:n; otherwise: :math:0.

Note: the required extent for this argument in dimension 2 is determined as follows: if :math:\mathrm{transb}=\texttt{'N'}: :math:n; if :math:\mathrm{transb}\text{ in } (\texttt{'T'}, \texttt{'C'}): :math:\mathrm{k}; otherwise: :math:0.

The matrix :math:B; :math:B is :math:k\times n if :math:\mathrm{transb} = \texttt{'N'}, or :math:n\times k if :math:\mathrm{transb} = \texttt{'T'} or :math:\texttt{'C'}.

**beta** : complex
The scalar :math:\beta.

**c** : None or complex, array-like, shape :math:\left(\mathrm{m}, n\right), optional
The :math:m\times n matrix :math:C.

If :math:\mathrm{beta} = 0.0, :math:\mathrm{c} need not be set.

**Returns**
**c** : complex, ndarray, shape :math:\left(\mathrm{m}, n\right)
The updated matrix :math:C.

.. _f06za-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{transa}.

Constraint: :math:\mathrm{transa} = \texttt{'N'}, :math:\texttt{'T'} or :math:\texttt{'C'}.

(errno :math:2)
On entry, error in parameter :math:\mathrm{transb}.

Constraint: :math:\mathrm{transb} = \texttt{'N'}, :math:\texttt{'T'} or :math:\texttt{'C'}.

(errno :math:3)
On entry, error in parameter :math:\mathrm{m}.

Constraint: :math:\mathrm{m}\geq 0.

(errno :math:4)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

(errno :math:5)
On entry, error in parameter :math:\mathrm{k}.

Constraint: :math:\mathrm{k}\geq 0.

.. _f06za-py2-py-notes:

**Notes**
In the NAG Library the traditional C interface for this routine uses a different algorithmic base. Please contact NAG if you have any questions about compatibility.
"""
raise NotImplementedError

[docs]def zhemm(side, uplo, m, alpha, a, b, beta, c=None):
r"""
zhemm performs one of the matrix-matrix operations

.. math::

where :math:A is a complex Hermitian matrix, :math:B and :math:C are :math:m\times n complex matrices, and :math:\alpha and :math:\beta are complex scalars.

.. _f06zc-py2-py-doc:

For full information please refer to the NAG Library document for f06zc

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06zcf.html

.. _f06zc-py2-py-parameters:

**Parameters**
**side** : str, length 1
Specifies whether :math:B is operated on from the left or the right.

:math:\mathrm{side} = \texttt{'L'}

:math:B is pre-multiplied from the left.

:math:\mathrm{side} = \texttt{'R'}

:math:B is post-multiplied from the right.

**uplo** : str, length 1
Specifies whether the upper or lower triangular part of :math:A is stored.

:math:\mathrm{uplo} = \texttt{'U'}

The upper triangular part of :math:A is stored.

:math:\mathrm{uplo} = \texttt{'L'}

The lower triangular part of :math:A is stored.

**m** : int
:math:m, the number of rows of the matrices :math:B and :math:C; the order of :math:A if :math:\mathrm{side} = \texttt{'L'}.

**alpha** : complex
The scalar :math:\alpha.

**a** : complex, array-like, shape :math:\left(:, :\right)
Note: the required extent for this argument in dimension 1 is determined as follows: if :math:\mathrm{side}=\texttt{'L'}: :math:\mathrm{m}; if :math:\mathrm{side}=\texttt{'R'}: :math:n; otherwise: :math:0.

Note: the required extent for this argument in dimension 2 is determined as follows: if :math:\mathrm{side}=\texttt{'L'}: :math:\mathrm{m}; if :math:\mathrm{side}=\texttt{'R'}: :math:n; otherwise: :math:0.

The Hermitian matrix :math:A; :math:A is :math:m\times m if :math:\mathrm{side} = \texttt{'L'}, or :math:n\times n if :math:\mathrm{side} = \texttt{'R'}.

**b** : complex, array-like, shape :math:\left(\mathrm{m}, n\right)
The :math:m\times n matrix :math:B.

**beta** : complex
The scalar :math:\beta.

**c** : None or complex, array-like, shape :math:\left(\mathrm{m}, n\right), optional
The :math:m\times n matrix :math:C.

If :math:\mathrm{beta} = 0.0, :math:\mathrm{c} need not be set.

**Returns**
**c** : complex, ndarray, shape :math:\left(\mathrm{m}, n\right)
The updated matrix :math:C.

.. _f06zc-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{side}.

Constraint: :math:\mathrm{side} = \texttt{'L'} or :math:\texttt{'R'}.

(errno :math:2)
On entry, error in parameter :math:\mathrm{uplo}.

Constraint: :math:\mathrm{uplo} = \texttt{'U'} or :math:\texttt{'L'}.

(errno :math:3)
On entry, error in parameter :math:\mathrm{m}.

Constraint: :math:\mathrm{m}\geq 0.

(errno :math:4)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

.. _f06zc-py2-py-notes:

**Notes**
In the NAG Library the traditional C interface for this routine uses a different algorithmic base. Please contact NAG if you have any questions about compatibility.
"""
raise NotImplementedError

[docs]def ztrmm(side, uplo, transa, diag, m, alpha, a, b):
r"""
ztrmm performs one of the matrix-matrix operations

.. math::
\begin{array}{lll}B←\alpha AB\text{,}&B←\alpha A^\mathrm{T}B\text{,}&B←\alpha A^\mathrm{H}B\text{,}\\B←\alpha BA\text{,}&B←\alpha BA^\mathrm{T}\quad \text{ or}&B←\alpha BA^\mathrm{H}\text{,}\end{array}

where :math:B is an :math:m\times n complex matrix, :math:A is a complex triangular matrix, and :math:\alpha is a complex scalar.

.. _f06zf-py2-py-doc:

For full information please refer to the NAG Library document for f06zf

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06zff.html

.. _f06zf-py2-py-parameters:

**Parameters**
**side** : str, length 1
Specifies whether :math:B is operated on from the left or the right.

:math:\mathrm{side} = \texttt{'L'}

:math:B is pre-multiplied from the left.

:math:\mathrm{side} = \texttt{'R'}

:math:B is post-multiplied from the right.

**uplo** : str, length 1
Specifies whether :math:A is upper or lower triangular.

:math:\mathrm{uplo} = \texttt{'U'}

:math:A is upper triangular.

:math:\mathrm{uplo} = \texttt{'L'}

:math:A is lower triangular.

**transa** : str, length 1
Specifies whether the operation involves :math:A, :math:A^\mathrm{T} or :math:A^\mathrm{H}.

:math:\mathrm{transa} = \texttt{'N'}

The operation involves :math:A.

:math:\mathrm{transa} = \texttt{'T'}

The operation involves :math:A^\mathrm{T}.

:math:\mathrm{transa} = \texttt{'C'}

The operation involves :math:A^\mathrm{H}.

**diag** : str, length 1
Specifies whether :math:A has nonunit or unit diagonal elements.

:math:\mathrm{diag} = \texttt{'N'}

The diagonal elements are stored explicitly.

:math:\mathrm{diag} = \texttt{'U'}

The diagonal elements are assumed to be :math:1, and are not referenced.

**m** : int
:math:m, the number of rows of the matrix :math:B; the order of :math:A if :math:\mathrm{side} = \texttt{'L'}.

**alpha** : complex
The scalar :math:\alpha.

**a** : complex, array-like, shape :math:\left(:, :\right)
Note: the required extent for this argument in dimension 1 is determined as follows: if :math:\mathrm{side}=\texttt{'L'}: :math:\mathrm{m}; if :math:\mathrm{side}=\texttt{'R'}: :math:n; otherwise: :math:0.

Note: the required extent for this argument in dimension 2 is determined as follows: if :math:\mathrm{side}=\texttt{'L'}: :math:\mathrm{m}; if :math:\mathrm{side}=\texttt{'R'}: :math:n; otherwise: :math:0.

The triangular matrix :math:A; :math:A is :math:m\times m if :math:\mathrm{side} = \texttt{'L'}, or :math:n\times n if :math:\mathrm{side} = \texttt{'R'}.

**b** : complex, array-like, shape :math:\left(\mathrm{m}, n\right)
The :math:m\times n matrix :math:B.

If :math:\mathrm{alpha} = 0, :math:\mathrm{b} need not be set.

**Returns**
**b** : complex, ndarray, shape :math:\left(\mathrm{m}, n\right)
The updated matrix :math:B.

.. _f06zf-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{side}.

Constraint: :math:\mathrm{side} = \texttt{'L'} or :math:\texttt{'R'}.

(errno :math:2)
On entry, error in parameter :math:\mathrm{uplo}.

Constraint: :math:\mathrm{uplo} = \texttt{'U'} or :math:\texttt{'L'}.

(errno :math:3)
On entry, error in parameter :math:\mathrm{transa}.

Constraint: :math:\mathrm{transa} = \texttt{'N'}, :math:\texttt{'T'} or :math:\texttt{'C'}.

(errno :math:4)
On entry, error in parameter :math:\mathrm{diag}.

Constraint: :math:\mathrm{diag} = \texttt{'N'} or :math:\texttt{'U'}.

(errno :math:5)
On entry, error in parameter :math:\mathrm{m}.

Constraint: :math:\mathrm{m}\geq 0.

(errno :math:6)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

.. _f06zf-py2-py-notes:

**Notes**
In the NAG Library the traditional C interface for this routine uses a different algorithmic base. Please contact NAG if you have any questions about compatibility.
"""
raise NotImplementedError

[docs]def ztrsm(side, uplo, transa, diag, m, alpha, a, b):
r"""
ztrsm performs one of the matrix-matrix operations

.. math::
\begin{array}{lll} B←\alpha A^{-1}B \text{,} & B←\alpha A^{-\mathrm{T}}B \text{,} & B←\alpha A^{-\mathrm{H}}B \text{,} \\ B←\alpha BA^{-1} \text{,} & B←\alpha BA^{-\mathrm{T}} \quad \text{ or} & B←\alpha BA^{-\mathrm{H}} \text{,} \end{array}

where :math:A is a complex triangular matrix, :math:B is an :math:m\times n complex matrix, and :math:\alpha is a complex scalar. :math:A^{-\mathrm{T}} denotes :math:\left(A^\mathrm{T}\right)^{-1} or equivalently :math:\left(A^{-1}\right)^\mathrm{T}; :math:A^{-\mathrm{H}} denotes :math:\left(A^\mathrm{H}\right)^{-1} or equivalently :math:\left(A^{-1}\right)^\mathrm{H}.

No test for singularity or near-singularity of :math:A is included in this function.
Such tests must be performed before calling this function.

.. _f06zj-py2-py-doc:

For full information please refer to the NAG Library document for f06zj

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06zjf.html

.. _f06zj-py2-py-parameters:

**Parameters**
**side** : str, length 1
Specifies whether :math:B is operated on from the left or the right.

:math:\mathrm{side} = \texttt{'L'}

:math:B is pre-multiplied from the left.

:math:\mathrm{side} = \texttt{'R'}

:math:B is post-multiplied from the right.

**uplo** : str, length 1
Specifies whether :math:A is upper or lower triangular.

:math:\mathrm{uplo} = \texttt{'U'}

:math:A is upper triangular.

:math:\mathrm{uplo} = \texttt{'L'}

:math:A is lower triangular.

**transa** : str, length 1
Specifies whether the operation involves :math:A^{-1}, :math:A^{-\mathrm{T}} or :math:A^{-\mathrm{H}}.

:math:\mathrm{transa} = \texttt{'N'}

The operation involves :math:A^{-1}.

:math:\mathrm{transa} = \texttt{'T'}

The operation involves :math:A^{-\mathrm{T}}.

:math:\mathrm{transa} = \texttt{'C'}

The operation involves :math:A^{-\mathrm{H}}.

**diag** : str, length 1
Specifies whether :math:A has nonunit or unit diagonal elements.

:math:\mathrm{diag} = \texttt{'N'}

The diagonal elements are stored explicitly.

:math:\mathrm{diag} = \texttt{'U'}

The diagonal elements are assumed to be :math:1, and are not referenced.

**m** : int
:math:m, the number of rows of the matrix :math:B; the order of :math:A if :math:\mathrm{side} = \texttt{'L'}.

**alpha** : complex
The scalar :math:\alpha.

**a** : complex, array-like, shape :math:\left(:, :\right)
Note: the required extent for this argument in dimension 1 is determined as follows: if :math:\mathrm{side}=\texttt{'L'}: :math:\mathrm{m}; if :math:\mathrm{side}=\texttt{'R'}: :math:n; otherwise: :math:0.

Note: the required extent for this argument in dimension 2 is determined as follows: if :math:\mathrm{side}=\texttt{'L'}: :math:\mathrm{m}; if :math:\mathrm{side}=\texttt{'R'}: :math:n; otherwise: :math:0.

The triangular matrix :math:A; :math:A is :math:m\times m if :math:\mathrm{side} = \texttt{'L'}, or :math:n\times n if :math:\mathrm{side} = \texttt{'R'}.

**b** : complex, array-like, shape :math:\left(\mathrm{m}, n\right)
The :math:m\times n matrix :math:B.

If :math:\mathrm{alpha} = 0, :math:\mathrm{b} need not be set.

**Returns**
**b** : complex, ndarray, shape :math:\left(\mathrm{m}, n\right)
The updated matrix :math:B.

.. _f06zj-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{side}.

Constraint: :math:\mathrm{side} = \texttt{'L'} or :math:\texttt{'R'}.

(errno :math:2)
On entry, error in parameter :math:\mathrm{uplo}.

Constraint: :math:\mathrm{uplo} = \texttt{'U'} or :math:\texttt{'L'}.

(errno :math:3)
On entry, error in parameter :math:\mathrm{transa}.

Constraint: :math:\mathrm{transa} = \texttt{'N'}, :math:\texttt{'T'} or :math:\texttt{'C'}.

(errno :math:4)
On entry, error in parameter :math:\mathrm{diag}.

Constraint: :math:\mathrm{diag} = \texttt{'N'} or :math:\texttt{'U'}.

(errno :math:5)
On entry, error in parameter :math:\mathrm{m}.

Constraint: :math:\mathrm{m}\geq 0.

(errno :math:6)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

.. _f06zj-py2-py-notes:

**Notes**
In the NAG Library the traditional C interface for this routine uses a different algorithmic base. Please contact NAG if you have any questions about compatibility.
"""
raise NotImplementedError

[docs]def zherk(uplo, trans, k, alpha, a, beta, c):
r"""
zherk performs one of the Hermitian rank-:math:k update operations

.. math::

where :math:A is a complex matrix, :math:C is an :math:n\times n complex Hermitian matrix, and :math:\alpha and :math:\beta are real scalars.

.. _f06zp-py2-py-doc:

For full information please refer to the NAG Library document for f06zp

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06zpf.html

.. _f06zp-py2-py-parameters:

**Parameters**
**uplo** : str, length 1
Specifies whether the upper or lower triangular part of :math:C is stored.

:math:\mathrm{uplo} = \texttt{'U'}

The upper triangular part of :math:C is stored.

:math:\mathrm{uplo} = \texttt{'L'}

The lower triangular part of :math:C is stored.

**trans** : str, length 1
Specifies the operation to be performed.

:math:\mathrm{trans} = \texttt{'N'}

:math:C←\alpha AA^\mathrm{H}+\beta C.

:math:\mathrm{trans} = \texttt{'C'}

:math:C←\alpha A^\mathrm{H}A+\beta C.

**k** : int
:math:k, the number of columns of :math:A if :math:\mathrm{trans} = \texttt{'N'}, or the number of rows of :math:A if :math:\mathrm{trans} = \texttt{'C'}.

**alpha** : float
The scalar :math:\alpha.

**a** : complex, array-like, shape :math:\left(:, :\right)
Note: the required extent for this argument in dimension 1 is determined as follows: if :math:\mathrm{trans}=\texttt{'N'}: :math:n; if :math:\mathrm{trans}=\texttt{'C'}: :math:\mathrm{k}; otherwise: :math:0.

Note: the required extent for this argument in dimension 2 is determined as follows: if :math:\mathrm{trans}=\texttt{'N'}: :math:\mathrm{k}; if :math:\mathrm{trans}=\texttt{'C'}: :math:n; otherwise: :math:0.

The matrix :math:A; :math:A is :math:n\times k if :math:\mathrm{trans} = \texttt{'N'}, or :math:k\times n if :math:\mathrm{trans} = \texttt{'C'}.

**beta** : float
The scalar :math:\beta.

**c** : complex, array-like, shape :math:\left(n, n\right)
The :math:n\times n Hermitian matrix :math:C.

**Returns**
**c** : complex, ndarray, shape :math:\left(n, n\right)
The updated matrix :math:C. The imaginary parts of the diagonal elements are set to zero.

.. _f06zp-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{uplo}.

Constraint: :math:\mathrm{uplo} = \texttt{'U'} or :math:\texttt{'L'}.

(errno :math:2)
On entry, error in parameter :math:\mathrm{trans}.

Constraint: :math:\mathrm{trans} = \texttt{'N'} or :math:\texttt{'C'}.

(errno :math:3)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

(errno :math:4)
On entry, error in parameter :math:\mathrm{k}.

Constraint: :math:\mathrm{k}\geq 0.

.. _f06zp-py2-py-notes:

**Notes**
In the NAG Library the traditional C interface for this routine uses a different algorithmic base. Please contact NAG if you have any questions about compatibility.
"""
raise NotImplementedError

[docs]def zher2k(uplo, trans, k, alpha, a, b, beta, c):
r"""
zher2k performs one of the Hermitian rank-:math:2k update operations

.. math::

where :math:A and :math:B are complex matrices, :math:C is an :math:n\times n complex Hermitian matrix, :math:\alpha is a complex scalar, and :math:\beta is a real scalar.

.. _f06zr-py2-py-doc:

For full information please refer to the NAG Library document for f06zr

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06zrf.html

.. _f06zr-py2-py-parameters:

**Parameters**
**uplo** : str, length 1
Specifies whether the upper or lower triangular part of :math:C is stored.

:math:\mathrm{uplo} = \texttt{'U'}

The upper triangular part of :math:C is stored.

:math:\mathrm{uplo} = \texttt{'L'}

The lower triangular part of :math:C is stored.

**trans** : str, length 1
Specifies the operation to be performed.

:math:\mathrm{trans} = \texttt{'N'}

:math:C←\alpha AB^\mathrm{H}+\bar{\alpha }BA^\mathrm{H}+\beta C.

:math:\mathrm{trans} = \texttt{'C'}

:math:C←\alpha A^\mathrm{H}B+\bar{\alpha }B^\mathrm{H}A+\beta C.

**k** : int
:math:k, the number of columns of :math:A if :math:\mathrm{trans} = \texttt{'N'}, or the number of rows of :math:A if :math:\mathrm{trans} = \texttt{'C'}.

**alpha** : complex
The scalar :math:\alpha.

**a** : complex, array-like, shape :math:\left(:, :\right)
Note: the required extent for this argument in dimension 1 is determined as follows: if :math:\mathrm{trans}=\texttt{'N'}: :math:n; if :math:\mathrm{trans}=\texttt{'C'}: :math:\mathrm{k}; otherwise: :math:0.

Note: the required extent for this argument in dimension 2 is determined as follows: if :math:\mathrm{trans}=\texttt{'N'}: :math:\mathrm{k}; if :math:\mathrm{trans}=\texttt{'C'}: :math:n; otherwise: :math:0.

The matrix :math:A; :math:A is :math:n\times k if :math:\mathrm{trans} = \texttt{'N'}, or :math:k\times n if :math:\mathrm{trans} = \texttt{'C'}.

**b** : complex, array-like, shape :math:\left(:, :\right)
Note: the required extent for this argument in dimension 1 is determined as follows: if :math:\mathrm{trans}=\texttt{'N'}: :math:n; if :math:\mathrm{trans}=\texttt{'C'}: :math:\mathrm{k}; otherwise: :math:0.

Note: the required extent for this argument in dimension 2 is determined as follows: if :math:\mathrm{trans}=\texttt{'N'}: :math:\mathrm{k}; if :math:\mathrm{trans}=\texttt{'C'}: :math:n; otherwise: :math:0.

The matrix :math:B; :math:B is :math:n\times k if :math:\mathrm{trans} = \texttt{'N'}, or :math:k\times n if :math:\mathrm{trans} = \texttt{'C'}.

**beta** : float
The scalar :math:\beta.

**c** : complex, array-like, shape :math:\left(n, n\right)
The :math:n\times n Hermitian matrix :math:C.

**Returns**
**c** : complex, ndarray, shape :math:\left(n, n\right)
The updated matrix :math:C. The imaginary parts of the diagonal elements are set to zero.

.. _f06zr-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{uplo}.

Constraint: :math:\mathrm{uplo} = \texttt{'U'} or :math:\texttt{'L'}.

(errno :math:2)
On entry, error in parameter :math:\mathrm{trans}.

Constraint: :math:\mathrm{trans} = \texttt{'N'} or :math:\texttt{'C'}.

(errno :math:3)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

(errno :math:4)
On entry, error in parameter :math:\mathrm{k}.

Constraint: :math:\mathrm{k}\geq 0.

.. _f06zr-py2-py-notes:

**Notes**
In the NAG Library the traditional C interface for this routine uses a different algorithmic base. Please contact NAG if you have any questions about compatibility.
"""
raise NotImplementedError

[docs]def zsymm(side, uplo, m, alpha, a, b, beta, c=None):
r"""
zsymm performs one of the matrix-matrix operations

.. math::

where :math:A is a complex symmetric matrix, :math:B and :math:C are :math:m\times n complex matrices, and :math:\alpha and :math:\beta are complex scalars.

.. _f06zt-py2-py-doc:

For full information please refer to the NAG Library document for f06zt

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06ztf.html

.. _f06zt-py2-py-parameters:

**Parameters**
**side** : str, length 1
Specifies whether :math:B is operated on from the left or the right.

:math:\mathrm{side} = \texttt{'L'}

:math:B is pre-multiplied from the left.

:math:\mathrm{side} = \texttt{'R'}

:math:B is post-multiplied from the right.

**uplo** : str, length 1
Specifies whether the upper or lower triangular part of :math:A is stored.

:math:\mathrm{uplo} = \texttt{'U'}

The upper triangular part of :math:A is stored.

:math:\mathrm{uplo} = \texttt{'L'}

The lower triangular part of :math:A is stored.

**m** : int
:math:m, the number of rows of the matrices :math:B and :math:C; the order of :math:A if :math:\mathrm{side} = \texttt{'L'}.

**alpha** : complex
The scalar :math:\alpha.

**a** : complex, array-like, shape :math:\left(:, :\right)
Note: the required extent for this argument in dimension 1 is determined as follows: if :math:\mathrm{side}=\texttt{'L'}: :math:\mathrm{m}; if :math:\mathrm{side}=\texttt{'R'}: :math:n; otherwise: :math:0.

Note: the required extent for this argument in dimension 2 is determined as follows: if :math:\mathrm{side}=\texttt{'L'}: :math:\mathrm{m}; if :math:\mathrm{side}=\texttt{'R'}: :math:n; otherwise: :math:0.

The symmetric matrix :math:A; :math:A is :math:m\times m if :math:\mathrm{side} = \texttt{'L'}, or :math:n\times n if :math:\mathrm{side} = \texttt{'R'}.

**b** : complex, array-like, shape :math:\left(\mathrm{m}, n\right)
The :math:m\times n matrix :math:B.

**beta** : complex
The scalar :math:\beta.

**c** : None or complex, array-like, shape :math:\left(\mathrm{m}, n\right), optional
The :math:m\times n matrix :math:C.

If :math:\mathrm{beta} = 0.0, :math:\mathrm{c} need not be set.

**Returns**
**c** : complex, ndarray, shape :math:\left(\mathrm{m}, n\right)
The updated matrix :math:C.

.. _f06zt-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{side}.

Constraint: :math:\mathrm{side} = \texttt{'L'} or :math:\texttt{'R'}.

(errno :math:2)
On entry, error in parameter :math:\mathrm{uplo}.

Constraint: :math:\mathrm{uplo} = \texttt{'U'} or :math:\texttt{'L'}.

(errno :math:3)
On entry, error in parameter :math:\mathrm{m}.

Constraint: :math:\mathrm{m}\geq 0.

(errno :math:4)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

.. _f06zt-py2-py-notes:

**Notes**
In the NAG Library the traditional C interface for this routine uses a different algorithmic base. Please contact NAG if you have any questions about compatibility.
"""
raise NotImplementedError

[docs]def zsyrk(uplo, trans, k, alpha, a, beta, c):
r"""
zsyrk performs one of the symmetric rank-:math:k update operations

.. math::

where :math:A is a complex matrix, :math:C is an :math:n\times n complex symmetric matrix, and :math:\alpha and :math:\beta are complex scalars.

.. _f06zu-py2-py-doc:

For full information please refer to the NAG Library document for f06zu

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06zuf.html

.. _f06zu-py2-py-parameters:

**Parameters**
**uplo** : str, length 1
Specifies whether the upper or lower triangular part of :math:C is stored.

:math:\mathrm{uplo} = \texttt{'U'}

The upper triangular part of :math:C is stored.

:math:\mathrm{uplo} = \texttt{'L'}

The lower triangular part of :math:C is stored.

**trans** : str, length 1
Specifies the operation to be performed.

:math:\mathrm{trans} = \texttt{'N'}

:math:C←\alpha AA^\mathrm{T}+\beta C.

:math:\mathrm{trans} = \texttt{'T'}

:math:C←\alpha A^\mathrm{T}A+\beta C.

**k** : int
:math:k, the number of columns of :math:A and :math:B if :math:\mathrm{trans} = \texttt{'N'}, or the number of rows of :math:A and :math:B if :math:\mathrm{trans} = \texttt{'T'}.

**alpha** : complex
The scalar :math:\alpha.

**a** : complex, array-like, shape :math:\left(:, :\right)
Note: the required extent for this argument in dimension 1 is determined as follows: if :math:\mathrm{trans}=\texttt{'N'}: :math:n; if :math:\mathrm{trans}=\texttt{'T'}: :math:\mathrm{k}; otherwise: :math:0.

Note: the required extent for this argument in dimension 2 is determined as follows: if :math:\mathrm{trans}=\texttt{'N'}: :math:\mathrm{k}; if :math:\mathrm{trans}=\texttt{'T'}: :math:n; otherwise: :math:0.

The matrix :math:A; :math:A is :math:n\times k if :math:\mathrm{trans} = \texttt{'N'}, or :math:k\times n if :math:\mathrm{trans} = \texttt{'T'}.

**beta** : complex
The scalar :math:\beta.

**c** : complex, array-like, shape :math:\left(n, n\right)
The :math:n\times n symmetric matrix :math:C.

**Returns**
**c** : complex, ndarray, shape :math:\left(n, n\right)
The updated matrix :math:C.

.. _f06zu-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{uplo}.

Constraint: :math:\mathrm{uplo} = \texttt{'U'} or :math:\texttt{'L'}.

(errno :math:2)
On entry, error in parameter :math:\mathrm{trans}.

Constraint: :math:\mathrm{trans} = \texttt{'N'} or :math:\texttt{'T'}.

(errno :math:3)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

(errno :math:4)
On entry, error in parameter :math:\mathrm{k}.

Constraint: :math:\mathrm{k}\geq 0.

.. _f06zu-py2-py-notes:

**Notes**
In the NAG Library the traditional C interface for this routine uses a different algorithmic base. Please contact NAG if you have any questions about compatibility.
"""
raise NotImplementedError

[docs]def zsyr2k(uplo, trans, k, alpha, a, b, beta, c):
r"""
zsyr2k performs one of the symmetric rank-:math:2k update operations

.. math::

where :math:A and :math:B are complex matrices, :math:C is an :math:n\times n complex symmetric matrix, and :math:\alpha and :math:\beta are complex scalars.

.. _f06zw-py2-py-doc:

For full information please refer to the NAG Library document for f06zw

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f06/f06zwf.html

.. _f06zw-py2-py-parameters:

**Parameters**
**uplo** : str, length 1
Specifies whether the upper or lower triangular part of :math:C is stored.

:math:\mathrm{uplo} = \texttt{'U'}

The upper triangular part of :math:C is stored.

:math:\mathrm{uplo} = \texttt{'L'}

The lower triangular part of :math:C is stored.

**trans** : str, length 1
Specifies the operation to be performed.

:math:\mathrm{trans} = \texttt{'N'}

:math:C←\alpha AB^\mathrm{T}+\alpha BA^\mathrm{T}+\beta C.

:math:\mathrm{trans} = \texttt{'T'}

:math:C←\alpha A^\mathrm{T}B+\alpha B^\mathrm{T}A+\beta C.

**k** : int
:math:k, the number of columns of :math:A and :math:B if :math:\mathrm{trans} = \texttt{'N'}, or the number of rows of :math:A and :math:B if :math:\mathrm{trans} = \texttt{'T'}.

**alpha** : complex
The scalar :math:\alpha.

**a** : complex, array-like, shape :math:\left(:, :\right)
Note: the required extent for this argument in dimension 1 is determined as follows: if :math:\mathrm{trans}=\texttt{'N'}: :math:n; if :math:\mathrm{trans}=\texttt{'T'}: :math:\mathrm{k}; otherwise: :math:0.

Note: the required extent for this argument in dimension 2 is determined as follows: if :math:\mathrm{trans}=\texttt{'N'}: :math:\mathrm{k}; if :math:\mathrm{trans}=\texttt{'T'}: :math:n; otherwise: :math:0.

The matrix :math:A; :math:A is :math:n\times k if :math:\mathrm{trans} = \texttt{'N'}, or :math:k\times n if :math:\mathrm{trans} = \texttt{'T'}.

**b** : complex, array-like, shape :math:\left(:, :\right)
Note: the required extent for this argument in dimension 1 is determined as follows: if :math:\mathrm{trans}=\texttt{'N'}: :math:n; if :math:\mathrm{trans}=\texttt{'T'}: :math:\mathrm{k}; otherwise: :math:0.

Note: the required extent for this argument in dimension 2 is determined as follows: if :math:\mathrm{trans}=\texttt{'N'}: :math:\mathrm{k}; if :math:\mathrm{trans}=\texttt{'T'}: :math:n; otherwise: :math:0.

The matrix :math:B; :math:B is :math:n\times k if :math:\mathrm{trans} = \texttt{'N'}, or :math:k\times n if :math:\mathrm{trans} = \texttt{'T'}.

**beta** : complex
The scalar :math:\beta.

**c** : complex, array-like, shape :math:\left(n, n\right)
The :math:n\times n symmetric matrix :math:C.

**Returns**
**c** : complex, ndarray, shape :math:\left(n, n\right)
The updated matrix :math:C.

.. _f06zw-py2-py-errors:

**Raises**
**NagValueError**
(errno :math:1)
On entry, error in parameter :math:\mathrm{uplo}.

Constraint: :math:\mathrm{uplo} = \texttt{'U'} or :math:\texttt{'L'}.

(errno :math:2)
On entry, error in parameter :math:\mathrm{trans}.

Constraint: :math:\mathrm{trans} = \texttt{'N'} or :math:\texttt{'T'}.

(errno :math:3)
On entry, error in parameter :math:\textit{n}.

Constraint: :math:n\geq 0.

(errno :math:4)
On entry, error in parameter :math:\mathrm{k}.

Constraint: :math:\mathrm{k}\geq 0.

.. _f06zw-py2-py-notes:

**Notes**
In the NAG Library the traditional C interface for this routine uses a different algorithmic base. Please contact NAG if you have any questions about compatibility.
"""
raise NotImplementedError