  The structure of many real-world optimization problems includes minimization
of a nonlinear (or quadratic) functional subject to bound and singly linear
constraints (in the form of either equality or bilateral inequality) which are
commonly called as continuous knapsack problems. Since there are efficient
methods to solve large-scale bound constrained nonlinear programs, it is
desirable to adapt these methods to solve knapsack problems, while preserving
their efficiency and convergence theories. The goal of this paper is to
introduce a general framework to extend a box-constrained optimization solver
to solve knapsack problems. This framework includes two main ingredients which
are O(n) methods; in terms of the computational cost and required memory; for
the projection onto the knapsack constrains and the null-space manipulation of
the related linear constraint. The main focus of this work is on the extension
of Hager-Zhang active set algorithm (SIAM J. Optim. 2006, pp. 526--557). The
main reasons for this choice was its promising efficiency in practice as well
as its excellent convergence theories (e.g., superlinear local convergence rate
without strict complementarity assumption). Moreover, this method does not use
any explicit form of second order information and/or solution of linear systems
in the course of optimization which makes it an ideal choice for large-scale
problems. Moreover, application of Birgin and Mart{\'\i}nez active set
algorithm (Comp. Opt. Appl. 2002, pp. 101--125) for knapsack problems is also
briefly commented. The feasibility of the presented algorithm is supported by
numerical results for topology optimization problems.
