What's the best way of assembling a big matrix from parts?
I'm using lagrange multipliers to enforce constraints and this kind of
matrix comes up a lot:

[[ K,   G],
 [ G.T  , 0]]

In matlab you can use the syntax
   [K G; G' zeros(nc)]

In numpy I'm using
   vstack([ hstack([ K,G ]), hstack([ G.T, zeros((nc,nc)) ]) ])

Which has a lot of excess verbiage and parentheses that make it hard
to type and hard to parse what's going on.  It would be a little nicer
if there were some kind of function like 'arraystack':

  arraystack( [ [K, G], [G.T, zeros((nc,nc)) ]] )

Is there anything like this already?  I haven't found anything in the
example list like that.  But maybe concatenate() is flexible enough

--bb
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to