COPASI API  4.16.103
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
CEigen Class Reference

#include <CEigen.h>

Inheritance diagram for CEigen:
Inheritance graph
[legend]
Collaboration diagram for CEigen:
Collaboration graph
[legend]

Public Member Functions

void calcEigenValues (const CMatrix< C_FLOAT64 > &matrix)
 
 CEigen (const std::string &name="NoName", const CCopasiContainer *pParent=NULL)
 
 CEigen (const CEigen &src, const CCopasiContainer *pParent=NULL)
 
void cleanup ()
 
const C_FLOAT64getHierarchy () const
 
const CVector< C_FLOAT64 > & getI () const
 
const C_FLOAT64getMaximagpart () const
 
const C_FLOAT64getMaxrealpart () const
 
const size_t & getNcplxconj () const
 
const size_t & getNimag () const
 
const size_t & getNnegreal () const
 
const size_t & getNposreal () const
 
const size_t & getNreal () const
 
const size_t & getNzero () const
 
const CVector< C_FLOAT64 > & getR () const
 
const C_FLOAT64getStiffness () const
 
void initialize ()
 
virtual void print (std::ostream *ostream) const
 
void stabilityAnalysis (const C_FLOAT64 &resolution)
 
virtual ~CEigen ()
 
- Public Member Functions inherited from CCopasiContainer
virtual bool add (CCopasiObject *pObject, const bool &adopt=true)
 
 CCopasiContainer (const std::string &name, const CCopasiContainer *pParent=NULL, const std::string &type="CN", const unsigned C_INT32 &flag=CCopasiObject::Container)
 
 CCopasiContainer (const CCopasiContainer &src, const CCopasiContainer *pParent=NULL)
 
virtual std::string getChildObjectUnits (const CCopasiObject *pObject) const
 
virtual const CObjectInterfacegetObject (const CCopasiObjectName &cn) const
 
virtual const objectMapgetObjects () const
 
virtual std::string getUnits () const
 
virtual const CCopasiObjectgetValueObject () const
 
virtual bool remove (CCopasiObject *pObject)
 
virtual ~CCopasiContainer ()
 
- Public Member Functions inherited from CCopasiObject
void addDirectDependency (const CCopasiObject *pObject)
 
 CCopasiObject (const CCopasiObject &src, const CCopasiContainer *pParent=NULL)
 
void clearDirectDependencies ()
 
void clearRefresh ()
 
bool dependsOn (DataObjectSet candidates, const DataObjectSet &context=DataObjectSet()) const
 
void getAllDependencies (DataObjectSet &dependencies, const DataObjectSet &context) const
 
virtual CCopasiObjectName getCN () const
 
virtual const DataObjectSetgetDirectDependencies (const DataObjectSet &context=DataObjectSet()) const
 
virtual const std::string & getKey () const
 
CCopasiContainergetObjectAncestor (const std::string &type) const
 
CCopasiDataModelgetObjectDataModel ()
 
const CCopasiDataModelgetObjectDataModel () const
 
virtual std::string getObjectDisplayName (bool regular=true, bool richtext=false) const
 
const std::string & getObjectName () const
 
CCopasiContainergetObjectParent () const
 
const std::string & getObjectType () const
 
virtual const
CObjectInterface::ObjectSet
getPrerequisites () const
 
virtual RefreshgetRefresh () const
 
UpdateMethodgetUpdateMethod () const
 
virtual voidgetValuePointer () const
 
bool hasCircularDependencies (DataObjectSet &candidates, DataObjectSet &verified, const DataObjectSet &context) const
 
bool hasUpdateMethod () const
 
bool isArray () const
 
bool isContainer () const
 
bool isDataModel () const
 
bool isMatrix () const
 
bool isNameVector () const
 
bool isNonUniqueName () const
 
virtual bool isPrerequisiteForContext (const CObjectInterface *pObject, const CMath::SimulationContextFlag &context, const CObjectInterface::ObjectSet &changedObjects) const
 
bool isReference () const
 
bool isRoot () const
 
bool isSeparator () const
 
bool isStaticString () const
 
bool isValueBool () const
 
bool isValueDbl () const
 
bool isValueInt () const
 
bool isValueInt64 () const
 
bool isValueString () const
 
bool isVector () const
 
virtual bool mustBeDeleted (const DataObjectSet &deletedObjects) const
 
void removeDirectDependency (const CCopasiObject *pObject)
 
void setDirectDependencies (const DataObjectSet &directDependencies)
 
bool setObjectName (const std::string &name)
 
virtual bool setObjectParent (const CCopasiContainer *pParent)
 
void setObjectValue (const C_FLOAT64 &value)
 
void setObjectValue (const C_INT32 &value)
 
void setObjectValue (const bool &value)
 
template<class CType >
void setRefresh (CType *pType, void(CType::*method)(void))
 
template<class CType >
void setUpdateMethod (CType *pType, void(CType::*method)(const C_FLOAT64 &))
 
template<class CType >
void setUpdateMethod (CType *pType, void(CType::*method)(const C_INT32 &))
 
template<class CType >
void setUpdateMethod (CType *pType, void(CType::*method)(const bool &))
 
virtual ~CCopasiObject ()
 
- Public Member Functions inherited from CObjectInterface
 CObjectInterface ()
 
virtual ~CObjectInterface ()
 

Private Member Functions

void initObjects ()
 

Private Attributes

CMatrix< C_FLOAT64mA
 
C_FLOAT64 mBifurcationIndicator_Fold
 
C_FLOAT64 mBifurcationIndicator_Fold_BDT
 
C_FLOAT64 mBifurcationIndicator_Hopf
 
C_FLOAT64 mBifurcationIndicator_Hopf_BDT
 
C_FLOAT64 mFreqOfMaxComplex
 
C_FLOAT64 mHierarchy
 
CVector< C_FLOAT64mI
 
C_FLOAT64 mImagOfMaxComplex
 
C_INT mInfo
 
char mJobvs
 
C_INT mLDA
 
C_INT mLdvs
 
C_INT mLWork
 
C_FLOAT64 mMaximagpart
 
C_FLOAT64 mMaxRealOfComplex
 
C_FLOAT64 mMaxrealpart
 
C_INT mN
 
size_t mNcplxconj
 
size_t mNimag
 
size_t mNnegreal
 
size_t mNposreal
 
size_t mNreal
 
size_t mNzero
 
C_FLOAT64 mOscillationIndicator
 
C_FLOAT64 mOscillationIndicator_EV
 
C_LOGICALmpBWork
 
C_INT32mpSelect
 
C_FLOAT64mpVS
 
CVector< C_FLOAT64mR
 
C_FLOAT64 mResolution
 
C_INT mSdim
 
char mSort
 
C_FLOAT64 mStiffness
 
CVector< C_FLOAT64mWork
 

Friends

std::ostream & operator<< (std::ostream &os, const CEigen &A)
 

Additional Inherited Members

- Public Types inherited from CCopasiContainer
typedef std::multimap
< std::string, CCopasiObject * > 
objectMap
 
- Public Types inherited from CCopasiObject
typedef std::set< const
CCopasiObject * > 
DataObjectSet
 
typedef std::vector< Refresh * > DataUpdateSequence
 
- Public Types inherited from CObjectInterface
typedef std::set< const
CObjectInterface * > 
ObjectSet
 
typedef std::vector
< CObjectInterface * > 
UpdateSequence
 
- Static Public Member Functions inherited from CCopasiObject
static std::vector< Refresh * > buildUpdateSequence (const DataObjectSet &objects, const DataObjectSet &uptoDateObjects, const DataObjectSet &context=DataObjectSet())
 
