File: arssym.h

package info (click to toggle)
arpack%2B%2B 2.1-3
  • links: PTS
  • area: main
  • in suites: woody
  • size: 4,216 kB
  • ctags: 2,349
  • sloc: cpp: 19,093; ansic: 2,201; makefile: 508
file content (117 lines) | stat: -rw-r--r-- 2,917 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
/*
   ARPACK++ v1.0 8/1/1997
   c++ interface to ARPACK code.

   MODULE ARSSym.h.
   Arpack++ class ARSymStdEig definition.

   ARPACK Authors
      Richard Lehoucq
      Danny Sorensen
      Chao Yang
      Dept. of Computational & Applied Mathematics
      Rice University
      Houston, Texas
*/

#ifndef ARSSYM_H
#define ARSSYM_H

#include <stddef.h>
#include "arch.h"
#include "arseig.h"
#include "arrssym.h"


template<class FLOAT, class FOP>
class ARSymStdEig:
  public virtual ARStdEig<FLOAT, FLOAT, FOP>,
  public virtual ARrcSymStdEig<FLOAT> {

 public:

 // a) Constructors and destructor.

  ARSymStdEig() { }
  // Short constructor.

  ARSymStdEig(int np, int nevp, FOP* objOPp,
              void (FOP::* MultOPxp)(FLOAT[], FLOAT[]),
              char* whichp = "LM", int ncvp = 0, FLOAT tolp = 0.0,
              int maxitp = 0, FLOAT* residp = NULL, bool ishiftp = true);
  // Long constructor (regular mode).

  ARSymStdEig(int np, int nevp, FOP* objOPp,
              void (FOP::* MultOPxp)(FLOAT[], FLOAT[]),
              FLOAT sigmap, char* whichp = "LM", int ncvp = 0,
              FLOAT tolp = 0.0, int maxitp = 0, FLOAT* residp = NULL,
              bool ishiftp = true);
  // Long constructor (shift and invert mode).

  ARSymStdEig(const ARSymStdEig& other) { Copy(other); }
  // Copy constructor.

  virtual ~ARSymStdEig() { }
  // Destructor.

 // b) Operators.

  ARSymStdEig& operator=(const ARSymStdEig& other);
  // Assignment operator.

}; // class ARSymStdEig.


// ------------------------------------------------------------------------ //
// ARSymStdEig member functions definition.                                 //
// ------------------------------------------------------------------------ //


template<class FLOAT, class FOP>
inline ARSymStdEig<FLOAT, FOP>::
ARSymStdEig(int np, int nevp, FOP* objOPp,
            void (FOP::* MultOPxp)(FLOAT[], FLOAT[]),
            char* whichp, int ncvp, FLOAT tolp,
            int maxitp, FLOAT* residp, bool ishiftp)

{

  NoShift();
  DefineParameters(np, nevp, objOPp, MultOPxp, whichp,
                   ncvp, tolp, maxitp, residp, ishiftp);

} // Long constructor (regular mode).


template<class FLOAT, class FOP>
inline ARSymStdEig<FLOAT, FOP>::
ARSymStdEig(int np, int nevp, FOP* objOPp,
            void (FOP::* MultOPxp)(FLOAT[], FLOAT[]),
            FLOAT sigmap, char* whichp, int ncvp, FLOAT tolp,
            int maxitp, FLOAT* residp, bool ishiftp)

{

  ChangeShift(sigmap);
  DefineParameters(np, nevp, objOPp, MultOPxp, whichp,
                   ncvp, tolp, maxitp, residp, ishiftp);

} // Long constructor (shift and invert mode).


template<class FLOAT, class FOP>
ARSymStdEig<FLOAT, FOP>& ARSymStdEig<FLOAT, FOP>::
operator=(const ARSymStdEig<FLOAT, FOP>& other)
{

  if (this != &other) { // Stroustrup suggestion.
    ClearMem();
    Copy(other);
  }
  return *this;

} // operator=.


#endif // ARSSYM_H