PIVector2D fix

git-svn-id: svn://db.shs.com.ru/pip@800 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
2019-06-11 13:52:56 +00:00
parent 477c9dc256
commit 1d0ccd3152
3 changed files with 7 additions and 2 deletions

View File

@@ -4,10 +4,11 @@
int main() {
PIVector<double> v;
for (int i=0; i<9; ++i) v << i;
PIVector2D<double> v2(3,3,v);
PIVector2D<double> v2;//(3,3,v);
piCout << v2;
v2.addRow(v);
v2.addRow(PIVector<double>() << 99 << 88 << 77 << 66);
v2.addRow(v2.row(1));
v2.addRow(v2.row(0));
piCout << v2;
return 0;
}

View File

@@ -185,6 +185,7 @@ public:
return *this;
}
inline PIVector2D<T> & addRow(const Row & other) {
if (cols_ == 0) cols_ = other.sz_;
size_t sz = piMin<size_t>(cols_, other.sz_);
size_t ps = mat.size();
mat.resize(mat.size() + cols_);
@@ -193,6 +194,7 @@ public:
return *this;
}
inline PIVector2D<T> & addRow(const RowConst & other) {
if (cols_ == 0) cols_ = other.sz_;
size_t sz = piMin<size_t>(cols_, other.sz_);
size_t ps = mat.size();
mat.resize(mat.size() + cols_);
@@ -201,6 +203,7 @@ public:
return *this;
}
inline PIVector2D<T> & addRow(const PIVector<T> & other) {
if (cols_ == 0) cols_ = other.size();
size_t sz = piMin<size_t>(cols_, other.size());
size_t ps = mat.size();
mat.resize(mat.size() + cols_);

View File

@@ -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