Source code for naginterfaces.library.blast

# -*- coding: utf-8 -*-
r"""
Module Summary
--------------
Interfaces for the NAG Mark 30.2 `blast` Chapter.

``blast`` - Further Linear Algebra Support Routines

This module is concerned with basic linear algebra functions which perform elementary algebraic operations involving scalars, vectors and matrices.
Most functions for such operations conform either to the specifications of the BLAS (Basic Linear Algebra Subprograms) or to the specifications of the BLAST (Basic Linear Algebra Subprograms Technical) Forum.
This module includes functions from the BLAST specifications. Most (BLAS) functions for such operations are available in submodule :mod:`~naginterfaces.library.blas`.

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

**Matrix-vector operations**

  complex matrix and vector(s)

    compute a norm or the element of largest absolute value

      band matrix: :meth:`zgb_norm`

  real matrix and vector(s)

    compute a norm or the element of largest absolute value

      band matrix: :meth:`dgb_norm`

**Scalar and vector operations**

  complex vector(s)

    maximum absolute value and location: :meth:`zamax_val`

    minimum absolute value and location: :meth:`zamin_val`

    sum of elements: :meth:`zsum`

    sum of two scaled vectors: :meth:`zaxpby`

    sum of two scaled vectors preserving input: :meth:`zwaxpby`

  integer vector(s)

    maximum absolute value and location: :meth:`iamax_val`

    maximum value and location: :meth:`imax_val`

    minimum absolute value and location: :meth:`iamin_val`

    minimum value and location: :meth:`imin_val`

    sum of elements: :meth:`isum`

  real vector(s)

    dot product of two vectors with optional scaling and accumulation: :meth:`ddot`

    maximum absolute value and location: :meth:`damax_val`

    maximum value and location: :meth:`dmax_val`

    minimum absolute value and location: :meth:`damin_val`

    minimum value and location: :meth:`dmin_val`

    sum of elements: :meth:`dsum`

    sum of two scaled vectors: :meth:`daxpby`

    sum of two scaled vectors preserving input: :meth:`dwaxpby`

For full information please refer to the NAG Library document

https://support.nag.com/numeric/nl/nagdoc_30.2/flhtml/f16/f16intro.html
"""

# NAG Copyright 2017-2024.

