cvxgrp/qcml

Convert dictionary to expression tree

Closed this issue · 0 comments

echu commented
  • "+" is a list concatenation
  • "*" creates a new list (a push)
  • negate modifies coeff on "" (or pushes, if no "" exists)

when adding two lists, if coeffs match, concat / "add" its children, if not, concat the two lists

easy to go from expression tree with linear operators on the "outside"

a_(x+y+z) + x + b_(a*(y+ z))

to an affine expression (walk the tree, populate the dict), which is what we need for something like CVXOPT.

however, we need the tree for codegen for scientific computing