1. A method for configuring a processing system to solve an optimization problem, the method comprising the steps of: for each term of an optimization problem, selecting using a selector one of: (i) a constitutive relation element representing a computation corresponding to the term; and (ii) a linear interconnection element representing a computation transforming a first vector variable associated with the term into a second vector variable associated with the term; interconnecting each selected constitutive relation element and each selected linear interconnection element; and configuring a first processing module of a processing system to implement a computation represented by at least one of a first constitutive relation element and a first linear interconnection element.