PIVector2D fix
git-svn-id: svn://db.shs.com.ru/pip@800 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
5
main.cpp
5
main.cpp
@@ -4,10 +4,11 @@
|
|||||||
int main() {
|
int main() {
|
||||||
PIVector<double> v;
|
PIVector<double> v;
|
||||||
for (int i=0; i<9; ++i) v << i;
|
for (int i=0; i<9; ++i) v << i;
|
||||||
PIVector2D<double> v2(3,3,v);
|
PIVector2D<double> v2;//(3,3,v);
|
||||||
piCout << v2;
|
piCout << v2;
|
||||||
|
v2.addRow(v);
|
||||||
v2.addRow(PIVector<double>() << 99 << 88 << 77 << 66);
|
v2.addRow(PIVector<double>() << 99 << 88 << 77 << 66);
|
||||||
v2.addRow(v2.row(1));
|
v2.addRow(v2.row(0));
|
||||||
piCout << v2;
|
piCout << v2;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -185,6 +185,7 @@ public:
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
inline PIVector2D<T> & addRow(const Row & other) {
|
inline PIVector2D<T> & addRow(const Row & other) {
|
||||||
|
if (cols_ == 0) cols_ = other.sz_;
|
||||||
size_t sz = piMin<size_t>(cols_, other.sz_);
|
size_t sz = piMin<size_t>(cols_, other.sz_);
|
||||||
size_t ps = mat.size();
|
size_t ps = mat.size();
|
||||||
mat.resize(mat.size() + cols_);
|
mat.resize(mat.size() + cols_);
|
||||||
@@ -193,6 +194,7 @@ public:
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
inline PIVector2D<T> & addRow(const RowConst & other) {
|
inline PIVector2D<T> & addRow(const RowConst & other) {
|
||||||
|
if (cols_ == 0) cols_ = other.sz_;
|
||||||
size_t sz = piMin<size_t>(cols_, other.sz_);
|
size_t sz = piMin<size_t>(cols_, other.sz_);
|
||||||
size_t ps = mat.size();
|
size_t ps = mat.size();
|
||||||
mat.resize(mat.size() + cols_);
|
mat.resize(mat.size() + cols_);
|
||||||
@@ -201,6 +203,7 @@ public:
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
inline PIVector2D<T> & addRow(const PIVector<T> & other) {
|
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 sz = piMin<size_t>(cols_, other.size());
|
||||||
size_t ps = mat.size();
|
size_t ps = mat.size();
|
||||||
mat.resize(mat.size() + cols_);
|
mat.resize(mat.size() + cols_);
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#include "piopencl.h"
|
#include "piopencl.h"
|
||||||
#define CL_USE_DEPRECATED_OPENCL_1_2_APIS
|
#define CL_USE_DEPRECATED_OPENCL_1_2_APIS
|
||||||
|
#define CL_USE_DEPRECATED_OPENCL_2_0_APIS
|
||||||
#ifdef MAC_OS
|
#ifdef MAC_OS
|
||||||
# include "cl.h"
|
# include "cl.h"
|
||||||
#else
|
#else
|
||||||
|
|||||||
Reference in New Issue
Block a user