static void setRenameHandler (CRenameHandler *rh)
 
- Static Public Attributes inherited from CCopasiContainer
static const std::vector
< CCopasiContainer * > 
EmptyList
 
- Protected Types inherited from CCopasiObject
enum  Flag {
  Container = 0x1, Vector = 0x2, Matrix = 0x4, NameVector = 0x8,
  Reference = 0x10, ValueBool = 0x20, ValueInt = 0x40, ValueInt64 = 0x80,
  ValueDbl = 0x100, NonUniqueName = 0x200, StaticString = 0x400, ValueString = 0x800,
  Separator = 0x1000, ModelEntity = 0x2000, Array = 0x4000, DataModel = 0x8000,
  Root = 0x10000, Gui = 0x20000
}
 
- Protected Member Functions inherited from CCopasiContainer
template<class CType >
CCopasiObjectaddMatrixReference (const std::string &name, CType &reference, const unsigned C_INT32 &flag=0)
 
template<class CType >
CCopasiObjectaddObjectReference (const std::string &name, CType &reference, const unsigned C_INT32 &flag=0)
 
template<class CType >
CCopasiObjectaddVectorReference (const std::string &name, CType &reference, const unsigned C_INT32 &flag=0)
 
void initObjects ()
 
- Protected Member Functions inherited from CCopasiObject
 CCopasiObject ()
 
 CCopasiObject (const std::string &name, const CCopasiContainer *pParent=NULL, const std::string &type="CN", const unsigned C_INT32 &flag=0)
 
- Protected Attributes inherited from CCopasiContainer
objectMap mObjects
 
- Static Protected Attributes inherited from CCopasiObject
static CRenameHandlersmpRenameHandler = NULL
 

Detailed Description

File name: CEigen.h

Programmer: Yongqun He Contact email: yohe@.nosp@m.vt.e.nosp@m.du Purpose: This is the .h file for the class CEigen. It is to calculate eigenvalues and eigenvectors of a matrix. It mainly uses the dgees_() subroutine of CLAPACK

Definition at line 36 of file CEigen.h.

Constructor & Destructor Documentation

CEigen::CEigen ( const std::string &  name = "NoName",
const CCopasiContainer pParent = NULL 
)

Default constructor

Parameters
conststd::string & name (default: "NoName")
constCCopasiContainer * pParent (default: NULL)

File name: CEigen.cpp

Programmer: Yongqun He Contact email: yohe@.nosp@m.vt.e.nosp@m.du Purpose: This is the .cpp file for the class CEigen. It is to calculate eigenvalues and eigenvectors of a matrix. Default constructor

Definition at line 50 of file CEigen.cpp.

References CONSTRUCTOR_TRACE, and initObjects().

