"Fossies" - the Fresh Open Source Software Archive

Member "laspack/html/node18.html" (13 Aug 1995, 5385 Bytes) of package /linux/privat/old/laspack.tgz:

Caution: In this restricted "Fossies" environment the current HTML page may not be correctly presentated and may have some non-functional links. You can here alternatively try to browse the pure source code or just view or download the uninterpreted raw source code. If the rendering is insufficient you may try to find and view the page on the project site itself.

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



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


#include <laspack/errhandl.h>

typedef enum { 
} LASErrType;

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


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.


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


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: ");

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)