Coverage for src/pymor/la/basic : 92%
Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
|
# This file is part of the pyMOR project (http://www.pymor.org). # Copyright Holders: Rene Milk, Stephan Rave, Felix Schindler # License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
'''The induced norm of a scalar product.
The norm of a vector (an array of vectors) U is calculated by calling ::
product.apply2(U, U, mu=mu, pairwise=True)
In addition, negative norm squares of absolute value smaller than the `induced_norm_tol` |default| value are clipped to `0`. If the `induced_norm_raise_negative` |default| value is `True`, a :exc:`ValueError` exception is raised if there are still negative norm squares afterwards.
Parameters ---------- product The scalar product for which the norm is to be calculated, given as a linear |Operator|.
Returns ------- norm A function `norm(U, mu=None)` taking a |VectorArray| `U` as input together with the |Parameter| `mu` which is passed to the product. '''
0, norm_squared) raise ValueError('norm is negative (square = {})'.format(norm_squared))
|