title: (Slightly-) Linear Programming
body: <p>I have a linear subspace <code>S = [v1 v2 v3 v4] = [1 1 1 2]t</code> where t is some scalar real number. </p>
  
  <p>I want to do a transformation on S based on the following: <code>[v1 v2 v3 v4] = [A 2A*B 3*C 10]</code></p>
  
  <p>What is the quickest way for me to define a new subspace <code>T = [A B C]</code> that is a transformation of S with the aforementioned rules?</p>
  
  <p>In this example, the value of <code>T</code> is <code>T = [A B C] = [1 0 1/3]t + [0 1/2 0]</code>. I get this by finding A, B, and C in terms of v1, v2, v3, and v4 in the transformation rules above. <code>A = v1</code> and <code>B = v2/(2A) = v2/(2*v1)</code> and <code>C = v3/3</code>. Then, I substitute in for the values I find for v1, v2, and v3 in S above. In this case, <code>A = 1t</code>, and <code>B = (1/2)*(v2/v1) = 1/2</code> and <code>C = (1/3)t</code>.</p>
  
  <p>I would like to determine this programmatically in Python. I can't really pursue the change-of-basis transformation (<a href="http://en.wikipedia.org/wiki/Change_of_basis" rel="nofollow">http://en.wikipedia.org/wiki/Change_of_basis</a>) because the transformation is not strictly linear. </p>
  
  <p>However, I can guarantee that the transformation only will include scalars and the variables A, B, and C taken to the first power.</p>
  
  <p>Edit: I would prefer that the solution <em>not</em> involve a symbolic math toolkit.</p>
  
  <p>Edit2: Along with the simplest way to pursue this, I would also like a solution that can be practically extended to large arrays (1000s of components).</p>