next up previous contents index
Next: FACTOR(3LAS) Up: Manual Pages Previous: EIGENVAL(3LAS)

  ERRHANDL(3LAS)

NAME

LASError, LASBreak, LASResult, WriteLASErrDescr -- error handling routines

SYNOPSIS

#include <laspack/errhandl.h>

typedef enum { 
    LASOK, 
    LASMemAllocErr, 
    LASLValErr, 
    LASDimErr, 
    LASRangeErr, 
    LASSymStorErr, 
    LASMatrCombErr, 
    LASMulInvErr, 
    LASElNotSortedErr, 
    LASZeroInDiagErr, 
    LASZeroPivotErr, 
    LASILUStructErr, 
    LASBreakdownErr, 
    LASUserBreak 
} LASErrType;

void LASError(LASErrIdType ErrId, char *ProcName, char *Object1Name, 
              char *Object2Name, char *Object3Name);
void LASBreak(void);
LASErrIdType LASResult(void);
void WriteLASErrDescr(FILE *File);

DESCRIPTION

LASPack incorporates a system for error handling. In the most routines of the library, the consistency of passed parameters as well as the appearance of some exception situations are checked.

 
The procedure LASError is intended for internal usage in LASPack . At errors, it transmits information about their cause to the error handling system which prevents further execution of LASPack routines. As parameter ErrId, one of the following symbolic values depending on reason of the exception situation is used:
    LASMemAllocErr     Not enough memory is available.
    LASLValErr         L-value parameter is expected.
    LASDimErr          Objects have incompatible dimensions.
    LASRangeErr        Indices are out of range.
    LASSymStorErr      Some elements are stored in lower triangular part
                       of a symmetric matrix.
    LASMatrCombErr     Matrices can not be combined.
    LASMulInvErr       Inverse multiplication can not be carried out.
    LASElNotSortedErr  Matrix elements are not sorted.
    LASZeroInDiagErr   Zero elements in matrix diagonal are not allowed.
    LASZeroPivotErr    Factorization produces zero pivot elements.
    LASILUStructErr    Matrix has structure which is not allowed
                       for ILU factorization.
    LASBreakdownErr    Iterative solver fails.

In addition, the name of the routine where the error has occured ProcName and names of concerning objects Object1Name, Object2Name and Object3Name (e.g. names of vector or matrices) should be passed, too. The unused parameters should be set to NULL.

 
From an application, the processing of LASPack routines may by terminated by the procedure LASBreak which set the error status to LASUserBreak.

 
The current error status can be get by the procedure LASResult. If all LASPack routines has been runs faultless, the usual value LASOK by which the library is initialized is returned. In other cases, the procedure LASResult returns one of the symbolic values listed above.

 
Verbal description the the error occasion can be put out in the file File by the procedure WriteLASErrDescr.

FILES

errhandl.h ... header file
errhandl.c ... source file

EXAMPLES

The code fragment

Vector a, b;

V_Constr(&a, "a", 6, Normal, True);
V_Constr(&b, "b", 7, Normal, True);

V_SetAllCmp(&a, 0.0);      

Asgn_VV(&b, &a);

if (LASResult() != LASOK) {
    printf("LASPack error: ");
    WriteLASErrDescr(stdin);
}

V_Destr(&a);
V_Destr(&b);
produces the following error message:
LASPack error: in Asgn_VV for a, b:
Objects have incompatible dimensions.



Tomas Skalicky (skalicky@msmfs1.mw.tu-dresden.de)