A constrained least-squares optimization method for external beam radiation therapy treatment planning