Subversion Repositories slepc-dev

Rev

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

Rev 756 Rev 761
Line 248... Line 248...
}
}
 
 
#undef __FUNCT__  
#undef __FUNCT__  
#define __FUNCT__ "EPSGetInvariantSubspace"
#define __FUNCT__ "EPSGetInvariantSubspace"
/*@
/*@
   EPSGetInvariantSubspace - Gets a basis of the computed invariant subspace.
   EPSGetInvariantSubspace - Gets an orthonormal basis of the computed invariant
 
   subspace.
 
 
   Not Collective
   Not Collective
 
 
   Input Parameter:
   Input Parameter:
.  eps - the eigensolver context
.  eps - the eigensolver context
Line 264... Line 265...
   This function should be called after EPSSolve() has finished.
   This function should be called after EPSSolve() has finished.
 
 
   The user should provide in v an array of nconv vectors, where nconv is
   The user should provide in v an array of nconv vectors, where nconv is
   the value returned by EPSGetConverged().
   the value returned by EPSGetConverged().
 
 
   The vectors returned in v span an invariant subspace associated with the
   The first k vectors returned in v span an invariant subspace associated
   (nconv) computed eigenvalues. An invariant subspace X of A satisfies Ax
   with the first k computed eigenvalues (note that this is not true if the
 
   k-th eigenvalue is complex and matrix A is real; in this case the first
 
   k+1 vectors should be used). An invariant subspace X of A satisfies Ax
   in X for all x in X (a similar definition applies for generalized
   in X for all x in X (a similar definition applies for generalized
   eigenproblems).
   eigenproblems).
 
 
   Level: intermediate
   Level: intermediate
 
 
Line 295... Line 298...
#undef __FUNCT__  
#undef __FUNCT__  
#define __FUNCT__ "EPSGetEigenpair"
#define __FUNCT__ "EPSGetEigenpair"
/*@
/*@
   EPSGetEigenpair - Gets the i-th solution of the eigenproblem
   EPSGetEigenpair - Gets the i-th solution of the eigenproblem
   as computed by EPSSolve(). The solution consists in both the eigenvalue
   as computed by EPSSolve(). The solution consists in both the eigenvalue
   and the eigenvector (if available).
   and the eigenvector.
 
 
   Not Collective
   Not Collective
 
 
   Input Parameters:
   Input Parameters:
+  eps - eigensolver context
+  eps - eigensolver context
Line 312... Line 315...
-  Vi   - imaginary part of eigenvector
-  Vi   - imaginary part of eigenvector
 
 
   Notes:
   Notes:
   If the eigenvalue is real, then eigi and Vi are set to zero. In the
   If the eigenvalue is real, then eigi and Vi are set to zero. In the
   complex case (e.g. with BOPT=O_complex) the eigenvalue is stored
   complex case (e.g. with BOPT=O_complex) the eigenvalue is stored
   directly in eigr (eigi is set to zero) and the eigenvector Vr (Vi is
   directly in eigr (eigi is set to zero) and the eigenvector in Vr (Vi is
   set to zero).
   set to zero).
 
 
   The index i should be a value between 0 and nconv (see EPSGetConverged()).
   The index i should be a value between 0 and nconv (see EPSGetConverged()).
   Eigenpairs are indexed according to the ordering criterion established
   Eigenpairs are indexed according to the ordering criterion established
   with EPSSetWhichEigenpairs().
   with EPSSetWhichEigenpairs().
Line 376... Line 379...
}
}
 
 
#undef __FUNCT__  
#undef __FUNCT__  
#define __FUNCT__ "EPSGetErrorEstimate"
#define __FUNCT__ "EPSGetErrorEstimate"
/*@
/*@
   EPSGetErrorEstimate - Returns the relative error bound associated to the i-th
   EPSGetErrorEstimate - Returns the error estimate associated to the i-th
   approximate eigenpair.
   computed eigenpair.
 
 
   Not Collective
   Not Collective
 
 
   Input Parameter:
   Input Parameter:
+  eps - eigensolver context
+  eps - eigensolver context
-  i   - index of eigenpair
-  i   - index of eigenpair
 
 
   Output Parameter:
   Output Parameter:
.  errest - the error estimate
.  errest - the error estimate
 
 
 
   Notes:
 
   This is the error estimate used internally by the eigensolver. The actual
 
   error bound can be computed with EPSComputeRelativeError(). See also the user's
 
   manual for details.
 
 
   Level: advanced
   Level: advanced
 
 
.seealso: EPSComputeRelativeError()
.seealso: EPSComputeRelativeError()
@*/
@*/
Line 411... Line 419...
 
 
 
 
#undef __FUNCT__  
#undef __FUNCT__  
#define __FUNCT__ "EPSComputeResidualNorm"
#define __FUNCT__ "EPSComputeResidualNorm"
/*@
/*@
   EPSComputeResidualNorm - Computes the residual norm associated with
   EPSComputeResidualNorm - Computes the norm of the residual vector associated with
   the i-th converged approximate eigenpair.
   the i-th computed eigenpair.
 
 
   Collective on EPS
   Collective on EPS
 
 
   Input Parameter:
   Input Parameter:
.  eps - the eigensolver context
.  eps - the eigensolver context
.  i   - the solution index
.  i   - the solution index
 
 
   Output Parameter:
   Output Parameter:
.  norm - the residual norm, computed as ||Ax-kBx|| where k is the
.  norm - the residual norm, computed as ||Ax-kBx||_2 where k is the
   eigenvalue and x is the eigenvector.
   eigenvalue and x is the eigenvector.
   If k=0 then the residual norm is computed as ||Ax||.
   If k=0 then the residual norm is computed as ||Ax||_2.
 
 
   Notes:
   Notes:
   The index i should be a value between 0 and nconv (see EPSGetConverged()).
   The index i should be a value between 0 and nconv (see EPSGetConverged()).
   Eigenpairs are indexed according to the ordering criterion established
   Eigenpairs are indexed according to the ordering criterion established
   with EPSSetWhichEigenpairs().
   with EPSSetWhichEigenpairs().
Line 499... Line 507...
}
}
 
 
#undef __FUNCT__  
#undef __FUNCT__  
#define __FUNCT__ "EPSComputeRelativeError"
#define __FUNCT__ "EPSComputeRelativeError"
/*@
/*@
   EPSComputeRelativeError - Computes the actual relative error associated
   EPSComputeRelativeError - Computes the relative error bound associated
   with the i-th converged approximate eigenpair.
   with the i-th computed eigenpair.
 
 
   Collective on EPS
   Collective on EPS
 
 
   Input Parameter:
   Input Parameter:
.  eps - the eigensolver context
.  eps - the eigensolver context
.  i   - the solution index
.  i   - the solution index
 
 
   Output Parameter:
   Output Parameter:
.  error - the relative error, computed as ||Ax-kBx||/||kx|| where k is the
.  error - the relative error bound, computed as ||Ax-kBx||_2/||kx||_2 where
   eigenvalue and x is the eigenvector.
   k is the eigenvalue and x is the eigenvector.
   If k=0 the relative error is computed as ||Ax||/||x||.
   If k=0 the relative error is computed as ||Ax||_2/||x||_2.
 
 
   Level: beginner
   Level: beginner
 
 
.seealso: EPSSolve(), EPSComputeResidualNorm()
.seealso: EPSSolve(), EPSComputeResidualNorm(), EPSGetErrorEstimate()
@*/
@*/
PetscErrorCode EPSComputeRelativeError(EPS eps, int i, PetscReal *error)
PetscErrorCode EPSComputeRelativeError(EPS eps, int i, PetscReal *error)
{
{
  PetscErrorCode ierr;
  PetscErrorCode ierr;
  Vec            xr, xi;  
  Vec            xr, xi;