51  :
52  CCopasiContainer(name, pParent, "Eigen Values",
54  mMaxrealpart(0),
55  mMaximagpart(0),
56  mNposreal(0),
57  mNnegreal(0),
58  mNreal(0),
59  mNimag(0),
60  mNcplxconj(0),
61  mNzero(0),
62  mStiffness(0),
63  mHierarchy(0),
64 
65  mMaxRealOfComplex(0.0),
66  mImagOfMaxComplex(0.0),
67  mFreqOfMaxComplex(0.0),
74 
75  mResolution(0),
76  mJobvs('N'),
77  mSort('N'),
78  mpSelect(NULL),
79  mN(0),
80  mA(),
81  mLDA(0),
82  mSdim(0),
83  mR(),
84  mI(),
85  mpVS(NULL),
86  mLdvs(1),
87  mWork(1),
88  mLWork(4096),
89  mpBWork(NULL),
90  mInfo(0)
91 {
93  initObjects();
94 }
C_FLOAT64 mMaximagpart
Definition: CEigen.h:49
C_FLOAT64 mBifurcationIndicator_Fold
Definition: CEigen.h:126
CVector< C_FLOAT64 > mI
Definition: CEigen.h:203
C_FLOAT64 mMaxRealOfComplex
Definition: CEigen.h:95
C_INT32 * mpSelect
Definition: CEigen.h:166
C_INT mLDA
Definition: CEigen.h:185
C_FLOAT64 mMaxrealpart
Definition: CEigen.h:44
C_INT mInfo
Definition: CEigen.h:249
C_INT mLWork
Definition: CEigen.h:228
C_FLOAT64 mBifurcationIndicator_Hopf_BDT
Definition: CEigen.h:131
C_FLOAT64 mFreqOfMaxComplex
Definition: CEigen.h:105
C_FLOAT64 * mpVS
Definition: CEigen.h:210
size_t mNcplxconj
Definition: CEigen.h:74
C_INT mLdvs
Definition: CEigen.h:216
C_FLOAT64 mHierarchy
Definition: CEigen.h:89
C_FLOAT64 mOscillationIndicator_EV
Definition: CEigen.h:115
CVector< C_FLOAT64 > mWork
Definition: CEigen.h:222
CMatrix< C_FLOAT64 > mA
Definition: CEigen.h:180
C_FLOAT64 mBifurcationIndicator_Hopf
Definition: CEigen.h:121
CVector< C_FLOAT64 > mR
Definition: CEigen.h:198
char mJobvs
Definition: CEigen.h:150
size_t mNnegreal
Definition: CEigen.h:59
C_FLOAT64 mOscillationIndicator
Definition: CEigen.h:110
void initObjects()
Definition: CEigen.cpp:152
size_t mNreal
Definition: CEigen.h:64
C_FLOAT64 mBifurcationIndicator_Fold_BDT
Definition: CEigen.h:136
C_FLOAT64 mResolution
Definition: CEigen.h:141
C_FLOAT64 mImagOfMaxComplex
Definition: CEigen.h:100
size_t mNimag
Definition: CEigen.h:69
C_FLOAT64 mStiffness
Definition: CEigen.h:84
C_INT mSdim
Definition: CEigen.h:193
C_INT mN
Definition: CEigen.h:171
C_LOGICAL * mpBWork
Definition: CEigen.h:234
size_t mNzero
Definition: CEigen.h:79
size_t mNposreal
Definition: CEigen.h:54
char mSort
Definition: CEigen.h:157
#define CONSTRUCTOR_TRACE
Definition: copasi.h:202
CEigen::CEigen ( const CEigen src,
const CCopasiContainer pParent = NULL 
)

Copy constructor

Parameters
constCMetab & src
constCCopasiContainer * pParent (default: NULL)

Definition at line 96 of file CEigen.cpp.

References CONSTRUCTOR_TRACE, and initObjects().

97  :
98  CCopasiContainer(src, pParent),
101  mNposreal(src.mNposreal),
102  mNnegreal(src.mNnegreal),
103  mNreal(src.mNreal),
104  mNimag(src.mNimag),
105  mNcplxconj(src.mNcplxconj),
106  mNzero(src.mNzero),
107  mStiffness(src.mStiffness),
108  mHierarchy(src.mHierarchy),
109 
119 
121  mJobvs(src.mJobvs),
122  mSort(src.mSort),
123  mpSelect(NULL),
124  mN(src.mN),
125  mA(src.mA),
126  mLDA(src.mLDA),
127  mSdim(src.mSdim),
128  mR(src.mR),
129  mI(src.mI),
130  mpVS(NULL),
131  mLdvs(src.mLdvs),
132  mWork(src.mWork),
133  mLWork(src.mLWork),
134  mpBWork(NULL),
135  mInfo(src.mInfo)
136 {
138  initObjects();
139 }
C_FLOAT64 mMaximagpart
Definition: CEigen.h:49
C_FLOAT64 mBifurcationIndicator_Fold
Definition: CEigen.h:126
CVector< C_FLOAT64 > mI
Definition: CEigen.h:203
C_FLOAT64 mMaxRealOfComplex
Definition: CEigen.h:95
C_INT32 * mpSelect
Definition: CEigen.h:166
C_INT mLDA
Definition: CEigen.h:185
C_FLOAT64 mMaxrealpart
Definition: CEigen.h:44
C_INT mInfo
Definition: CEigen.h:249
C_INT mLWork
Definition: CEigen.h:228
C_FLOAT64 mBifurcationIndicator_Hopf_BDT
Definition: CEigen.h:131
C_FLOAT64 mFreqOfMaxComplex
Definition: CEigen.h:105
C_FLOAT64 * mpVS
Definition: CEigen.h:210
size_t mNcplxconj
Definition: CEigen.h:74
C_INT mLdvs
Definition: CEigen.h:216
C_FLOAT64 mHierarchy
Definition: CEigen.h:89
C_FLOAT64 mOscillationIndicator_EV
Definition: CEigen.h:115
CVector< C_FLOAT64 > mWork
Definition: CEigen.h:222
CMatrix< C_FLOAT64 > mA
Definition: CEigen.h:180
C_FLOAT64 mBifurcationIndicator_Hopf
Definition: CEigen.h:121
CVector< C_FLOAT64 > mR
Definition: CEigen.h:198
char mJobvs
Definition: CEigen.h:150
size_t mNnegreal
Definition: CEigen.h:59
C_FLOAT64 mOscillationIndicator
Definition: CEigen.h:110
void initObjects()
Definition: CEigen.cpp:152
size_t mNreal
Definition: CEigen.h:64
C_FLOAT64 mBifurcationIndicator_Fold_BDT
Definition: CEigen.h:136
C_FLOAT64 mResolution
Definition: CEigen.h:141
C_FLOAT64 mImagOfMaxComplex
Definition: CEigen.h:100
size_t mNimag
Definition: CEigen.h:69
C_FLOAT64 mStiffness
Definition: CEigen.h:84
C_INT mSdim
Definition: CEigen.h:193
C_INT mN
Definition: CEigen.h:171
C_LOGICAL * mpBWork
Definition: CEigen.h:234
size_t mNzero
Definition: CEigen.h:79
size_t mNposreal
Definition: CEigen.h:54
char mSort
Definition: CEigen.h:157
#define CONSTRUCTOR_TRACE
Definition: copasi.h:202
CEigen::~CEigen ( )
virtual

Destructor

Deconstructor

Definition at line 144 of file CEigen.cpp.

References cleanup(), and DESTRUCTOR_TRACE.

145 {
146  cleanup();
148 }
void cleanup()
Definition: CEigen.cpp:240
#define DESTRUCTOR_TRACE
Definition: copasi.h:206

Member Function Documentation

void CEigen::calcEigenValues ( const CMatrix< C_FLOAT64 > &  matrix)

Eigenvalue calculations

Parameters
constC_FLOAT64 * matrix
constunsigned C_INT32 & dim

Definition at line 243 of file CEigen.cpp.

References CVectorCore< CType >::array(), CMatrix< CType >::array(), C_FLOAT64, C_INT, dgees_(), CCopasiMessage::EXCEPTION, fatalError, initialize(), mA, max, MCEigen, mI, mInfo, mJobvs, mLDA, mLdvs, mLWork, mN, mpBWork, mpVS, mR, mSdim, mSort, mWork, CMatrix< CType >::numCols(), CMatrix< CType >::numRows(), CMatrix< CType >::resize(), CVector< CType >::resize(), CMatrix< CType >::size(), and CCopasiMessage::WARNING.

Referenced by CSteadyStateTask::process().

244 {
245  assert(matrix.numRows() == matrix.numCols());
246  mN = (C_INT) matrix.numRows();
247  initialize();
248 
249  if (!mN) return;
250 
251  // copy the jacobian into mA
252  mA.resize(matrix.numRows(), matrix.numCols());
253  C_FLOAT64 * pA = mA.array();
254  C_FLOAT64 * pAEnd = pA + mA.size();
255  const C_FLOAT64 * pMatrix = matrix.array();
256 
257  for (; pA != pAEnd; ++pA, ++pMatrix)
258  {
259  *pA = *pMatrix;
260 
261  if (!finite(*pA) && !isnan(*pA))
262  {
263  if (*pA > 0)
265  else
267  }
268  }
269 
270  // Querry for the work array size.
271  mLWork = -1;
272  dgees_(&mJobvs, // 'N'
273  &mSort, // 'N'
274  NULL, // NULL,
275  &mN, // n,
276  mA.array(),
277  & mLDA,
278  & mSdim, // output
279  mR.array(),
280  mI.array(),
281  mpVS,
282  & mLdvs,
283  mWork.array(),
284  & mLWork,
285  mpBWork, // NULL
286  &mInfo); // output
287 
288  if (mInfo != 0)
289  {
290  // Exception
292  }
293 
294  mLWork = (C_INT) mWork[0];
296 
297  // calculate the eigenvalues
298  /* int dgees_(char *jobvs,
299  * char *sort,
300  * L_fp select,
301  * integer *n,
302  * doublereal *a,
303  * integer *lda,
304  * integer *sdim,
305  * doublereal *wr,
306  * doublereal *wi,
307  * doublereal *vs,
308  * integer *ldvs,
309  * doublereal *work,
310  * integer *lwork,
311  * logical *bwork,
312  * integer *info);
313  * Arguments
314  * =========
315  *
316  * JOBVS (input) CHARACTER*1
317  * = 'N': Schur vectors are not computed;
318  * = 'V': Schur vectors are computed.
319  *
320  * SORT (input) CHARACTER*1
321  * Specifies whether or not to order the eigenvalues on the
322  * diagonal of the Schur form.
323  * = 'N': Eigenvalues are not ordered;
324  * = 'S': Eigenvalues are ordered (see SELECT).
325  *
326  * SELECT (input) LOGICAL FUNCTION of two DOUBLE PRECISION arguments
327  * SELECT must be declared EXTERNAL in the calling subroutine.
328  * If SORT = 'S', SELECT is used to select eigenvalues to sort
329  * to the top left of the Schur form.
330  * If SORT = 'N', SELECT is not referenced.
331  * An eigenvalue WR(j)+sqrt(-1)*WI(j) is selected if
332  * SELECT(WR(j),WI(j)) is true; i.e., if either one of a complex
333  * conjugate pair of eigenvalues is selected, then both complex
334  * eigenvalues are selected.
335  * Note that a selected complex eigenvalue may no longer
336  * satisfy SELECT(WR(j),WI(j)) = .TRUE. after ordering, since
337  * ordering may change the value of complex eigenvalues
338  * (especially if the eigenvalue is ill-conditioned); in this
339  * case INFO is set to N+2 (see INFO below).
340  *
341  * N (input) INTEGER
342  * The order of the matrix A. N >= 0.
343  *
344  * A (input/output) DOUBLE PRECISION array, dimension (LDA,N)
345  * On entry, the N-by-N matrix A.
346  * On exit, A has been overwritten by its real Schur form T.
347  *
348  * LDA (input) INTEGER
349  * The leading dimension of the array A. LDA >= max(1,N).
350  *
351  * SDIM (output) INTEGER
352  * If SORT = 'N', SDIM = 0.
353  * If SORT = 'S', SDIM = number of eigenvalues (after sorting)
354  * for which SELECT is true. (Complex conjugate
355  * pairs for which SELECT is true for either
356  * eigenvalue count as 2.)
357  *
358  * WR (output) DOUBLE PRECISION array, dimension (N)
359  * WI (output) DOUBLE PRECISION array, dimension (N)
360  * WR and WI contain the real and imaginary parts,
361  * respectively, of the computed eigenvalues in the same order
362  * that they appear on the diagonal of the output Schur form T.
363  * Complex conjugate pairs of eigenvalues will appear
364  * consecutively with the eigenvalue having the positive
365  * imaginary part first.
366  *
367  * VS (output) DOUBLE PRECISION array, dimension (LDVS,N)
368  * If JOBVS = 'V', VS contains the orthogonal matrix Z of Schur
369  * vectors.
370  * If JOBVS = 'N', VS is not referenced.
371  *
372  * LDVS (input) INTEGER
373  * The leading dimension of the array VS. LDVS >= 1; if
374  * JOBVS = 'V', LDVS >= N.
375  *
376  * WORK (workspace/output) DOUBLE PRECISION array, dimension (LWORK)
377  * On exit, if INFO = 0, WORK(1) contains the optimal LWORK.
378  *
379  * LWORK (input) INTEGER
380  * The dimension of the array WORK. LWORK >= max(1,3*N).
381  * For good performance, LWORK must generally be larger.
382  *
383  * If LWORK = -1, then a workspace query is assumed; the routine
384  * only calculates the optimal size of the WORK array, returns
385  * this value as the first entry of the WORK array, and no error
386  * message related to LWORK is issued by XERBLA.
387  *
388  * BWORK (workspace) LOGICAL array, dimension (N)
389  * Not referenced if SORT = 'N'.
390  *
391  * INFO (output) INTEGER
392  * = 0: successful exit
393  * < 0: if INFO = -i, the i-th argument had an illegal value.
394  * > 0: if INFO = i, and i is
395  * <= N: the QR algorithm failed to compute all the
396  * eigenvalues; elements 1:i-1 and i+1:N of WR and WI
397  * contain those eigenvalues which have converged; if
398  * JOBVS = 'V', VS contains the matrix which reduces A
399  * to its partially converged Schur form.
400  * = N+1: the eigenvalues could not be reordered because some
401  * eigenvalues were too close to separate (the problem
402  * is very ill-conditioned);
403  * = N+2: after reordering, roundoff changed values of some
404  * complex eigenvalues so that leading eigenvalues in
405  * the Schur form no longer satisfy SELECT=.TRUE. This
406  * could also be caused by underflow due to scaling.
407  *
408  */
409  dgees_(&mJobvs, // 'N'
410  &mSort, // 'N'
411  NULL, // NULL,
412  &mN, // n,
413  mA.array(),
414  & mLDA,
415  & mSdim, // output
416  mR.array(),
417  mI.array(),
418  mpVS,
419  & mLdvs,
420  mWork.array(),
421  & mLWork,
422  mpBWork, // NULL
423  &mInfo); // output
424 
425  if (mInfo != 0)
426  {
427  if (mInfo < 0)
428  {
429  // Exception
431  }
432  else if (mInfo <= mN)
433  {
434  // Warning
436  }
437  else if (mInfo == mN + 1)
438  {
439  // Warning
441  }
442  else if (mInfo == mN + 2)
443  {
444  // Warning
446  }
447  else // Catch all, should never happen.
448  fatalError();
449  }
450 
451  return;
452 }
#define C_INT
Definition: copasi.h:115
CVector< C_FLOAT64 > mI
Definition: CEigen.h:203
C_INT mLDA
Definition: CEigen.h:185
C_INT mInfo
Definition: CEigen.h:249
C_INT mLWork
Definition: CEigen.h:228
C_FLOAT64 * mpVS
Definition: CEigen.h:210
C_INT mLdvs
Definition: CEigen.h:216
virtual size_t numRows() const
Definition: CMatrix.h:138
#define fatalError()
CVector< C_FLOAT64 > mWork
Definition: CEigen.h:222
CMatrix< C_FLOAT64 > mA
Definition: CEigen.h:180
void resize(size_t size, const bool &copy=false)
Definition: CVector.h:301
CVector< C_FLOAT64 > mR
Definition: CEigen.h:198
char mJobvs
Definition: CEigen.h:150
#define MCEigen
void initialize()
Definition: CEigen.cpp:227
virtual void resize(size_t rows, size_t cols, const bool &copy=false)
Definition: CMatrix.h:151
C_INT mSdim
Definition: CEigen.h:193
C_INT mN
Definition: CEigen.h:171
C_LOGICAL * mpBWork
Definition: CEigen.h:234
#define C_FLOAT64
Definition: copasi.h:92
CType * array()
Definition: CVector.h:139
virtual size_t size() const
Definition: CMatrix.h:132
int dgees_(char *jobvs, char *sort, L_fp select, integer *n, doublereal *a, integer *lda, integer *sdim, doublereal *wr, doublereal *wi, doublereal *vs, integer *ldvs, doublereal *work, integer *lwork, logical *bwork, integer *info)
virtual size_t numCols() const
Definition: CMatrix.h:144
virtual CType * array()
Definition: CMatrix.h:337
char mSort
Definition: CEigen.h:157
#define max(a, b)
Definition: f2c.h:176
void CEigen::cleanup ( )

cleanup()

Definition at line 240 of file CEigen.cpp.

Referenced by initialize(), and ~CEigen().

241 {}
const C_FLOAT64 & CEigen::getHierarchy ( ) const

Get the eigenvalue hierarchy

Definition at line 220 of file CEigen.cpp.

References mHierarchy.

221 {
222  return mHierarchy;
223 }
C_FLOAT64 mHierarchy
Definition: CEigen.h:89
const CVector< C_FLOAT64 > & CEigen::getI ( ) const

Definition at line 687 of file CEigen.cpp.

References mI.

Referenced by StateSubwidget::loadJacobian(), operator<<(), and CSteadyStateTask::process().

688 {return mI;}
CVector< C_FLOAT64 > mI
Definition: CEigen.h:203
const C_FLOAT64 & CEigen::getMaximagpart ( ) const

Get the max eigenvalue imaginary part

Definition at line 202 of file CEigen.cpp.

References mMaximagpart.

203 {
204  return mMaximagpart;
205 }
C_FLOAT64 mMaximagpart
Definition: CEigen.h:49
const C_FLOAT64 & CEigen::getMaxrealpart ( ) const

Get the max eigenvalue real part

return the matrix Set the Matrix

Definition at line 196 of file CEigen.cpp.

References mMaxrealpart.

197 {
198  return mMaxrealpart;
199 }
C_FLOAT64 mMaxrealpart
Definition: CEigen.h:44
const size_t & CEigen::getNcplxconj ( ) const

Definition at line 666 of file CEigen.cpp.

References mNcplxconj.

667 {
668  return mNcplxconj;
669 }
size_t mNcplxconj
Definition: CEigen.h:74
const size_t & CEigen::getNimag ( ) const

Return the number of imaginary eigenvalue numbers

Definition at line 661 of file CEigen.cpp.

References mNimag.

Referenced by CLNATask::process().

662 {
663  return mNimag;
664 }
size_t mNimag
Definition: CEigen.h:69
const size_t & CEigen::getNnegreal ( ) const

Return the number of eigenvalues with negative real part

Definition at line 682 of file CEigen.cpp.

References mNnegreal.

683 {
684  return mNnegreal;
685 }
size_t mNnegreal
Definition: CEigen.h:59
const size_t & CEigen::getNposreal ( ) const

Return the number of eigenvalues with positive real part

Definition at line 674 of file CEigen.cpp.

References mNposreal.

Referenced by CLNATask::process().

675 {
676  return mNposreal;
677 }
size_t mNposreal
Definition: CEigen.h:54
const size_t & CEigen::getNreal ( ) const

Return number of real eigenvalues WeiSun 3/28/02

Definition at line 653 of file CEigen.cpp.

References mNreal.

654 {
655  return mNreal;
656 }
size_t mNreal
Definition: CEigen.h:64
const size_t & CEigen::getNzero ( ) const

Get the number of zero eigenvalues

Definition at line 208 of file CEigen.cpp.

References mNzero.

Referenced by CLNATask::process().

209 {
210  return mNzero;
211 }
size_t mNzero
Definition: CEigen.h:79
const CVector< C_FLOAT64 > & CEigen::getR ( ) const

Definition at line 690 of file CEigen.cpp.

References mR.

Referenced by StateSubwidget::loadJacobian(), operator<<(), and CSteadyStateTask::process().

691 {return mR;}
CVector< C_FLOAT64 > mR
Definition: CEigen.h:198
const C_FLOAT64 & CEigen::getStiffness ( ) const

Get the eigenvalue stiffness

Definition at line 214 of file CEigen.cpp.

References mStiffness.

215 {
216  return mStiffness;
217 }
C_FLOAT64 mStiffness
Definition: CEigen.h:84
void CEigen::initialize ( )

initialize variables for eigenvalue calculations

Definition at line 227 of file CEigen.cpp.

References cleanup(), mI, mLDA, mN, mNcplxconj, mNimag, mNnegreal, mNposreal, mNreal, mNzero, mR, and CVector< CType >::resize().

Referenced by calcEigenValues().

228 {
229  cleanup();
230 
232  mNzero = mNcplxconj = 0;
233 
234  mLDA = mN > 1 ? mN : 1;
235 
236  mR.resize(mN);
237  mI.resize(mN);
238 }
CVector< C_FLOAT64 > mI
Definition: CEigen.h:203
C_INT mLDA
Definition: CEigen.h:185
size_t mNcplxconj
Definition: CEigen.h:74
void resize(size_t size, const bool &copy=false)
Definition: CVector.h:301
CVector< C_FLOAT64 > mR
Definition: CEigen.h:198
size_t mNnegreal
Definition: CEigen.h:59
size_t mNreal
Definition: CEigen.h:64
void cleanup()
Definition: CEigen.cpp:240
size_t mNimag
Definition: CEigen.h:69
C_INT mN
Definition: CEigen.h:171
size_t mNzero
Definition: CEigen.h:79
size_t mNposreal
Definition: CEigen.h:54
void CEigen::initObjects ( )
private

Initialize the contained CCopasiObjects

Definition at line 152 of file CEigen.cpp.

References CCopasiContainer::addObjectReference(), CCopasiContainer::addVectorReference(), mBifurcationIndicator_Fold, mBifurcationIndicator_Fold_BDT, mBifurcationIndicator_Hopf, mBifurcationIndicator_Hopf_BDT, mFreqOfMaxComplex, mHierarchy, mI, mImagOfMaxComplex, mMaximagpart, mMaxRealOfComplex, mMaxrealpart, mNcplxconj, mNimag, mNnegreal, mNposreal, mNreal, mNzero, mOscillationIndicator, mOscillationIndicator_EV, mR, mResolution, mStiffness, CCopasiObject::ValueDbl, and CCopasiObject::ValueInt.

Referenced by CEigen().

153 {
155  addObjectReference("Maximum imaginary part", mMaximagpart, CCopasiObject::ValueDbl);
156  addObjectReference("# Positive eigenvalues", mNposreal, CCopasiObject::ValueInt);
157  addObjectReference("# Negative eigenvalues", mNnegreal, CCopasiObject::ValueInt);
158  addObjectReference("# Real eigenvalues", mNreal, CCopasiObject::ValueInt);
159  addObjectReference("# Imaginary eigenvalues", mNimag, CCopasiObject::ValueInt);
160  addObjectReference("# Complex conjugated eigenvalues", mNcplxconj, CCopasiObject::ValueInt);
161  addObjectReference("# Zero eigenvalues", mNzero, CCopasiObject::ValueInt);
165  addVectorReference("Vector of real part of eigenvalues", mR, CCopasiObject::ValueDbl);
166  addVectorReference("Vector of imaginary part of eigenvalues", mI, CCopasiObject::ValueDbl);
167 
168  addObjectReference("Maximum real part of complex eigenvalue", mMaxRealOfComplex, CCopasiObject::ValueDbl);
169  addObjectReference("Imaginary part of largest complex eigenvalue", mImagOfMaxComplex, CCopasiObject::ValueDbl);
170  addObjectReference("Linear Frequency of largest complex eigenvalue", mFreqOfMaxComplex, CCopasiObject::ValueDbl);
172  addObjectReference("EV-based oscillation indicator", mOscillationIndicator_EV, CCopasiObject::ValueDbl);
173  addObjectReference("Hopf bifurcation test function", mBifurcationIndicator_Hopf, CCopasiObject::ValueDbl);
174  addObjectReference("Fold bifurcation test function", mBifurcationIndicator_Fold, CCopasiObject::ValueDbl);
175  addObjectReference("Hopf bifurcation test function (BDT)", mBifurcationIndicator_Hopf_BDT, CCopasiObject::ValueDbl);
176  addObjectReference("Fold bifurcation test function (BDT)", mBifurcationIndicator_Fold_BDT, CCopasiObject::ValueDbl);
177 }
C_FLOAT64 mMaximagpart
Definition: CEigen.h:49
C_FLOAT64 mBifurcationIndicator_Fold
Definition: CEigen.h:126
CVector< C_FLOAT64 > mI
Definition: CEigen.h:203
C_FLOAT64 mMaxRealOfComplex
Definition: CEigen.h:95
C_FLOAT64 mMaxrealpart
Definition: CEigen.h:44
C_FLOAT64 mBifurcationIndicator_Hopf_BDT
Definition: CEigen.h:131
C_FLOAT64 mFreqOfMaxComplex
Definition: CEigen.h:105
size_t mNcplxconj
Definition: CEigen.h:74
C_FLOAT64 mHierarchy
Definition: CEigen.h:89
C_FLOAT64 mOscillationIndicator_EV
Definition: CEigen.h:115
C_FLOAT64 mBifurcationIndicator_Hopf
Definition: CEigen.h:121
CVector< C_FLOAT64 > mR
Definition: CEigen.h:198
size_t mNnegreal
Definition: CEigen.h:59
C_FLOAT64 mOscillationIndicator
Definition: CEigen.h:110
size_t mNreal
Definition: CEigen.h:64
C_FLOAT64 mBifurcationIndicator_Fold_BDT
Definition: CEigen.h:136
C_FLOAT64 mResolution
Definition: CEigen.h:141
C_FLOAT64 mImagOfMaxComplex
Definition: CEigen.h:100
size_t mNimag
Definition: CEigen.h:69
C_FLOAT64 mStiffness
Definition: CEigen.h:84
CCopasiObject * addVectorReference(const std::string &name, CType &reference, const unsigned C_INT32 &flag=0)
size_t mNzero
Definition: CEigen.h:79
CCopasiObject * addObjectReference(const std::string &name, CType &reference, const unsigned C_INT32 &flag=0)
size_t mNposreal
Definition: CEigen.h:54
void CEigen::print ( std::ostream *  ostream) const
virtual

This is the output method for any object. The default implementation provided with CCopasiObject uses the ostream operator<< of the object to print the object.To overide this default behaviour one needs to reimplement the virtual print function.

Parameters
std::ostream* ostream

Reimplemented from CCopasiObject.

Definition at line 150 of file CEigen.cpp.

150 {(*ostream) << (*this);}
void CEigen::stabilityAnalysis ( const C_FLOAT64 resolution)

Calculate various eigenvalue statistics

Definition at line 454 of file CEigen.cpp.

References CVectorCore< CType >::applyPivot(), CVectorCore< CType >::array(), C_FLOAT64, C_INT, C_INT32, mBifurcationIndicator_Fold, mBifurcationIndicator_Fold_BDT, mBifurcationIndicator_Hopf, mBifurcationIndicator_Hopf_BDT, mFreqOfMaxComplex, mHierarchy, mI, mImagOfMaxComplex, mMaximagpart, mMaxRealOfComplex, mMaxrealpart, mN, mNcplxconj, mNimag, mNnegreal, mNposreal, mNreal, mNzero, mOscillationIndicator, mOscillationIndicator_EV, mR, mResolution, mStiffness, CVectorCore< CType >::size(), and sortWithPivot().

Referenced by CSteadyStateTask::process().

455 {
456  if (!mN) return;
457 
458  size_t mx, mn; // YH: n is the 4th parameter, not here
459  size_t i;
460  C_FLOAT64 distt, maxt, tott;
461  mResolution = resolution;
462 
463  // sort the eigenvalues
464  CVector<size_t> Pivot;
465 
467 
468  // The sort order is ascending however we need descending
469  size_t *pTo = Pivot.array();
470  size_t *pFrom = pTo + mN - 1;
471 
472  for (; pTo < pFrom; ++pTo, --pFrom)
473  {
474  size_t Tmp = *pFrom;
475  *pFrom = *pTo;
476  *pTo = Tmp;
477  }
478 
479  mR.applyPivot(Pivot);
480  mI.applyPivot(Pivot);
481 
482  // calculate various eigenvalue statistics
483  mMaxrealpart = mR[0];
484  mMaxRealOfComplex = mR[mN - 1] - 1;
485  mMaximagpart = fabs(mI[0]);
486  mImagOfMaxComplex = 0.0;
487 
488  for (i = 0; (C_INT) i < mN; i++)
489  {
490  // for the largest real part
491  if (mR[i] > mMaxrealpart)
492  mMaxrealpart = mR[i];
493 
494  // for the largest imaginary part
495  if (fabs(mI[i]) > mMaximagpart)
496  mMaximagpart = fabs(mI[i]);
497 
498  // for the largest complex eigenvalue
499  if ((fabs(mI[i]) > resolution) && (mR[i] > mMaxRealOfComplex))
500  {
501  mMaxRealOfComplex = mR[i];
502  mImagOfMaxComplex = fabs(mI[i]);
503  }
504 
505  if (fabs(mR[i]) > resolution)
506  {
507  // positive real part
508  if (mR[i] >= resolution)
509  mNposreal++;
510 
511  // negative real part
512  if (mR[i] <= -resolution)
513  mNnegreal++;
514 
515  if (fabs(mI[i]) > resolution)
516  {
517  // complex
518  mNcplxconj++;
519  }
520  else
521  {
522  mI[i] = 0.0;
523  // pure real
524  mNreal++;
525  }
526  }
527  else
528  {
529  mR[i] = 0.0;
530 
531  if (fabs(mI[i]) > resolution)
532  {
533  // pure imaginary
534  mNimag++;
535  }
536  else
537  {
538  mI[i] = 0.0;
539  // zero
540  mNzero++;
541  }
542  }
543  }
544 
545  if (mImagOfMaxComplex == 0)
546  mMaxRealOfComplex = mR[mN - 1]; //default value
547 
548  mFreqOfMaxComplex = mImagOfMaxComplex / (2 * M_PI);
549 
550  if (mNposreal > 0)
551  {
552  if (mR[0] > fabs(mR[mN - 1]))
553  mx = 0;
554  else
555  mx = mN - 1;
556 
557  if ((C_INT) mNposreal == mN)
558  mn = mNposreal - 1;
559  else if (mR[mNposreal - 1] < fabs(mR[mNposreal]))
560  mn = mNposreal - 1;
561  else
562  mn = mNposreal;
563  }
564  else
565  {
566  mx = mN - 1; // index of the largest absolute real part
567  mn = 0; // index of the smallest absolute real part
568  }
569 
570  mStiffness = fabs(mR[mx]) / fabs(mR[mn]);
571 
572  maxt = tott = fabs(1 / mR[mn]);
573  distt = 0.0;
574 
575  for (i = 1; (C_INT) i < mN; i++)
576  if (i != mn)
577  {
578  distt += maxt - fabs(1 / mR[i]);
579  tott += fabs(1 / mR[i]);
580  }
581 
582  mHierarchy = distt / tott / (mN - 1);
583 
584  //we calculate an oscillation indicator based on the eigenvalues. It is using a rather heuristical approach
585  if (mN < 2) // at least 2 Eigenvalues are required for oscillations
587  else
588  {
589  if (fabs(mI[0]) > resolution)
590  mOscillationIndicator_EV = mR[0] * (mR[0] > 0 ? fabs(mI[0]) / (0.01 + fabs(mI[0])) : 2 - fabs(mI[0]) / (0.01 + fabs(mI[0])));
591  else
592  mOscillationIndicator_EV = 2 * mR[1] - (mR[0] > 0 ? 2 * mR[0] : 0);
593  }
594 
595  //bifurcation test functions, according to Kuznetsov "Elements of applied bifurcation theory"
596  // this function can also be calculated without using the eigenvalues, but since we already
597  //have them we can use them
598 
599  std::complex<C_FLOAT64> tmpcpl = 1.0;
600  unsigned C_INT32 index_min = 0; // the index of the EV with smallest abs real part
601  C_FLOAT64 tmpmin = 1e300;
602 
603  for (i = 0; (C_INT) i < mN; i++)
604  {
605  tmpcpl *= std::complex<C_FLOAT64>(mR[i], mI[i]);
606 
607  if (fabs(mR[i]) < tmpmin)
608  {
609  tmpmin = fabs(mR[i]);
610  index_min = i;
611  }
612  }
613 
614  mBifurcationIndicator_Fold = std::abs<C_FLOAT64>(tmpcpl);
615 
616  tmpcpl = 1.0;
617 
618  for (i = 0; (C_INT) i < mN - 1; i++)
619  {
620  tmpcpl *= (std::complex<C_FLOAT64>(mR[i], mI[i]) + std::complex<C_FLOAT64>(mR[i + 1], mI[i + 1]));
621  }
622 
623  mBifurcationIndicator_Hopf = (tmpcpl.real());
624 
625  //now the test functions from the "Bifurcation discovery tool" (as described in the publication by Chickarmane et al.)
626 
627  //calculate the product of EVs excluding the minimal one
628  tmpcpl = 1.0;
629 
630  for (i = 0; (C_INT) i < mN; i++)
631  {
632  if (i != index_min)
633  tmpcpl *= std::complex<C_FLOAT64>(mR[i], mI[i]);
634  }
635 
636  mBifurcationIndicator_Fold_BDT = mBifurcationIndicator_Fold / (1 - 0.99 * exp(-std::abs<C_FLOAT64>(tmpcpl)));
637 
638  C_FLOAT64 tmp_product = 1.0;
639 
640  for (i = 0; (C_INT) i < mN; i++)
641  {
642  tmp_product *= mR[i] / (1 - 0.99 * exp(-mI[i]));
643  }
644 
645  mBifurcationIndicator_Hopf_BDT = tmp_product;
646 
647  mOscillationIndicator = 0.0; //not used at the moment.
648 }
C_FLOAT64 mMaximagpart
Definition: CEigen.h:49
#define C_INT
Definition: copasi.h:115
C_FLOAT64 mBifurcationIndicator_Fold
Definition: CEigen.h:126
void sortWithPivot(RandomAccessIterator first, RandomAccessIterator last, CVector< size_t > &pivot)
Definition: CSort.h:77
CVector< C_FLOAT64 > mI
Definition: CEigen.h:203
C_FLOAT64 mMaxRealOfComplex
Definition: CEigen.h:95
C_FLOAT64 mMaxrealpart
Definition: CEigen.h:44
C_FLOAT64 mBifurcationIndicator_Hopf_BDT
Definition: CEigen.h:131
C_FLOAT64 mFreqOfMaxComplex
Definition: CEigen.h:105
size_t mNcplxconj
Definition: CEigen.h:74
C_FLOAT64 mHierarchy
Definition: CEigen.h:89
C_FLOAT64 mOscillationIndicator_EV
Definition: CEigen.h:115
C_FLOAT64 mBifurcationIndicator_Hopf
Definition: CEigen.h:121
#define C_INT32
Definition: copasi.h:90
CVector< C_FLOAT64 > mR
Definition: CEigen.h:198
size_t mNnegreal
Definition: CEigen.h:59
C_FLOAT64 mOscillationIndicator
Definition: CEigen.h:110
size_t mNreal
Definition: CEigen.h:64
C_FLOAT64 mBifurcationIndicator_Fold_BDT
Definition: CEigen.h:136
C_FLOAT64 mResolution
Definition: CEigen.h:141
C_FLOAT64 mImagOfMaxComplex
Definition: CEigen.h:100
size_t mNimag
Definition: CEigen.h:69
C_FLOAT64 mStiffness
Definition: CEigen.h:84
size_t size() const
Definition: CVector.h:100
C_INT mN
Definition: CEigen.h:171
#define C_FLOAT64
Definition: copasi.h:92
CType * array()
Definition: CVector.h:139
size_t mNzero
Definition: CEigen.h:79
size_t mNposreal
Definition: CEigen.h:54
bool applyPivot(const CVectorCore< size_t > &pivot)
Definition: CVector.h:172

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const CEigen A 
)
friend

