Skip to content
Snippets Groups Projects
Commit a52471ac authored by Gareth Tribello's avatar Gareth Tribello
Browse files

Added functionality to communicator for mpi operations on PLMD::Matrix

parent 3eb2545f
No related branches found
No related tags found
No related merge requests found
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include <string> #include <string>
#include "Vector.h" #include "Vector.h"
#include "Tensor.h" #include "Tensor.h"
#include "Matrix.h"
namespace PLMD{ namespace PLMD{
...@@ -82,6 +83,11 @@ class Communicator{ ...@@ -82,6 +83,11 @@ class Communicator{
if(v.size()>0){ Data d(&v[0],v.size()); pointer=d.pointer; size=d.size; type=d.type; } if(v.size()>0){ Data d(&v[0],v.size()); pointer=d.pointer; size=d.size; type=d.type; }
else { pointer=NULL; size=0; } else { pointer=NULL; size=0; }
} }
/// Init from reference to PLMD::Matrix
template <typename T> Data(Matrix<T>&m ){
if(m.nrows()*m.ncols()>0){ Data d(&m(0,0),m.nrows()*m.ncols()); pointer=d.pointer; size=d.size; type=d.type; }
else{ pointer=NULL; size=0; }
}
/// Init from reference to std::string /// Init from reference to std::string
Data(std::string&s){ Data(std::string&s){
if(s.size()>0){ Data d(&s[0],s.size()); pointer=d.pointer; size=d.size; type=d.type; } if(s.size()>0){ Data d(&s[0],s.size()); pointer=d.pointer; size=d.size; type=d.type; }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment