  We propose an iterative method for approximately computing the capacity of
discrete memoryless channels, possibly under additional constraints on the
input distribution. Based on duality of convex programming, we derive explicit
upper and lower bounds for the capacity. The presented method requires $O(M^2 N
\sqrt{\log N}/\varepsilon)$ to provide an estimate of the capacity to within
$\varepsilon$, where $N$ and $M$ denote the input and output alphabet size; a
single iteration has a complexity $O(M N)$. We also show how to approximately
compute the capacity of memoryless channels having a bounded continuous input
alphabet and a countable output alphabet under some mild assumptions on the
decay rate of the channel's tail. It is shown that discrete-time Poisson
channels fall into this problem class. As an example, we compute sharp upper
and lower bounds for the capacity of a discrete-time Poisson channel with a
peak-power input constraint.
