"Fossies" - the Fresh Open Source Software Archive

Member "laspack/vector.h" (27 Mar 1995, 2136 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 /*                                 vector.h                                 */
    3 /****************************************************************************/
    4 /*                                                                          */
    5 /* type VECTOR                                                              */
    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 VECTOR_H
   17 #define VECTOR_H
   18 
   19 #include <stdlib.h>
   20 
   21 #include "laspack/lastypes.h"
   22 #include "laspack/elcmp.h"
   23 #include "laspack/copyrght.h"
   24 
   25 typedef struct {
   26     char *Name;
   27     size_t Dim;
   28     InstanceType Instance;
   29     int LockLevel;
   30     double Multipl;
   31     Boolean OwnData;
   32     Real *Cmp;
   33 } Vector;
   34 
   35 void V_Constr(Vector *V, char *Name, size_t Dim, InstanceType Instance,
   36           Boolean OwnData);
   37 void V_Destr(Vector *V);
   38 void V_SetName(Vector *V, char *Name);
   39 char *V_GetName(Vector *V);
   40 size_t V_GetDim(Vector *V);
   41 void V_SetCmp(Vector *V, size_t Ind, Real Val);
   42 void V_SetAllCmp(Vector *V, Real Val);
   43 void V_SetRndCmp(Vector *V);
   44 Real V_GetCmp(Vector *V, size_t Ind);
   45 void V_AddCmp(Vector *V, size_t Ind, Real Val);
   46 
   47 /* macros for fast access */
   48 #define     V__SetCmp(PtrV, Ind, Val)       (PtrV)->Cmp[Ind] = (Val)
   49 #define     V__GetCmp(PtrV, Ind)            (PtrV)->Cmp[Ind]
   50 #define     V__AddCmp(PtrV, Ind, Val)       (PtrV)->Cmp[Ind] += (Val)
   51 
   52 void V_Lock(Vector *V);
   53 void V_Unlock(Vector *V);
   54 
   55 #endif /* VECTOR_H */