diff --git a/main.cpp b/main.cpp index f911bf4c..4bffc625 100644 --- a/main.cpp +++ b/main.cpp @@ -4,10 +4,11 @@ int main() { PIVector v; for (int i=0; i<9; ++i) v << i; - PIVector2D v2(3,3,v); + PIVector2D v2;//(3,3,v); piCout << v2; + v2.addRow(v); v2.addRow(PIVector() << 99 << 88 << 77 << 66); - v2.addRow(v2.row(1)); + v2.addRow(v2.row(0)); piCout << v2; return 0; } diff --git a/src_main/containers/pivector2d.h b/src_main/containers/pivector2d.h index 3de31062..fa18c504 100644 --- a/src_main/containers/pivector2d.h +++ b/src_main/containers/pivector2d.h @@ -185,6 +185,7 @@ public: return *this; } inline PIVector2D & addRow(const Row & other) { + if (cols_ == 0) cols_ = other.sz_; size_t sz = piMin(cols_, other.sz_); size_t ps = mat.size(); mat.resize(mat.size() + cols_); @@ -193,6 +194,7 @@ public: return *this; } inline PIVector2D & addRow(const RowConst & other) { + if (cols_ == 0) cols_ = other.sz_; size_t sz = piMin(cols_, other.sz_); size_t ps = mat.size(); mat.resize(mat.size() + cols_); @@ -201,6 +203,7 @@ public: return *this; } inline PIVector2D & addRow(const PIVector & other) { + if (cols_ == 0) cols_ = other.size(); size_t sz = piMin(cols_, other.size()); size_t ps = mat.size(); mat.resize(mat.size() + cols_); diff --git a/src_opencl/piopencl.cpp b/src_opencl/piopencl.cpp index 83fa5b7b..8f7313c5 100644 --- a/src_opencl/piopencl.cpp +++ b/src_opencl/piopencl.cpp @@ -1,5 +1,6 @@ #include "piopencl.h" #define CL_USE_DEPRECATED_OPENCL_1_2_APIS +#define CL_USE_DEPRECATED_OPENCL_2_0_APIS #ifdef MAC_OS # include "cl.h" #else