File: EPSSetArbitrarySelection.html

package info (click to toggle)
slepc 3.7.3%2Bdfsg1-5
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 23,788 kB
  • ctags: 100,221
  • sloc: ansic: 79,324; makefile: 3,897; python: 2,734; fortran: 1,139; f90: 225; sh: 100
file content (79 lines) | stat: -rw-r--r-- 4,751 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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML3.2 EN">
<HTML>
<HEAD> <link rel="canonical" href="http://slepc.upv.es/documentation/current/docs/manualpages/EPS/EPSSetArbitrarySelection.html" />
<META NAME="GENERATOR" CONTENT="DOCTEXT">
<link rel="stylesheet" href="/slepc.css" type="text/css">
<TITLE>EPSSetArbitrarySelection</TITLE>
</HEAD>
<BODY BGCOLOR="FFFFFF">
   <div id="version" align=right><b>slepc-3.7.3 2016-09-29</b></div>
   <div id="bugreport" align=right><a href="mailto:slepc-maint@upv.es?subject=Typo or Error in Documentation &body=Please describe the typo or error in the documentation: slepc-3.7.3 v3.7.3 docs/manualpages/EPS/EPSSetArbitrarySelection.html "><small>Report Typos and Errors</small></a></div>

<H1>EPSSetArbitrarySelection</H1>
Specifies a function intended to look for eigenvalues according to an arbitrary selection criterion. This criterion can be based on a computation involving the current eigenvector approximation. 
<H3><FONT COLOR="#883300">Synopsis</FONT></H3>
<PRE>
#include "slepceps.h" 
PetscErrorCode EPSSetArbitrarySelection(EPS eps,PetscErrorCode (*func)(PetscScalar,PetscScalar,Vec,Vec,PetscScalar*,PetscScalar*,void*),void* ctx)
</PRE>
Logically Collective on <A HREF="../EPS/EPS.html#EPS">EPS</A>
<P>
<H3><FONT COLOR="#883300">Input Parameters</FONT></H3>
<TABLE border="0" cellpadding="0" cellspacing="0">
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>eps  </B></TD><TD>&nbsp;- eigensolver context obtained from <A HREF="../EPS/EPSCreate.html#EPSCreate">EPSCreate</A>()
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>func </B></TD><TD>&nbsp;- a pointer to the evaluation function
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>ctx  </B></TD><TD>&nbsp;- a context pointer (the last parameter to the evaluation function)
</TD></TR></TABLE>
<P>
<H3><FONT COLOR="#883300">Calling Sequence of func</FONT></H3>
<pre>
  func(PetscScalar er,PetscScalar ei,Vec xr,Vec xi,PetscScalar *rr,PetscScalar *ri,void *ctx)
</pre>
<P>
<TABLE border="0" cellpadding="0" cellspacing="0">
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>er     </B></TD><TD>&nbsp;- real part of the current eigenvalue approximation
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>ei     </B></TD><TD>&nbsp;- imaginary part of the current eigenvalue approximation
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>xr     </B></TD><TD>&nbsp;- real part of the current eigenvector approximation
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>xi     </B></TD><TD>&nbsp;- imaginary part of the current eigenvector approximation
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>rr     </B></TD><TD>&nbsp;- result of evaluation (real part)
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>ri     </B></TD><TD>&nbsp;- result of evaluation (imaginary part)
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>ctx    </B></TD><TD>&nbsp;- optional context, as set by <A HREF="../EPS/EPSSetArbitrarySelection.html#EPSSetArbitrarySelection">EPSSetArbitrarySelection</A>()
</TD></TR></TABLE>
<P>
<H3><FONT COLOR="#883300">Notes</FONT></H3>
This provides a mechanism to select eigenpairs by evaluating a user-defined
function. When a function has been provided, the default selection based on
sorting the eigenvalues is replaced by the sorting of the results of this
function (with the same sorting criterion given in <A HREF="../EPS/EPSSetWhichEigenpairs.html#EPSSetWhichEigenpairs">EPSSetWhichEigenpairs</A>()).
<P>
For instance, suppose you want to compute those eigenvectors that maximize
a certain computable expression. Then implement the computation using
the arguments xr and xi, and return the result in rr. Then set the standard
sorting by magnitude so that the eigenpair with largest value of rr is
selected.
<P>
This evaluation function is collective, that is, all processes call it and
it can use collective operations; furthermore, the computed result must
be the same in all processes.
<P>
The result of func is expressed as a complex number so that it is possible to
use the standard eigenvalue sorting functions, but normally only rr is used.
Set ri to zero unless it is meaningful in your application.
<P>

<P>
<H3><FONT COLOR="#883300">See Also</FONT></H3>
 <A HREF="../EPS/EPSSetWhichEigenpairs.html#EPSSetWhichEigenpairs">EPSSetWhichEigenpairs</A>()
<BR><P><B><FONT COLOR="#883300">Location: </FONT></B><A HREF="../../../src/eps/interface/epsopts.c.html#EPSSetArbitrarySelection">src/eps/interface/epsopts.c</A>
<BR><A HREF="./index.html">Index of all EPS routines</A>
<BR><A HREF="../../index.html">Table of Contents for all manual pages</A>
<BR><A HREF="../singleindex.html">Index of all manual pages</A>
</BODY></HTML>