  In many applications, the information about the number of eigenvalues inside
a given region is required. In this paper, we propose a contour-integral based
method for this purpose. The new method is motivated by two findings. There
exist methods for estimating the number of eigenvalues inside a region in the
complex plane. But our method is able to compute the number of eigenvalues
inside the given region exactly. An appealing feature of our method is that it
can integrate with the recently developed contour-integral based eigensolvers
to help them detect whether all desired eigenvalues are found. Numerical
experiments are reported to show the viability of our new method.