Definition at line 693 of file CEigen.cpp.

694 {
695  os << std::endl;
696  os << "KINETIC STABILITY ANALYSIS";
697  os << std::endl;
698  os << "The linear stability analysis based on the eigenvalues" << std::endl;
699  os << "of the Jacobian matrix is only valid for steady states." << std::endl;
700  os << std::endl;
701  os << "Summary:" << std::endl;
702  os << "This state ";
703 
704  // Output statistics
705 
706  if (A.mMaxrealpart > A.mResolution)
707  os << "is unstable";
708  else if (A.mMaxrealpart < -A.mResolution)
709  os << "is asymptotically stable";
710  else
711  os << "'s stability is undetermined";
712 
713  if (A.mMaximagpart > A.mResolution)
714  {
715  os << "," << std::endl;
716  os << "transient states in its vicinity have oscillatory components";
717  }
718 
719  os << "." << std::endl;
720  os << std::endl;
721 
722  os << "Eigenvalue statistics:" << std::endl;
723  // Output Max Real Part
724  os << " Largest real part: ";
725  os << std::setprecision(6) << A.mMaxrealpart << std::endl;
726  // Output Max imaginary Part
727  os << " Largest absolute imaginary part: ";
728  os << std::setprecision(6) << A.mMaximagpart << std::endl;
729 
730  if (A.mImagOfMaxComplex > A.mResolution)
731  os << " The complex eigenvalues with the largest real part are: "
732  << A.mMaxRealOfComplex << " +|- " << A.mImagOfMaxComplex << "i" << std::endl;
733 
734  // Output Eigen-nreal
735  os.unsetf(std::ios_base::scientific);
736  os.unsetf(std::ios_base::showpoint);
737  os << " " << A.mNreal;
738  os << " are purely real" << std::endl;
739  // Output Eigen-nimage
740  os << " " << A.mNimag;
741  os << " are purely imaginary" << std::endl;
742  // Output Eigen-ncplxconj
743  os << " " << A.mNcplxconj;
744  os << " are complex" << std::endl;
745  // Output Eigen-nzero
746  os << " " << A.mNzero;
747  os << " are equal to zero" << std::endl;
748  // Output Eigen-nposreal
749  os << " " << A.mNposreal;
750  os << " have positive real part" << std::endl;
751  // Output Eigen-nnegreal
752  os << " " << A.mNnegreal;
753  os << " have negative real part" << std::endl;
754 
755  // Set point manipulators
756  os.setf(std::ios_base::showpoint);
757  // Output Eigne-stiffness
758  os << " stiffness = " << A.mStiffness << std::endl;
759  os << " time hierarchy = " << A.mHierarchy << std::endl;
760 
761  return os;
762 }
C_FLOAT64 mMaximagpart
Definition: CEigen.h:49
C_FLOAT64 mMaxRealOfComplex
Definition: CEigen.h:95
C_FLOAT64 mMaxrealpart
Definition: CEigen.h:44
size_t mNcplxconj
Definition: CEigen.h:74
C_FLOAT64 mHierarchy
Definition: CEigen.h:89
size_t mNnegreal
Definition: CEigen.h:59
size_t mNreal
Definition: CEigen.h:64
C_FLOAT64 mResolution
Definition: CEigen.h:141
C_FLOAT64 mImagOfMaxComplex
Definition: CEigen.h:100
size_t mNimag
Definition: CEigen.h:69
C_FLOAT64 mStiffness
Definition: CEigen.h:84
size_t mNzero
Definition: CEigen.h:79
size_t mNposreal
Definition: CEigen.h:54

