IFEM  90A354
LinAlgInit.h
Go to the documentation of this file.
1 // $Id$
2 //==============================================================================
12 //==============================================================================
13 
14 #ifndef _LINALG_INIT_H
15 #define _LINALG_INIT_H
16 
17 
30 {
32  LinAlgInit(int argc, char** argv);
33 public:
35  ~LinAlgInit();
36 
38  static void increfs() { ++refs; }
40  static void decrefs() { if (--refs == 0) delete instance; }
41 
43  static LinAlgInit& Init(int argc, char** argv);
44 
45  int myPid;
46 
47 private:
48  static int refs;
49 
50  static LinAlgInit* instance;
51 };
52 
53 #endif
Initializer for linear algebra packages.
Definition: LinAlgInit.h:30
static LinAlgInit & Init(int argc, char **argv)
Instanciates the singleton LinAlgInit object.
Definition: LinAlgInit.C:25
~LinAlgInit()
The destructor finalizes the linear algebra packages.
Definition: LinAlgInit.C:52
LinAlgInit(int argc, char **argv)
The constructor uses the command-line arguments to set up things.
Definition: LinAlgInit.C:34
static void decrefs()
Decrements the reference counter.
Definition: LinAlgInit.h:40
int myPid
Processor ID in parallel simulations.
Definition: LinAlgInit.h:45
static int refs
Reference counter.
Definition: LinAlgInit.h:48
static LinAlgInit * instance
Pointer to the singleton object.
Definition: LinAlgInit.h:50
static void increfs()
Increments the reference counter.
Definition: LinAlgInit.h:38