[docs]def isum(x): r""" ``isum`` sums the elements of an integer vector. .. _f16dl-py2-py-doc: For full information please refer to the NAG Library document for f16dl https://support.nag.com/numeric/nl/nagdoc_30.2/flhtml/f16/f16dlf.html .. _f16dl-py2-py-parameters: **Parameters** **x** : int, array-like, shape :math:`\left(n\right)` The :math:`n`-element vector :math:`x`. If :math:`\textit{incx} < 0`, :math:`x_{\textit{i}}` must be stored in :math:`\mathrm{x}[\left(n-\textit{i}\right)\times \left\lvert \textit{incx}\right\rvert ]`, for :math:`\textit{i} = 1,2,\ldots,n`. If :math:`n = 0`, :math:`\mathrm{x}` is not referenced. **Returns** **sumx** : int The sum of the elements of :math:`x`. .. _f16dl-py2-py-errors: **Raises** **NagValueError** (`errno` :math:`-3`) On entry, error in parameter :math:`\textit{incx}`. Constraint: :math:`\textit{incx}\neq 0`. .. _f16dl-py2-py-notes: **Notes** ``isum`` returns the sum .. math:: x_1+x_2 + \cdots +x_n of the elements of an :math:`n`-element integer vector :math:`x`. If :math:`n\leq 0` on entry, ``isum`` immediately returns the value :math:`0`. .. _f16dl-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 """ raise NotImplementedError
[docs]def imax_val(x): r""" ``imax_val`` computes the largest component of an integer vector, along with the index of that component. .. _f16dn-py2-py-doc: For full information please refer to the NAG Library document for f16dn https://support.nag.com/numeric/nl/nagdoc_30.2/flhtml/f16/f16dnf.html .. _f16dn-py2-py-parameters: **Parameters** **x** : int, array-like, shape :math:`\left(n\right)` The :math:`n`-element vector :math:`x`. If :math:`\textit{incx} < 0`, :math:`x_{\textit{i}}` must be stored in :math:`\mathrm{x}[\left(n-\textit{i}\right)\times \left\lvert \textit{incx}\right\rvert ]`, for :math:`\textit{i} = 1,2,\ldots,n`. If :math:`n = 0`, :math:`\mathrm{x}` is not referenced. **Returns** **k** : int Note: this argument represents an array index; the value returned will be base-1. :math:`k`, the index, from the set :math:`\left\{1, 2, \ldots, n\right\}`, of the largest component of :math:`x`. If :math:`n\leq 0` on input then :math:`\mathrm{k}` is returned as :math:`0`. **i** : int :math:`i`, the largest component of :math:`x`. If :math:`n\leq 0` on input then :math:`\mathrm{i}` is returned as :math:`0`. .. _f16dn-py2-py-errors: **Raises** **NagValueError** (`errno` :math:`-3`) On entry, error in parameter :math:`\textit{incx}`. Constraint: :math:`\textit{incx}\neq 0`. .. _f16dn-py2-py-notes: **Notes** ``imax_val`` computes the largest component, :math:`i`, of an :math:`n`-element integer vector :math:`x`, and determines the smallest index, :math:`k`, such that .. math:: i = x_k = \mathrm{max}_jx_j\text{.} .. _f16dn-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 """ raise NotImplementedError
[docs]def imin_val(x): r""" ``imin_val`` computes the smallest component of an integer vector, along with the index of that component. .. _f16dp-py2-py-doc: For full information please refer to the NAG Library document for f16dp https://support.nag.com/numeric/nl/nagdoc_30.2/flhtml/f16/f16dpf.html .. _f16dp-py2-py-parameters: **Parameters** **x** : int, array-like, shape :math:`\left(n\right)` The :math:`n`-element vector :math:`x`. If :math:`\textit{incx} < 0`, :math:`x_{\textit{i}}` must be stored in :math:`\mathrm{x}[\left(n-\textit{i}\right)\times \left\lvert \textit{incx}\right\rvert ]`, for :math:`\textit{i} = 1,2,\ldots,n`. If :math:`n = 0`, :math:`\mathrm{x}` is not referenced. **Returns** **k** : int Note: this argument represents an array index; the value returned will be base-1. :math:`k`, the index, from the set :math:`\left\{1, 2, \ldots, n\right\}`, of the smallest component of :math:`x`. If :math:`n\leq 0` on input then :math:`\mathrm{k}` is returned as :math:`0`. **i** : int :math:`i`, the smallest component of :math:`x`. If :math:`n\leq 0` on input then :math:`\mathrm{i}` is returned as :math:`0`. .. _f16dp-py2-py-errors: **Raises** **NagValueError** (`errno` :math:`-3`) On entry, error in parameter :math:`\textit{incx}`. Constraint: :math:`\textit{incx}\neq 0`. .. _f16dp-py2-py-notes: **Notes** ``imin_val`` computes the smallest component, :math:`i`, of an :math:`n`-element integer vector :math:`x`, and determines the smallest index, :math:`k`, such that .. math:: i = x_k = \mathrm{min}_jx_j\text{.} .. _f16dp-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 """ raise NotImplementedError
[docs]def iamax_val(x): r""" ``iamax_val`` computes, with respect to absolute value, the largest component of an integer vector, along with the index of that component. .. _f16dq-py2-py-doc: For full information please refer to the NAG Library document for f16dq https://support.nag.com/numeric/nl/nagdoc_30.2/flhtml/f16/f16dqf.html .. _f16dq-py2-py-parameters: **Parameters** **x** : int, array-like, shape :math:`\left(n\right)` The :math:`n`-element vector :math:`x`. If :math:`\textit{incx} < 0`, :math:`x_{\textit{i}}` must be stored in :math:`\mathrm{x}[\left(n-\textit{i}\right)\times \left\lvert \textit{incx}\right\rvert ]`, for :math:`\textit{i} = 1,2,\ldots,n`. If :math:`n = 0`, :math:`\mathrm{x}` is not referenced. **Returns** **k** : int Note: this argument represents an array index; the value returned will be base-1. :math:`k`, the index, from the set :math:`\left\{1, 2, \ldots, n\right\}`, of the largest component of :math:`x` with respect to absolute value. If :math:`n\leq 0` on input then :math:`\mathrm{k}` is returned as :math:`0`. **i** : int :math:`i`, the largest component of :math:`x` with respect to absolute value. If :math:`n\leq 0` on input then :math:`\mathrm{i}` is returned as :math:`0`. .. _f16dq-py2-py-errors: **Raises** **NagValueError** (`errno` :math:`-3`) On entry, error in parameter :math:`\textit{incx}`. Constraint: :math:`\textit{incx}\neq 0`. .. _f16dq-py2-py-notes: **Notes** ``iamax_val`` computes, with respect to absolute value, the largest component, :math:`i`, of an :math:`n`-element integer vector :math:`x`, and determines the smallest index, :math:`k`, such that .. math:: i = \left\lvert x_k\right\rvert = \mathrm{max}_j\left\lvert x_j\right\rvert \text{.} .. _f16dq-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 """ raise NotImplementedError
[docs]def iamin_val(x): r""" ``iamin_val`` computes, with respect to absolute value, the smallest component of an integer vector, along with the index of that component. .. _f16dr-py2-py-doc: For full information please refer to the NAG Library document for f16dr https://support.nag.com/numeric/nl/nagdoc_30.2/flhtml/f16/f16drf.html .. _f16dr-py2-py-parameters: **Parameters** **x** : int, array-like, shape :math:`\left(n\right)` The :math:`n`-element vector :math:`x`. If :math:`\textit{incx} < 0`, :math:`x_{\textit{i}}` must be stored in :math:`\mathrm{x}[\left(n-\textit{i}\right)\times \left\lvert \textit{incx}\right\rvert ]`, for :math:`\textit{i} = 1,2,\ldots,n`. If :math:`n = 0`, :math:`\mathrm{x}` is not referenced. **Returns** **k** : int Note: this argument represents an array index; the value returned will be base-1. :math:`k`, the index, from the set :math:`\left\{1, 2, \ldots, n\right\}`, of the smallest component of :math:`x` with respect to absolute value. If :math:`n\leq 0` on input then :math:`\mathrm{k}` is returned as :math:`0`. **i** : int :math:`i`, the smallest component of :math:`x` with respect to absolute value. If :math:`n\leq 0` on input then :math:`\mathrm{i}` is returned as :math:`0`. .. _f16dr-py2-py-errors: **Raises** **NagValueError** (`errno` :math:`-3`) On entry, error in parameter :math:`\textit{incx}`. Constraint: :math:`\textit{incx}\neq 0`. .. _f16dr-py2-py-notes: **Notes** ``iamin_val`` computes, with respect to absolute value, the smallest component, :math:`i`, of an :math:`n`-element integer vector :math:`x`, and determines the smallest index, :math:`k`, such that .. math:: i = \left\lvert x_k\right\rvert = \mathrm{min}_j\left\lvert x_j\right\rvert \text{.} .. _f16dr-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 """ raise NotImplementedError
[docs]def ddot(conj, alpha, x, beta, y, r): r""" ``ddot`` updates a scalar by a scaled dot product of two real vectors. .. _f16ea-py2-py-doc: For full information please refer to the NAG Library document for f16ea https://support.nag.com/numeric/nl/nagdoc_30.2/flhtml/f16/f16eaf.html .. _f16ea-py2-py-parameters: **Parameters** **conj** : int :math:`\mathrm{conj}` is not referenced and need not be set. The presence of this argument in the BLAST standard is for consistency with the interface of the complex variant of this function. **alpha** : float The scalar :math:`\alpha`. **x** : float, array-like, shape :math:`\left(n\right)` The :math:`n`-element vector :math:`x`. If :math:`\textit{incx} < 0`, :math:`x_{\textit{i}}` must be stored in :math:`\mathrm{x}[\left(n-\textit{i}\right)\times \left\lvert \textit{incx}\right\rvert ]`, for :math:`\textit{i} = 1,2,\ldots,n`. If :math:`\alpha = 0.0` or :math:`n = 0`, :math:`\mathrm{x}` is not referenced. **beta** : float The scalar :math:`\beta`. **y** : float, array-like, shape :math:`\left(n\right)` The :math:`n`-element vector :math:`y`. If :math:`\textit{incy} > 0`, :math:`y_{\textit{i}}` must be stored in :math:`\mathrm{y}[\left(\textit{i}-1\right)\times \textit{incy}]`, for :math:`\textit{i} = 1,2,\ldots,n`. If :math:`\textit{incy} < 0`, :math:`y_{\textit{i}}` must be stored in :math:`\mathrm{y}[\left(n-\textit{i}\right)\times \left\lvert \textit{incy}\right\rvert ]`, for :math:`\textit{i} = 1,2,\ldots,n`. Intermediate elements of :math:`\mathrm{y}` are not referenced. If :math:`\alpha = 0.0` or :math:`n = 0`, :math:`\mathrm{y}` is not referenced. **r** : float The initial value, :math:`r`, to be updated. If :math:`\beta = 0.0`, :math:`\mathrm{r}` need not be set on entry. **Returns** **r** : float The value :math:`r`, scaled by :math:`\beta` and updated by the scaled dot product of :math:`x` and :math:`y`. .. _f16ea-py2-py-errors: **Raises** **NagValueError** (`errno` :math:`-5`) On entry, error in parameter :math:`\textit{incx}`. Constraint: :math:`\textit{incx}\neq 0`. (`errno` :math:`-8`) On entry, error in parameter :math:`\textit{incy}`. Constraint: :math:`\textit{incy}\neq 0`. .. _f16ea-py2-py-notes: **Notes** ``ddot`` performs the operation .. math:: r←\beta r+\alpha x^\mathrm{T}y where :math:`x` and :math:`y` are :math:`n`-element real vectors, and :math:`r`, :math:`\alpha` and :math:`\beta` real scalars. If :math:`n` is less than zero, or, if :math:`\beta` is equal to one and either :math:`\alpha` or :math:`n` is equal to zero, this function returns immediately. .. _f16ea-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 """ raise NotImplementedError
[docs]def daxpby(alpha, x, beta, y): r""" ``daxpby`` computes the sum of two scaled vectors, for real vectors and scalars. .. _f16ec-py2-py-doc: For full information please refer to the NAG Library document for f16ec https://support.nag.com/numeric/nl/nagdoc_30.2/flhtml/f16/f16ecf.html .. _f16ec-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`. If :math:`\textit{incx} < 0`, :math:`x_{\textit{i}}` must be stored in :math:`\mathrm{x}[\left(n-\textit{i}\right)\times \left\lvert \textit{incx}\right\rvert ]`, for :math:`\textit{i} = 1,2,\ldots,n`. If :math:`n = 0`, :math:`\mathrm{x}` is not referenced. **beta** : float The scalar :math:`\beta`. **y** : float, ndarray, shape :math:`\left(n\right)`, modified in place `On entry`: the :math:`n`-element vector :math:`y`. If :math:`\textit{incy} > 0`, :math:`y_{\textit{i}}` must be stored in :math:`\mathrm{y}[\left(\textit{i}-1\right)\times \textit{incy}]`, for :math:`\textit{i} = 1,2,\ldots,n`. If :math:`\textit{incy} < 0`, :math:`y_{\textit{i}}` must be stored in :math:`\mathrm{y}[\left(n-\textit{i}\right)\times \left\lvert \textit{incy}\right\rvert ]`, for :math:`\textit{i} = 1,2,\ldots,n`. Intermediate elements of :math:`\mathrm{y}` are not referenced. `On exit`: the updated vector :math:`y` stored in the array elements used to supply the original vector :math:`y`. Intermediate elements of :math:`\mathrm{y}` are unchanged. .. _f16ec-py2-py-errors: **Raises** **NagValueError** (`errno` :math:`-4`) 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`. .. _f16ec-py2-py-notes: **Notes** ``daxpby`` performs the operation .. math:: y←\alpha x+\beta y where :math:`x` and :math:`y` are :math:`n`-element real vectors, and :math:`\alpha` and :math:`\beta` real scalars. If :math:`n` is equal to zero, or if :math:`\alpha` is equal to zero and :math:`\beta` is equal to :math:`1`, this function returns immediately. .. _f16ec-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 """ raise NotImplementedError
[docs]def dwaxpby(alpha, x, beta, y): r""" ``dwaxpby`` computes the sum of two scaled vectors, preserving input, for real scalars and vectors. .. _f16eh-py2-py-doc: For full information please refer to the NAG Library document for f16eh https://support.nag.com/numeric/nl/nagdoc_30.2/flhtml/f16/f16ehf.html .. _f16eh-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`. If :math:`\textit{incx} < 0`, :math:`x_{\textit{i}}` must be stored in :math:`\mathrm{x}[\left(n-\textit{i}\right)\times \left\lvert \textit{incx}\right\rvert ]`, for :math:`\textit{i} = 1,2,\ldots,n`. If :math:`n = 0`, :math:`\mathrm{x}` is not referenced. **beta** : float The scalar :math:`\beta`. **y** : float, array-like, shape :math:`\left(n\right)` The :math:`n`-element vector :math:`y`. If :math:`\textit{incy} > 0`, :math:`y_{\textit{i}}` must be stored in :math:`\mathrm{y}[\left(\textit{i}-1\right)\times \textit{incy}]`, for :math:`\textit{i} = 1,2,\ldots,n`. If :math:`\textit{incy} < 0`, :math:`y_{\textit{i}}` must be stored in :math:`\mathrm{y}[\left(n-\textit{i}\right)\times \left\lvert \textit{incy}\right\rvert ]`, for :math:`\textit{i} = 1,2,\ldots,n`. Intermediate elements of :math:`\mathrm{y}` are not referenced. If :math:`\beta = 0.0` or :math:`n = 0`, :math:`\mathrm{y}` is not referenced. **Returns** **w** : float, ndarray, shape :math:`\left(n\right)` The elements :math:`w_i` of the vector :math:`w` will be stored in :math:`\mathrm{w}` as follows. If :math:`\textit{incw} > 0`, :math:`w_i` is in :math:`\mathrm{w}[\left(\textit{i}-1\right)\times \textit{incw}]`, for :math:`\textit{i} = 1,2,\ldots,n`. If :math:`\textit{incw} < 0`, :math:`w_i` is in :math:`\mathrm{w}[\left(n-\textit{i}\right)\times \left\lvert \textit{incw}\right\rvert ]`, for :math:`\textit{i} = 1,2,\ldots,n`. Intermediate elements of :math:`\mathrm{w}` are not referenced. .. _f16eh-py2-py-errors: **Raises** **NagValueError** (`errno` :math:`-4`) 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`. (`errno` :math:`-9`) On entry, error in parameter :math:`\textit{incw}`. Constraint: :math:`\textit{incw}\neq 0`. .. _f16eh-py2-py-notes: **Notes** ``dwaxpby`` performs the operation .. math:: w←\alpha x+\beta y\text{,} where :math:`x` and :math:`y` are :math:`n`-element real vectors, and :math:`\alpha` and :math:`\beta` are real scalars. .. _f16eh-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 """ raise NotImplementedError
[docs]def dsum(x): r""" ``dsum`` sums the elements of a real vector. .. _f16el-py2-py-doc: For full information please refer to the NAG Library document for f16el https://support.nag.com/numeric/nl/nagdoc_30.2/flhtml/f16/f16elf.html .. _f16el-py2-py-parameters: **Parameters** **x** : float, array-like, shape :math:`\left(n\right)` The :math:`n`-element vector :math:`x`. If :math:`\textit{incx} < 0`, :math:`x_{\textit{i}}` must be stored in :math:`\mathrm{x}[\left(n-\textit{i}\right)\times \left\lvert \textit{incx}\right\rvert ]`, for :math:`\textit{i} = 1,2,\ldots,n`. If :math:`n = 0`, :math:`\mathrm{x}` is not referenced. **Returns** **sumx** : float The sum of the elements of :math:`x`. .. _f16el-py2-py-errors: **Raises** **NagValueError** (`errno` :math:`-3`) On entry, error in parameter :math:`\textit{incx}`. Constraint: :math:`\textit{incx}\neq 0`. .. _f16el-py2-py-notes: **Notes** ``dsum`` returns the sum .. math:: x_1+x_2 + \cdots +x_n of the elements of an :math:`n`-element real vector :math:`x`. If :math:`n\leq 0` on entry, ``dsum`` returns the value :math:`0`. .. _f16el-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 """ raise NotImplementedError
[docs]def zaxpby(alpha, x, beta, y): r""" ``zaxpby`` computes the sum of two scaled vectors, for complex scalars and vectors. .. _f16gc-py2-py-doc: For full information please refer to the NAG Library document for f16gc https://support.nag.com/numeric/nl/nagdoc_30.2/flhtml/f16/f16gcf.html .. _f16gc-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`. If :math:`\textit{incx} < 0`, :math:`x_{\textit{i}}` must be stored in :math:`\mathrm{x}[\left(n-\textit{i}\right)\times \left\lvert \textit{incx}\right\rvert ]`, for :math:`\textit{i} = 1,2,\ldots,n`. If :math:`n = 0`, :math:`\mathrm{x}` is not referenced. **beta** : complex The scalar :math:`\beta`. **y** : complex, array-like, shape :math:`\left(n\right)` The :math:`n`-element vector :math:`y`. If :math:`\textit{incy} > 0`, :math:`y_{\textit{i}}` must be stored in :math:`\mathrm{y}[\left(\textit{i}-1\right)\times \textit{incy}]`, for :math:`\textit{i} = 1,2,\ldots,n`. If :math:`\textit{incy} < 0`, :math:`y_{\textit{i}}` must be stored in :math:`\mathrm{y}[\left(n-\textit{i}\right)\times \left\lvert \textit{incy}\right\rvert ]`, for :math:`\textit{i} = 1,2,\ldots,n`. Intermediate elements of :math:`\mathrm{y}` are not referenced. **Returns** **y** : complex, ndarray, shape :math:`\left(n\right)` The updated vector :math:`y` stored in the array elements used to supply the original vector :math:`y`. Intermediate elements of :math:`\mathrm{y}` are unchanged. .. _f16gc-py2-py-errors: **Raises** **NagValueError** (`errno` :math:`-4`) 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`. .. _f16gc-py2-py-notes: **Notes** ``zaxpby`` performs the operation .. math:: y←\alpha x+\beta y\text{,} where :math:`x` and :math:`y` are :math:`n`-element complex vectors, and :math:`\alpha` and :math:`\beta` are complex scalars. If :math:`n` is less than or equal to zero, or if :math:`\alpha` is equal to zero and :math:`\beta` is equal to :math:`1`, this function returns immediately. .. _f16gc-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 """ raise NotImplementedError
[docs]def zwaxpby(alpha, x, beta, y): r""" ``zwaxpby`` computes the sum of two scaled vectors, preserving input, for complex scalars and vectors. .. _f16gh-py2-py-doc: For full information please refer to the NAG Library document for f16gh https://support.nag.com/numeric/nl/nagdoc_30.2/flhtml/f16/f16ghf.html .. _f16gh-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`. If :math:`\textit{incx} < 0`, :math:`x_{\textit{i}}` must be stored in :math:`\mathrm{x}[\left(n-\textit{i}\right)\times \left\lvert \textit{incx}\right\rvert ]`, for :math:`\textit{i} = 1,2,\ldots,n`. If :math:`n = 0`, :math:`\mathrm{x}` is not referenced. **beta** : complex The scalar :math:`\beta`. **y** : complex, array-like, shape :math:`\left(n\right)` The :math:`n`-element vector :math:`y`. If :math:`\textit{incy} > 0`, :math:`y_{\textit{i}}` must be stored in :math:`\mathrm{y}[\left(\textit{i}-1\right)\times \textit{incy}]`, for :math:`\textit{i} = 1,2,\ldots,n`. If :math:`\textit{incy} < 0`, :math:`y_{\textit{i}}` must be stored in :math:`\mathrm{y}[\left(n-\textit{i}\right)\times \left\lvert \textit{incy}\right\rvert ]`, for :math:`\textit{i} = 1,2,\ldots,n`. Intermediate elements of :math:`\mathrm{y}` are not referenced. If :math:`\beta = 0.0` or :math:`n = 0`, :math:`\mathrm{y}` is not referenced. **Returns** **w** : complex, ndarray, shape :math:`\left(n\right)` The elements :math:`w_i` of the vector :math:`w` will be stored in :math:`\mathrm{w}` as follows. If :math:`\textit{incw} > 0`, :math:`w_i` is in :math:`\mathrm{w}[\left(\textit{i}-1\right)\times \textit{incw}]`, for :math:`\textit{i} = 1,2,\ldots,n`. If :math:`\textit{incw} < 0`, :math:`w_i` is in :math:`\mathrm{w}[\left(n-\textit{i}\right)\times \left\lvert \textit{incw}\right\rvert ]`, for :math:`\textit{i} = 1,2,\ldots,n`. Intermediate elements of :math:`\mathrm{w}` are not referenced. .. _f16gh-py2-py-errors: **Raises** **NagValueError** (`errno` :math:`-4`) 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`. (`errno` :math:`-9`) On entry, error in parameter :math:`\textit{incw}`. Constraint: :math:`\textit{incw}\neq 0`. .. _f16gh-py2-py-notes: **Notes** ``zwaxpby`` performs the operation .. math:: w←\alpha x+\beta y\text{,} where :math:`x` and :math:`y` are :math:`n`-element complex vectors, and :math:`\alpha` and :math:`\beta` are complex scalars. .. _f16gh-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 """ raise NotImplementedError
[docs]def zsum(x): r""" ``zsum`` sums the elements of a complex vector. .. _f16gl-py2-py-doc: For full information please refer to the NAG Library document for f16gl https://support.nag.com/numeric/nl/nagdoc_30.2/flhtml/f16/f16glf.html .. _f16gl-py2-py-parameters: **Parameters** **x** : complex, array-like, shape :math:`\left(n\right)` The :math:`n`-element vector :math:`x`. If :math:`\textit{incx} < 0`, :math:`x_{\textit{i}}` must be stored in :math:`\mathrm{x}[\left(n-\textit{i}\right)\times \left\lvert \textit{incx}\right\rvert ]`, for :math:`\textit{i} = 1,2,\ldots,n`. If :math:`n = 0`, :math:`\mathrm{x}` is not referenced. **Returns** **sx** : complex The sum of the elements of the complex vector :math:`x`. .. _f16gl-py2-py-errors: **Raises** **NagValueError** (`errno` :math:`-3`) On entry, error in parameter :math:`\textit{incx}`. Constraint: :math:`\textit{incx}\neq 0`. .. _f16gl-py2-py-notes: **Notes** ``zsum`` returns the sum .. math:: x_1+x_2 + \cdots +x_n of the elements of an :math:`n`-element complex vector :math:`x`. If :math:`n\leq 0` on entry, ``zsum`` returns the value :math:`0+0i`. .. _f16gl-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 """ raise NotImplementedError
[docs]def dmax_val(x): r""" ``dmax_val`` computes the largest component of a real vector, along with the index of that component. .. _f16jn-py2-py-doc: For full information please refer to the NAG Library document for f16jn https://support.nag.com/numeric/nl/nagdoc_30.2/flhtml/f16/f16jnf.html .. _f16jn-py2-py-parameters: **Parameters** **x** : float, array-like, shape :math:`\left(n\right)` The :math:`n`-element vector :math:`x`. If :math:`\textit{incx} < 0`, :math:`x_{\textit{i}}` must be stored in :math:`\mathrm{x}[\left(n-\textit{i}\right)\times \left\lvert \textit{incx}\right\rvert ]`, for :math:`\textit{i} = 1,2,\ldots,n`. If :math:`n = 0`, :math:`\mathrm{x}` is not referenced. **Returns** **k** : int Note: this argument represents an array index; the value returned will be base-1. :math:`k`, the index, from the set :math:`\left\{1, 2, \ldots, n\right\}`, of the largest component of :math:`x`. If :math:`n\leq 0` on input then :math:`\mathrm{k}` is returned as :math:`0`. **r** : float :math:`r`, the largest component of :math:`x`. If :math:`n\leq 0` on input then :math:`\mathrm{r}` is returned as :math:`0.0`. .. _f16jn-py2-py-errors: **Raises** **NagValueError** (`errno` :math:`-3`) On entry, error in parameter :math:`\textit{incx}`. Constraint: :math:`\textit{incx}\neq 0`. .. _f16jn-py2-py-notes: **Notes** ``dmax_val`` computes the largest component, :math:`r`, of an :math:`n`-element real vector :math:`x`, and determines the smallest index, :math:`k`, such that .. math:: r = x_k = \mathrm{max}_jx_j\text{.} .. _f16jn-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 """ raise NotImplementedError
[docs]def dmin_val(x): r""" ``dmin_val`` computes the smallest component of a real vector, along with the index of that component. .. _f16jp-py2-py-doc: For full information please refer to the NAG Library document for f16jp https://support.nag.com/numeric/nl/nagdoc_30.2/flhtml/f16/f16jpf.html .. _f16jp-py2-py-parameters: **Parameters** **x** : float, array-like, shape :math:`\left(n\right)` The :math:`n`-element vector :math:`x`. If :math:`\textit{incx} < 0`, :math:`x_{\textit{i}}` must be stored in :math:`\mathrm{x}[\left(n-\textit{i}\right)\times \left\lvert \textit{incx}\right\rvert ]`, for :math:`\textit{i} = 1,2,\ldots,n`. If :math:`n = 0`, :math:`\mathrm{x}` is not referenced. **Returns** **k** : int Note: this argument represents an array index; the value returned will be base-1. :math:`k`, the index, from the set :math:`\left\{1, 2, \ldots, n\right\}`, of the smallest component of :math:`x`. If :math:`n\leq 0` on input then :math:`\mathrm{k}` is returned as :math:`0`. **r** : float :math:`r`, the smallest component of :math:`x`. If :math:`n\leq 0` on input then :math:`\mathrm{r}` is returned as :math:`0.0`. .. _f16jp-py2-py-errors: **Raises** **NagValueError** (`errno` :math:`-3`) On entry, error in parameter :math:`\textit{incx}`. Constraint: :math:`\textit{incx}\neq 0`. .. _f16jp-py2-py-notes: **Notes** ``dmin_val`` computes the smallest component, :math:`r`, of an :math:`n`-element real vector :math:`x`, and determines the smallest index, :math:`k`, such that .. math:: r = x_k = \mathrm{min}_jx_j\text{.} .. _f16jp-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 """ raise NotImplementedError
[docs]def damax_val(x): r""" ``damax_val`` computes, with respect to absolute value, the largest component of a real vector, along with the index of that component. .. _f16jq-py2-py-doc: For full information please refer to the NAG Library document for f16jq https://support.nag.com/numeric/nl/nagdoc_30.2/flhtml/f16/f16jqf.html .. _f16jq-py2-py-parameters: **Parameters** **x** : float, array-like, shape :math:`\left(n\right)` The :math:`n`-element vector :math:`x`. If :math:`\textit{incx} < 0`, :math:`x_{\textit{i}}` must be stored in :math:`\mathrm{x}[\left(n-\textit{i}\right)\times \left\lvert \textit{incx}\right\rvert ]`, for :math:`\textit{i} = 1,2,\ldots,n`. If :math:`n = 0`, :math:`\mathrm{x}` is not referenced. **Returns** **k** : int Note: this argument represents an array index; the value returned will be base-1. :math:`k`, the index, from the set :math:`\left\{1, 2, \ldots, n\right\}`, of the largest component of :math:`x` with respect to absolute value. If :math:`n\leq 0` on input then :math:`\mathrm{k}` is returned as :math:`0`. **r** : float :math:`r`, the largest component of :math:`x` with respect to absolute value. If :math:`n\leq 0` on input then :math:`\mathrm{r}` is returned as :math:`0.0`. .. _f16jq-py2-py-errors: **Raises** **NagValueError** (`errno` :math:`-3`) On entry, error in parameter :math:`\textit{incx}`. Constraint: :math:`\textit{incx}\neq 0`. .. _f16jq-py2-py-notes: **Notes** ``damax_val`` computes, with respect to absolute value, the largest component, :math:`r`, of an :math:`n`-element real vector :math:`x`, and determines the smallest index, :math:`k`, such that .. math:: r = \left\lvert x_k\right\rvert = \mathrm{max}_j\left\lvert x_j\right\rvert \text{.} .. _f16jq-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 """ raise NotImplementedError
[docs]def damin_val(x): r""" ``damin_val`` computes, with respect to absolute value, the smallest component of a real vector, along with the index of that component. .. _f16jr-py2-py-doc: For full information please refer to the NAG Library document for f16jr https://support.nag.com/numeric/nl/nagdoc_30.2/flhtml/f16/f16jrf.html .. _f16jr-py2-py-parameters: **Parameters** **x** : float, array-like, shape :math:`\left(n\right)` The :math:`n`-element vector :math:`x`. If :math:`\textit{incx} < 0`, :math:`x_{\textit{i}}` must be stored in :math:`\mathrm{x}[\left(n-\textit{i}\right)\times \left\lvert \textit{incx}\right\rvert ]`, for :math:`\textit{i} = 1,2,\ldots,n`. If :math:`n = 0`, :math:`\mathrm{x}` is not referenced. **Returns** **k** : int Note: this argument represents an array index; the value returned will be base-1. :math:`k`, the index, from the set :math:`\left\{1, 2, \ldots, n\right\}`, of the smallest component of :math:`x` with respect to absolute value. If :math:`n\leq 0` on input then :math:`\mathrm{k}` is returned as :math:`0`. **r** : float :math:`r`, the smallest component of :math:`x` with respect to absolute value. If :math:`n\leq 0` on input then :math:`\mathrm{r}` is returned as :math:`0.0`. .. _f16jr-py2-py-errors: **Raises** **NagValueError** (`errno` :math:`-3`) On entry, error in parameter :math:`\textit{incx}`. Constraint: :math:`\textit{incx}\neq 0`. .. _f16jr-py2-py-notes: **Notes** ``damin_val`` computes, with respect to absolute value, the smallest component, :math:`r`, of an :math:`n`-element real vector :math:`x`, and determines the smallest index, :math:`k`, such that .. math:: r = \left\lvert x_k\right\rvert = \mathrm{min}_j\left\lvert x_j\right\rvert \text{.} .. _f16jr-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 """ raise NotImplementedError
[docs]def zamax_val(x): r""" ``zamax_val`` computes, with respect to absolute value, the largest component of a complex vector, along with the index of that component. .. _f16js-py2-py-doc: For full information please refer to the NAG Library document for f16js https://support.nag.com/numeric/nl/nagdoc_30.2/flhtml/f16/f16jsf.html .. _f16js-py2-py-parameters: **Parameters** **x** : complex, array-like, shape :math:`\left(n\right)` The :math:`n`-element vector :math:`x`. If :math:`\textit{incx} < 0`, :math:`x_{\textit{i}}` must be stored in :math:`\mathrm{x}[\left(n-\textit{i}\right)\times \left\lvert \textit{incx}\right\rvert ]`, for :math:`\textit{i} = 1,2,\ldots,n`. If :math:`n = 0`, :math:`\mathrm{x}` is not referenced. **Returns** **k** : int Note: this argument represents an array index; the value returned will be base-1. :math:`k`, the index, from the set :math:`\left\{1, 2, \ldots, n\right\}`, of the largest component of :math:`x` with respect to absolute value. If :math:`n\leq 0` on input then :math:`\mathrm{k}` is returned as :math:`0`. **r** : float :math:`r`, the largest component of :math:`x` with respect to absolute value. If :math:`n\leq 0` on input then :math:`\mathrm{r}` is returned as :math:`0.0`. .. _f16js-py2-py-errors: **Raises** **NagValueError** (`errno` :math:`-3`) On entry, error in parameter :math:`\textit{incx}`. Constraint: :math:`\textit{incx}\neq 0`. .. _f16js-py2-py-notes: **Notes** ``zamax_val`` computes, with respect to absolute value, the largest component, :math:`r`, of an :math:`n`-element complex vector :math:`x`, and determines the smallest index, :math:`k`, such that .. math:: r = \left\lvert \mathrm{Re}\left(x_k\right)\right\rvert +\left\lvert \mathrm{Im}\left(x_k\right)\right\rvert = \mathrm{max}_j\left\lvert \mathrm{Re}\left(x_j\right)\right\rvert +\left\lvert \mathrm{Im}\left(x_j\right)\right\rvert \text{.} .. _f16js-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 """ raise NotImplementedError
[docs]def zamin_val(x): r""" ``zamin_val`` computes, with respect to absolute value, the smallest component of a complex vector, along with the index of that component. .. _f16jt-py2-py-doc: For full information please refer to the NAG Library document for f16jt https://support.nag.com/numeric/nl/nagdoc_30.2/flhtml/f16/f16jtf.html .. _f16jt-py2-py-parameters: **Parameters** **x** : complex, array-like, shape :math:`\left(n\right)` The :math:`n`-element vector :math:`x`. If :math:`\textit{incx} < 0`, :math:`x_{\textit{i}}` must be stored in :math:`\mathrm{x}[\left(n-\textit{i}\right)\times \left\lvert \textit{incx}\right\rvert ]`, for :math:`\textit{i} = 1,2,\ldots,n`. If :math:`n = 0`, :math:`\mathrm{x}` is not referenced. **Returns** **k** : int Note: this argument represents an array index; the value returned will be base-1. :math:`k`, the index, from the set :math:`\left\{1, 2, \ldots, n\right\}`, of the smallest component of :math:`x` with respect to absolute value. If :math:`n\leq 0` on input then :math:`\mathrm{k}` is returned as :math:`0`. **r** : float :math:`r`, the smallest component of :math:`x` with respect to absolute value. If :math:`n\leq 0` on input then :math:`\mathrm{r}` is returned as :math:`0.0`. .. _f16jt-py2-py-errors: **Raises** **NagValueError** (`errno` :math:`-3`) On entry, error in parameter :math:`\textit{incx}`. Constraint: :math:`\textit{incx}\neq 0`. .. _f16jt-py2-py-notes: **Notes** ``zamin_val`` computes, with respect to absolute value, the smallest component, :math:`r`, of an :math:`n`-element complex vector :math:`x`, and determines the smallest index, :math:`k`, such that .. math:: r = \left\lvert \mathrm{Re}\left(x_k\right)\right\rvert +\left\lvert \mathrm{Im}\left(x_k\right)\right\rvert = \mathrm{min}_j\left\lvert \mathrm{Re}\left(x_j\right)\right\rvert +\left\lvert \mathrm{Im}\left(x_j\right)\right\rvert \text{.} .. _f16jt-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 """ raise NotImplementedError
[docs]def dgb_norm(inorm, m, kl, ku, ab): r""" ``dgb_norm`` calculates 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` band matrix stored in banded form. .. _f16rb-py2-py-doc: For full information please refer to the NAG Library document for f16rb https://support.nag.com/numeric/nl/nagdoc_30.2/flhtml/f16/f16rbf.html .. _f16rb-py2-py-parameters: **Parameters** **inorm** : int Specifies the value to be returned. :math:`\mathrm{inorm} = 171` The :math:`1`-norm. :math:`\mathrm{inorm} = 173` The :math:`2`-norm of a row or column vector. :math:`\mathrm{inorm} = 174` The Frobenius (or Euclidean) norm. :math:`\mathrm{inorm} = 175` The :math:`\infty`-norm. :math:`\mathrm{inorm} = 177` 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`. If :math:`\mathrm{m}\leq 0` on input, ``dgb_norm`` returns :math:`0`. **kl** : int :math:`k_l`, the number of subdiagonals within the band of :math:`A`. If :math:`\mathrm{kl} < 0` on input, ``dgb_norm`` returns :math:`0`. **ku** : int :math:`k_u`, the number of superdiagonals within the band of :math:`A`. If :math:`\mathrm{ku} < 0` on input, ``dgb_norm`` returns :math:`0`. **ab** : float, array-like, shape :math:`\left(\mathrm{kl}+\mathrm{ku}+1, n\right)` The :math:`m\times n` band matrix :math:`A`. **Returns** **nrm** : float The value of the required norm of the matrix supplied in :math:`\mathrm{ab}`. .. _f16rb-py2-py-notes: **Notes** Given a real :math:`m\times n` banded matrix, :math:`A`, ``dgb_norm`` 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}}^m\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}}^m{\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`).| +---------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------+ If :math:`m` or :math:`n` is :math:`1` then additionally ``dgb_norm`` can calculate the value :math:`\left\lVert A\right\rVert_2 = \sqrt{\sum a_i^2}` (the :math:`2`-norm of :math:`A`). .. _f16rb-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 """ raise NotImplementedError
[docs]def zgb_norm(inorm, m, kl, ku, ab): r""" ``zgb_norm`` calculates 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` band matrix stored in banded packed form. .. _f16ub-py2-py-doc: For full information please refer to the NAG Library document for f16ub https://support.nag.com/numeric/nl/nagdoc_30.2/flhtml/f16/f16ubf.html .. _f16ub-py2-py-parameters: **Parameters** **inorm** : int Specifies the value to be returned. :math:`\mathrm{inorm} = 171` The :math:`1`-norm. :math:`\mathrm{inorm} = 173` The :math:`2`-norm of a row or column vector. :math:`\mathrm{inorm} = 174` The Frobenius (or Euclidean) norm. :math:`\mathrm{inorm} = 175` The :math:`\infty`-norm. :math:`\mathrm{inorm} = 177` 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`. If :math:`\mathrm{m}\leq 0` on input, ``zgb_norm`` returns :math:`0`. **kl** : int :math:`k_l`, the number of subdiagonals within the band of :math:`A`. If :math:`\mathrm{kl} < 0` on input, ``zgb_norm`` returns :math:`0`. **ku** : int :math:`k_u`, the number of superdiagonals within the band of :math:`A`. If :math:`\mathrm{ku} < 0` on input, ``zgb_norm`` returns :math:`0`. **ab** : complex, array-like, shape :math:`\left(\mathrm{kl}+\mathrm{ku}+1, n\right)` The :math:`m\times n` band matrix :math:`A`. **Returns** **nrm** : float The value of the required norm of the matrix supplied in :math:`\mathrm{ab}`. .. _f16ub-py2-py-notes: **Notes** Given a complex :math:`m\times n` band matrix, :math:`A`, ``zgb_norm`` 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}}^m\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}}^m{\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`).| +-------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------+ If :math:`m` or :math:`n` is :math:`1` then additionally ``zgb_norm`` can calculate the value :math:`\left\lVert A\right\rVert_2 = \sqrt{\sum \left\lvert a_i\right\rvert^2}` (the :math:`2`-norm of :math:`A`). .. _f16ub-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 """ raise NotImplementedError