Commit e00161cf authored by Jason Rhinelander's avatar Jason Rhinelander

Add += and -= Bundle operators

They return a Bundle& instead of BundleSigned&
parent ed56ed14
......@@ -114,10 +114,11 @@ void bind_bundles(py::module &m) {
// Bundle has additional operators. Many of these are no different in implementation than the
// BundleNegative versions, but return a Bundle (or Bundle&) instead of a BundleNegative.
bundle
.def(py::self += BundleNegative(), "Adds the quantities of a BundleNegative to the current Bundle")
.def(py::self -= BundleNegative(), "Subtracts the quantities of a BundleNegative from the current Bundle")
.def(py::self *= double(), "Scales a Bundle by a positive constant")
.def(py::self /= double(), "Scales a Bundle by the inverse of a positive constant")
.def(py::self + py::self, "Adds two Bundles together, returning the result (as a Bundle, not a BundleNegative)")
// .def(py::self + BundleNegative(), "Adds a Bundle with a BundleNegative, returning the result as a BundleNegative")
.def(py::self - py::self, "Subtracts one Bundle from another, returning the result in a Bundle. Note that an exception will occur if the subtraction results in negative values")
.def(py::self * double(), "Scales a Bundle by a positive constant, returning the result")
.def(double() * py::self, "Scales a Bundle by a positive constant, returning the result")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment