Skip to content

Commit

Permalink
Fix matrix overloads for distributed case
Browse files Browse the repository at this point in the history
  • Loading branch information
ckendrick committed Jul 17, 2024
1 parent 78e9756 commit d0686ff
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions bindings/pylibROM/linalg/pyMatrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ void init_matrix(pybind11::module_ &m) {
.def("getFirstNColumns", (void (Matrix::*)(int, Matrix&) const) &Matrix::getFirstNColumns)

.def("mult",[](const Matrix& self, const Matrix& other){
Matrix* result = new Matrix();
Matrix* result = nullptr;
self.mult(other,result);
return result;
},py::return_value_policy::take_ownership)
Expand All @@ -94,7 +94,7 @@ void init_matrix(pybind11::module_ &m) {
})
.def("mult", (void (Matrix::*)(const Matrix&, Matrix&) const) &Matrix::mult)
.def("mult", [](Matrix& self, const Vector& other){
Vector* result = new Vector();
Vector* result = nullptr;
self.mult(other,result);
return result;
}, py::return_value_policy::take_ownership)
Expand All @@ -112,7 +112,7 @@ void init_matrix(pybind11::module_ &m) {
})

.def("elementwise_mult",[](const Matrix& self, const Matrix& other) {
Matrix* result = new Matrix();
Matrix* result = nullptr;
self.elementwise_mult(other, result);
return result;
}, py::return_value_policy::take_ownership)
Expand All @@ -123,7 +123,7 @@ void init_matrix(pybind11::module_ &m) {
.def("elementwise_mult",(void (Matrix::*)(const Matrix&,Matrix&) const) &Matrix::elementwise_mult)

.def("elementwise_square",[](const Matrix& self) {
Matrix* result = new Matrix();
Matrix* result = nullptr;
self.elementwise_square(result);
return result;
},py::return_value_policy::take_ownership)
Expand All @@ -135,7 +135,7 @@ void init_matrix(pybind11::module_ &m) {
.def("multPlus", (void (Matrix::*)(Vector&,const Vector&,double) const) &Matrix::multPlus)

.def("transposeMult",[](const Matrix& self, const Matrix& other) {
Matrix* result = new Matrix();
Matrix* result = nullptr;
self.transposeMult(other, result);
return result;
},py::return_value_policy::take_ownership)
Expand All @@ -145,7 +145,7 @@ void init_matrix(pybind11::module_ &m) {
})
.def("transposeMult", (void (Matrix::*)(const Matrix&, Matrix&) const) &Matrix::transposeMult)
.def("transposeMult",[](const Matrix& self, const Vector& other) {
Vector* result = new Vector();
Vector* result = nullptr;
self.transposeMult(other, result);
return result;
},py::return_value_policy::take_ownership)
Expand Down

0 comments on commit d0686ff

Please sign in to comment.