Member Data Documentation

CMatrix< C_FLOAT64 > CEigen::mA
private

#5: (input/output) The double precision array, dimension (LDA,N) On entry, the N-by-N matrix A On exit, A has been overwritten by its real Schur form T Use a pointer variable here instead of array since we don't know the dimension yet.

Definition at line 180 of file CEigen.h.

Referenced by calcEigenValues().

C_FLOAT64 CEigen::mBifurcationIndicator_Fold
private

A bifurcation test function, it is 0 for a Fold-type bifurcation.

Definition at line 126 of file CEigen.h.

Referenced by initObjects(), and stabilityAnalysis().

C_FLOAT64 CEigen::mBifurcationIndicator_Fold_BDT
private

A bifurcation test function, defined according to the "Bifurcation Discovery Tool", Chickarmane et al 2005

Definition at line 136 of file CEigen.h.

Referenced by initObjects(), and stabilityAnalysis().

C_FLOAT64 CEigen::mBifurcationIndicator_Hopf
private

A bifurcation test function, it is 0 for a Hopf-bifurcation. Definition according to Kuznetsov. This is only a necessary, not a sufficient condition for a H.-bifurcation

Definition at line 121 of file CEigen.h.

Referenced by initObjects(), and stabilityAnalysis().

C_FLOAT64 CEigen::mBifurcationIndicator_Hopf_BDT
private

