GalSim-developers/GalSim — pull request #110 by rmjarvis (2012-04-13 19:25:56+00:00)
Title: #86 ready for code review

Again, I did more for this than the original issue asked.

- Implemented obj1 + obj2 to do return same thing as Add([obj1,obj2]). (As per the original issue statement.)
- Also implemented a * obj1 + b * obj2 to do a scaled addition by setting the fluxes appropriately for each component.
- Added obj *= x, which is used by both a * obj and obj * a, so these are equivalent.
- Added a copy() function to GSObject to make it easier to implement a * obj (copy, then do *= a)
- Added unit tests to confirm that all the different ways of adding two things do the same thing.
- Added similar unit tests for GSObject versions of things that I realized weren't there. (e.g. Gaussian, Exponential, applyShear, etc.)
- Updated the constructors for Add and Convolve to allow for multiple kinds of argument lists, similar to the allowed options for SBAdd and SBConvolve. So `Add([obj1,obj2])` is equivalent to `Add(obj1,obj2)` or `sum = Add(obj1); sum.add(obj2)` or `sum = Add(); sum.add(obj1); sum.add(obj2)` or now the new `obj1 + obj2`.