FMSVAN
PURPOSE: Vector Norms, Add, Subtract, Move
This subroutine provides a collection of vector utilities primarily used in iterative algorithms. Several processing options are included, as determined by the parameter IOPT. Generally {X} represents the solution values and {Y} the change in solution values, or the solution at a different iteration. The norm RNORM is the ratio of solution increment to solution value.
The following options are implemented:
| IOPT |
IALPHA |
{X} on Output |
RNORM |
| 0 |
Not Used |
Unchanged |
|| {X} || |
| 1 |
-1 |
{X}={X}-{Y} |
|| Y(i) / ( X(i)-Y(i) ) || |
| 1 |
+1 |
{X}={X}+{Y} |
|| Y(i) / ( X(i)+Y(i) ) || |
| 2 |
Not Used |
Unchanged |
|| ( X(i)-Y(i) ) / X(i) || |
| 3 |
Not Used |
{X}={Y} |
|| ( Y(i)-X(i)) / Y(i) || |
SYNOPSIS
CALL FMSVAN (LUX, IALPHA, LUY, INORM, RNORM, IOPT)
INPUT PARAMETERS:
- LUX(25) = Integer array.
File attributes for the {X} vectors.
- IALPHA = Integer.
Scale factor for {Y} vectors.
- LUY(25) = Integer array.
File attributes for the {Y} vectors.
- INORM = Integer.
Number of the norm to compute:
RNORM = ( SUM( ABS(X(i))**INORM ) )**(1/INORM)
The exception being when INORM=0, the infinity norm is computed.
The implemented norms are:
| INORM |
RNORM |
| 0 |
MAX(ABS(X(i))) |
| 1 |
SUM(ABS(X(i))) |
| 2 |
SQRT(SUM(X(i)**2)) |
- IOPT = Integer.
Processing options.
OUTPUT PARAMETERS:
- RNORM = Real.
Vector norm.
DESCRIPTION:
This subroutine is a collection of vector utilities that are typically used in iterative algorithms. The computed norm RNORM may be used to test for convergence.
The parameter IOPT determines if the vector {X} is modified and how the norm is computed. The following options are implemented:
IOPT=0
Compute the norm of {X}. On exit, {X} is unchanged. The parameters IALPHA and LUY are not used.
IOPT=1
{X} is the solution and {Y} is the increment, which may be added (IALPHA=1) to, or subtracted (IALPHA=-1) from {X}. The norm RNORM is the ratio of the increment to the new solution value.
IOPT=2
{X} is the new solution and {Y} is the previous solution. The norm RNORM is the ratio of the change in solution to the new solution value. On exit, {X} is unchanged. The parameter IALPHA is not used.
IOPT=3
{X} is the previous solution and {Y} is the new solution. The norm RNORM is the ratio of the change in solution to the new solution value. On exit, the new solution value {Y} is moved to the previous solution {X}. The parameter IALPHA is not used.
Copyright © Multipath
Corporation