A bifurcation test function, defined according to the "Bifurcation Discovery Tool", Chickarmane et al 2005

Definition at line 131 of file CEigen.h.

Referenced by initObjects(), and stabilityAnalysis().

C_FLOAT64 CEigen::mFreqOfMaxComplex
private

frequency of complex with largest real part

Definition at line 105 of file CEigen.h.

Referenced by initObjects(), and stabilityAnalysis().

C_FLOAT64 CEigen::mHierarchy
private

the hierary of the eigenvalues

Definition at line 89 of file CEigen.h.

Referenced by getHierarchy(), initObjects(), operator<<(), and stabilityAnalysis().

CVector< C_FLOAT64 > CEigen::mI
private

#9: array with dimension (mN)

Definition at line 203 of file CEigen.h.

Referenced by calcEigenValues(), getI(), initialize(), initObjects(), and stabilityAnalysis().

C_FLOAT64 CEigen::mImagOfMaxComplex
private

imaginary part of complex with largest real part

Definition at line 100 of file CEigen.h.

Referenced by initObjects(), operator<<(), and stabilityAnalysis().

C_INT CEigen::mInfo
private

#15: (output) an integer =0: successful exit <0: if mInfo=-i, the ith argument had an illegal value >0: if mInfo=i, and i is <=N: the QR algorithm failed to compute all the eigenvalues; =N+1: the eigenvalues could not be reordered because some eigenvalues were too close to separate (ill-conditioned) =N+2: after reordering, roundoff changed values of some complex eigenvalues so that leading eigenvalues in the Schur form no longer satisfy mSelect=.True. This could caused by underflow due to scaling

