Subversion Repositories slepc-dev

Rev

Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1283 Rev 1288
Line 15... Line 15...
  int  (*publishoptions)(SVD);
  int  (*publishoptions)(SVD);
  int  (*destroy)(SVD);
  int  (*destroy)(SVD);
  int  (*view)(SVD,PetscViewer);
  int  (*view)(SVD,PetscViewer);
};
};
 
 
 
/*
 
     Maximum number of monitors you can run with a single SVD
 
*/
 
#define MAXSVDMONITORS 5
 
 
 
/*
 
   Defines the SVD data structure.
 
*/
struct _p_SVD {
struct _p_SVD {
  PETSCHEADER(struct _SVDOps);
  PETSCHEADER(struct _SVDOps);
  Mat              A;           /* problem matrix */
  Mat              A;           /* problem matrix */
  Mat              AT;          /* transposed matrix */
  Mat              AT;          /* transposed matrix */
  SVDTransposeMode transmode;   /* transpose mode */
  SVDTransposeMode transmode;   /* transpose mode */
Line 31... Line 39...
  int              nsv;         /* number of requested values */
  int              nsv;         /* number of requested values */
  int              ncv;         /* basis size */
  int              ncv;         /* basis size */
  int              its;         /* iteration counter */
  int              its;         /* iteration counter */
  int              max_it;      /* max iterations */
  int              max_it;      /* max iterations */
  PetscReal        tol;         /* tolerance */
  PetscReal        tol;         /* tolerance */
 
  PetscReal        *errest;     /* error estimates */
  void             *data;       /* placeholder for misc stuff associated
  void             *data;       /* placeholder for misc stuff associated
                                   with a particular solver */
                                   with a particular solver */
  int              setupcalled;
  int              setupcalled;
  SVDConvergedReason reason;
  SVDConvergedReason reason;
 
 
 
  int  (*monitor[MAXSVDMONITORS])(SVD,int,int,PetscReal*,PetscReal*,int,void*);
 
  int  (*monitordestroy[MAXSVDMONITORS])(void*);
 
  void *monitorcontext[MAXSVDMONITORS];
 
  int  numbermonitors;
};
};
 
 
EXTERN PetscErrorCode SVDRegisterAll(char *);
EXTERN PetscErrorCode SVDRegisterAll(char *);
EXTERN PetscErrorCode SVDRegister(const char*,const char*,const char*,int(*)(SVD));
EXTERN PetscErrorCode SVDRegister(const char*,const char*,const char*,int(*)(SVD));
#if defined(PETSC_USE_DYNAMIC_LIBRARIES)
#if defined(PETSC_USE_DYNAMIC_LIBRARIES)
#define SVDRegisterDynamic(a,b,c,d) SVDRegister(a,b,c,0)
#define SVDRegisterDynamic(a,b,c,d) SVDRegister(a,b,c,0)
#else
#else
#define SVDRegisterDynamic(a,b,c,d) SVDRegister(a,b,c,d)
#define SVDRegisterDynamic(a,b,c,d) SVDRegister(a,b,c,d)
#endif
#endif
 
 
 
#define SVDMonitor(svd,it,nconv,sigma,errest,nest) \
 
        { int _ierr,_i,_im = svd->numbermonitors; \
 
          for ( _i=0; _i<_im; _i++ ) {\
 
            _ierr=(*svd->monitor[_i])(svd,it,nconv,sigma,errest,nest,svd->monitorcontext[_i]);\
 
            CHKERRQ(_ierr); \
 
          } \
 
        }
 
 
#endif
#endif