"Fossies" - the Fresh Open Source Software Archive

Member "laspack/qmatrix.h" (27 Mar 1995, 3384 Bytes) of package /linux/privat/old/laspack.tgz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 /****************************************************************************/
    2 /*                                qmatrix.h                                 */
    3 /****************************************************************************/
    4 /*                                                                          */
    5 /* type QMATRIX                                                             */
    6 /*                                                                          */
    7 /* Copyright (C) 1992-1995 Tomas Skalicky. All rights reserved.             */
    8 /*                                                                          */
    9 /****************************************************************************/
   10 /*                                                                          */
   11 /*        ANY USE OF THIS CODE CONSTITUTES ACCEPTANCE OF THE TERMS          */
   12 /*              OF THE COPYRIGHT NOTICE (SEE FILE COPYRGHT.H)               */
   13 /*                                                                          */
   14 /****************************************************************************/
   15 
   16 #ifndef QMATRIX_H
   17 #define QMATRIX_H
   18 
   19 #include <stdlib.h>
   20 
   21 #include "laspack/lastypes.h"
   22 #include "laspack/elcmp.h"
   23 #include "laspack/vector.h"
   24 #include "laspack/copyrght.h"
   25 
   26 typedef struct QMatrixType {
   27     char *Name;
   28     size_t Dim;
   29     Boolean Symmetry;
   30     ElOrderType ElOrder;
   31     InstanceType Instance;
   32     int LockLevel;
   33     double MultiplD;
   34     double MultiplU;
   35     double MultiplL;
   36     Boolean OwnData;
   37     size_t *Len;
   38     ElType **El;
   39     Boolean *ElSorted;
   40     Boolean *DiagElAlloc;
   41     ElType **DiagEl;
   42     Boolean *ZeroInDiag;
   43     Real *InvDiagEl;
   44     Boolean UnitRightKer;
   45     Real *RightKerCmp;
   46     Boolean UnitLeftKer;
   47     Real *LeftKerCmp;
   48     void *EigenvalInfo;
   49     Boolean *ILUExists;
   50     struct QMatrixType *ILU;
   51 } QMatrix;
   52 
   53 void Q_Constr(QMatrix *Q, char *Name, size_t Dim, Boolean Symmetry,
   54               ElOrderType ElOrder, InstanceType Instance, Boolean OwnData);
   55 void Q_Destr(QMatrix *Q);
   56 void Q_SetName(QMatrix *Q, char *Name);
   57 char *Q_GetName(QMatrix *Q);
   58 size_t Q_GetDim(QMatrix *Q);
   59 Boolean Q_GetSymmetry(QMatrix *Q);
   60 ElOrderType Q_GetElOrder(QMatrix *Q);
   61 void Q_SetLen(QMatrix *Q, size_t RoC, size_t Len);
   62 size_t Q_GetLen(QMatrix *Q, size_t RoC);
   63 void Q_SetEntry(QMatrix *Q, size_t RoC, size_t Entry, size_t Pos, Real Val);
   64 size_t Q_GetPos(QMatrix *Q, size_t RoC, size_t Entry);
   65 Real Q_GetVal(QMatrix *Q, size_t RoC, size_t Entry);
   66 void Q_AddVal(QMatrix *Q, size_t RoC, size_t Entry, Real Val);
   67 
   68 /* macros for fast access */
   69 #define     Q__GetLen(PtrQ, RoC)               (PtrQ)->Len[RoC]
   70 #define     Q__SetEntry(PtrQ, RoC, Entry, Pos_, Val_) { \
   71                 (PtrQ)->El[RoC][Entry].Pos = (Pos_); \
   72                 (PtrQ)->El[RoC][Entry].Val = (Val_); \
   73             }
   74 #define     Q__GetPos(PtrQ, RoC, Entry)        (PtrQ)->El[RoC][Entry].Pos
   75 #define     Q__GetVal(PtrQ, RoC, Entry)        (PtrQ)->El[RoC][Entry].Val
   76 #define     Q__AddVal(PtrQ, RoC, Entry, Val_) \
   77                 (PtrQ)->El[RoC][Entry].Val += (Val_)
   78 
   79 Real Q_GetEl(QMatrix *Q, size_t Row, size_t Clm);
   80 
   81 void Q_SortEl(QMatrix *Q);
   82 void Q_AllocInvDiagEl(QMatrix *Q);
   83 
   84 void Q_SetKer(QMatrix *Q, Vector *RightKer, Vector *LeftKer);
   85 Boolean Q_KerDefined(QMatrix *Q);
   86 
   87 void **Q_EigenvalInfo(QMatrix *Q);
   88 
   89 void Q_Lock(QMatrix *Q);
   90 void Q_Unlock(QMatrix *Q);
   91 
   92 #endif /* QMATRIX_H */