Definition at line 249 of file CEigen.h.

Referenced by calcEigenValues().

char CEigen::mJobvs
private

#1: (input) characer*1 = 'N': Schur vectors are not computed = 'V': Schur vectors are computed

Definition at line 150 of file CEigen.h.

Referenced by calcEigenValues().

C_INT CEigen::mLDA
private

#6: (input) The leading dimension of the array A. LDA >= max(1,N)

Definition at line 185 of file CEigen.h.

Referenced by calcEigenValues(), and initialize().

C_INT CEigen::mLdvs
private

#11: an integer, the leading dimension of the array VS. mLdvs >= 1; if mJobvs='V', mLdvs >= N.

Definition at line 216 of file CEigen.h.

Referenced by calcEigenValues().

C_INT CEigen::mLWork
private

#13: (input) Dimension of array Work, its value >= max(1,3*mN). For good performance, it must generally be larger

Definition at line 228 of file CEigen.h.

Referenced by calcEigenValues().

C_FLOAT64 CEigen::mMaximagpart
private

the imaginary part of the maximum eigenvalue

Definition at line 49 of file CEigen.h.

Referenced by getMaximagpart(), initObjects(), operator<<(), and stabilityAnalysis().

C_FLOAT64 CEigen::mMaxRealOfComplex
private

