NormType — PETSc 3.25.0 documentation

Skip to main content
`Ctrl`+`K`

# NormType

determines what type of norm to compute with `VecNorm()`, `VecNormBegin()`/`VecNormEnd()` and `MatNorm()`.

## Synopsis

    typedef enum {
      NORM_1         = 0,
      NORM_2         = 1,
      NORM_FROBENIUS = 2,
      NORM_INFINITY  = 3,
      NORM_1_AND_2   = 4
    } NormType;

## Values

- `NORM_1` - the one norm, \(||v|| = \sum_i | v_i |\). \(||A|| = \max_j || A_{*j} ||\), maximum column sum

- `NORM_2` - the two norm, \(||v|| = sqrt(\sum_i |v_i|^2)\) (vectors only)

- `NORM_FROBENIUS` - \(||A|| = sqrt(\sum_{ij} |A_{ij}|^2)\), same as `NORM_2` for vectors

- `NORM_INFINITY` - \(||v|| = \max_i |v_i|\). \(||A|| = \max_i || A_{i*} ||_1\), maximum row sum

- `NORM_1_AND_2` - computes both the 1 and 2 norm of a vector. The values are stored in two adjacent `PetscReal` memory locations

## Note

The `v` above represents a `Vec` while the `A` represents a `Mat`

## See Also

Vectors and Parallel Data, `Vec`, `Mat`, `VecNorm()`, `VecNormBegin()`, `VecNormEnd()`, `MatNorm()`, `NORM_1`, `NORM_2`, `NORM_FROBENIUS`, `NORM_INFINITY`, `NORM_1_AND_2`, `ReductionType`

## Level

beginner

## Location

include/petscvec.h

## Examples

src/tao/tutorials/ex4.c

Index of all Vec routines
Table of Contents for all manual pages
Index of all manual pages