# Quadratic optimization without any cross terms

I need to solve a quadratic program in Java which minimizes a sum of squares. The problem is that there are constraints to be satisfied, and so a quadratic optimizer must be used. I've been thinking of using JOptimizer for this.

However, the problem is that the $x^T A x$ term in the quadratic program. There are approximately 1000 variables, so the $A$ matrix will be dense with a million terms. What a waste of memory! Is there a way around having to make this big matrix in any other Java library that solves quadratic programs?