largest real part of a complex eigenvalue. If there is no complex eigenvalue it will be the smallest ev.

Definition at line 95 of file CEigen.h.

Referenced by initObjects(), operator<<(), and stabilityAnalysis().

C_FLOAT64 CEigen::mMaxrealpart
private

the real part of the maximum eigenvalue

Definition at line 44 of file CEigen.h.

Referenced by getMaxrealpart(), initObjects(), operator<<(), and stabilityAnalysis().

C_INT CEigen::mN
private

#4: (input) The order of the matrix A

Definition at line 171 of file CEigen.h.

Referenced by calcEigenValues(), initialize(), and stabilityAnalysis().

size_t CEigen::mNcplxconj
private

Definition at line 74 of file CEigen.h.

Referenced by getNcplxconj(), initialize(), initObjects(), operator<<(), and stabilityAnalysis().

size_t CEigen::mNimag
private

the number of imaginary eigenvalue numbers

Definition at line 69 of file CEigen.h.

Referenced by getNimag(), initialize(), initObjects(), operator<<(), and stabilityAnalysis().

size_t CEigen::mNnegreal
private

the number of eigenvalues with negative real part

Definition at line 59 of file CEigen.h.

Referenced by getNnegreal(), initialize(), initObjects(), operator<<(), and stabilityAnalysis().

size_t CEigen::mNposreal
private

the number of eigenvalues with positive real part

Definition at line 54 of file CEigen.h.

Referenced by getNposreal(), initialize(), initObjects(), operator<<(), and stabilityAnalysis().

size_t CEigen::mNreal
private

the number of real eigenvalues

Definition at line 64 of file CEigen.h.

Referenced by getNreal(), initialize(), initObjects(), operator<<(), and stabilityAnalysis().

size_t CEigen::mNzero
private

the number of eigenvalues with value of zero

Definition at line 79 of file CEigen.h.

Referenced by getNzero(), initialize(), initObjects(), operator<<(), and stabilityAnalysis().

C_FLOAT64 CEigen::mOscillationIndicator
private

An index that is supposed to indicate the presence of oscillations

Definition at line 110 of file CEigen.h.

Referenced by initObjects(), and stabilityAnalysis().

C_FLOAT64 CEigen::mOscillationIndicator_EV
private

A heuristical index that is supposed to indicate the presence of oscillations, based on Eigenvalues

Definition at line 115 of file CEigen.h.

Referenced by initObjects(), and stabilityAnalysis().

C_LOGICAL* CEigen::mpBWork
private

#14: (workspace) Logical array, dimension (N) Not referenced if mSort = 'N'

Definition at line 234 of file CEigen.h.

Referenced by calcEigenValues().

C_INT32* CEigen::mpSelect
private

#3: (input) Logical function of two double precision arguments It must be declared external = 'S': Select is used to select eigenvalues to sort to the top left of the Schur form = 'N': Eigenvalues are ordered Select is not refereced.

Definition at line 166 of file CEigen.h.

C_FLOAT64* CEigen::mpVS
private

#10: (output) array with dimension (mLdvs, mN) If mJobvs='V', mVS contains the orthogoanl matrix Z of Schur vectors If mJobvs='N', mVS is not referenced

Definition at line 210 of file CEigen.h.

Referenced by calcEigenValues().

CVector< C_FLOAT64 > CEigen::mR
private

#8: array with dimension (mN)

Definition at line 198 of file CEigen.h.

Referenced by calcEigenValues(), getR(), initialize(), initObjects(), and stabilityAnalysis().

C_FLOAT64 CEigen::mResolution
private

The resolution of needed for the stability analysis

Definition at line 141 of file CEigen.h.

Referenced by initObjects(), operator<<(), and stabilityAnalysis().

C_INT CEigen::mSdim
private

#7: (output) an integer if Sort = 'N', its value is 0 if Sort = 'S', its value = number of eigenvalues (after sorting) for which mSelect is true.

Definition at line 193 of file CEigen.h.

Referenced by calcEigenValues().

char CEigen::mSort
private

#2: (input) characer*1 = 'N': Eigenvalues are not ordered = 'S': Eigenvalues are ordered

Definition at line 157 of file CEigen.h.

Referenced by calcEigenValues().

C_FLOAT64 CEigen::mStiffness
private

the stiffness of eigenvalues

Definition at line 84 of file CEigen.h.

Referenced by getStiffness(), initObjects(), operator<<(), and stabilityAnalysis().

CVector< C_FLOAT64 > CEigen::mWork
private

#12: (workspace/output) double precision array, dimension (mLWork) On exit, if mInfo=0; mWork(1) contains the optimal mLWork

Definition at line 222 of file CEigen.h.

Referenced by calcEigenValues().


The documentation for this class was generated from the following files: