This project has moved and is read-only. For the latest updates, please go here.

Addition and subtraction operators on vectors and matrices with scalars

Jul 14, 2011 at 10:12 AM

Is there a reason that addition and subtraction operators between vectors and scalars and matrices and scalars isn't implemented? If not I'm willing to add them.

Jul 19, 2011 at 2:20 PM

I personally think we should add this as mathematically speaking adding a scalar to a vector is generally not defined. I think the method "Subtract" should be sufficient for this purpose? Not sure what others think?

Jul 20, 2011 at 9:42 AM

I totally agree that from a mathematical viewpoint adding a scalar to a vector is not defined.

Matlab, which takes an engineering point of view, allows adding scalars to vectors and matrices. It essentially just does a point-wise addition to the vector or matrix.

We're converting a lot of Matlab to C# and it would be useful if this was supported, since our engineers exploit this capability a lot.

Jul 21, 2011 at 2:19 PM

Seems like a useful addition, and not one which would cause unnecessary confusion.