version, debug printf
This commit is contained in:
@@ -2,8 +2,8 @@ cmake_minimum_required(VERSION 3.0)
|
|||||||
cmake_policy(SET CMP0017 NEW) # need include() with .cmake
|
cmake_policy(SET CMP0017 NEW) # need include() with .cmake
|
||||||
project(pip)
|
project(pip)
|
||||||
set(pip_MAJOR 2)
|
set(pip_MAJOR 2)
|
||||||
set(pip_MINOR 34)
|
set(pip_MINOR 35)
|
||||||
set(pip_REVISION 1)
|
set(pip_REVISION 0)
|
||||||
set(pip_SUFFIX )
|
set(pip_SUFFIX )
|
||||||
set(pip_COMPANY SHS)
|
set(pip_COMPANY SHS)
|
||||||
set(pip_DOMAIN org.SHS)
|
set(pip_DOMAIN org.SHS)
|
||||||
|
|||||||
@@ -440,7 +440,7 @@ public:
|
|||||||
}
|
}
|
||||||
inline PIDeque<T> & insert(size_t index, const PIDeque<T> & other) {
|
inline PIDeque<T> & insert(size_t index, const PIDeque<T> & other) {
|
||||||
if (other.isEmpty()) return *this;
|
if (other.isEmpty()) return *this;
|
||||||
#ifdef PIP_DEBUG
|
#ifndef NDEBUG
|
||||||
if (&other == this) {
|
if (&other == this) {
|
||||||
printf("error with PIDeque<%s>::insert\n", __PIP_TYPENAME__(T));
|
printf("error with PIDeque<%s>::insert\n", __PIP_TYPENAME__(T));
|
||||||
}
|
}
|
||||||
@@ -549,7 +549,7 @@ public:
|
|||||||
inline PIDeque<T> & append(const T & e) {return push_back(e);}
|
inline PIDeque<T> & append(const T & e) {return push_back(e);}
|
||||||
inline PIDeque<T> & append(T && e) {return push_back(std::move(e));}
|
inline PIDeque<T> & append(T && e) {return push_back(std::move(e));}
|
||||||
inline PIDeque<T> & append(const PIDeque<T> & v) {
|
inline PIDeque<T> & append(const PIDeque<T> & v) {
|
||||||
#ifdef PIP_DEBUG
|
#ifndef NDEBUG
|
||||||
if (&v == this) {
|
if (&v == this) {
|
||||||
printf("error with PIDeque<%s>::append\n", __PIP_TYPENAME__(T));
|
printf("error with PIDeque<%s>::append\n", __PIP_TYPENAME__(T));
|
||||||
}
|
}
|
||||||
@@ -625,7 +625,7 @@ public:
|
|||||||
inline PIDeque<PIDeque<T>> reshape(size_t rows, size_t cols, int order = byRow) const {
|
inline PIDeque<PIDeque<T>> reshape(size_t rows, size_t cols, int order = byRow) const {
|
||||||
PIDeque<PIDeque<T>> ret;
|
PIDeque<PIDeque<T>> ret;
|
||||||
if (isEmpty()) return ret;
|
if (isEmpty()) return ret;
|
||||||
#ifdef PIP_DEBUG
|
#ifndef NDEBUG
|
||||||
if (rows*cols != pid_size) {
|
if (rows*cols != pid_size) {
|
||||||
printf("error with PIDeque<%s>::reshape\n", __PIP_TYPENAME__(T));
|
printf("error with PIDeque<%s>::reshape\n", __PIP_TYPENAME__(T));
|
||||||
}
|
}
|
||||||
@@ -777,7 +777,7 @@ private:
|
|||||||
if (as != pid_rsize) {
|
if (as != pid_rsize) {
|
||||||
PIINTROSPECTION_CONTAINER_ALLOC(T, (as-pid_rsize))
|
PIINTROSPECTION_CONTAINER_ALLOC(T, (as-pid_rsize))
|
||||||
T * p_d = (T*)(realloc((void*)(pid_data), as*sizeof(T)));
|
T * p_d = (T*)(realloc((void*)(pid_data), as*sizeof(T)));
|
||||||
#ifdef PIP_DEBUG
|
#ifndef NDEBUG
|
||||||
if (!p_d) {
|
if (!p_d) {
|
||||||
printf("error with PIDeque<%s>::alloc\n", __PIP_TYPENAME__(T));
|
printf("error with PIDeque<%s>::alloc\n", __PIP_TYPENAME__(T));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -208,7 +208,7 @@ public:
|
|||||||
const T at(const Key & key) const {return (*this)[key];}
|
const T at(const Key & key) const {return (*this)[key];}
|
||||||
|
|
||||||
PIMap<Key, T> & operator <<(const PIMap<Key, T> & other) {
|
PIMap<Key, T> & operator <<(const PIMap<Key, T> & other) {
|
||||||
#ifdef PIP_DEBUG
|
#ifndef NDEBUG
|
||||||
if (&other == this) {
|
if (&other == this) {
|
||||||
printf("error with PIMap<%s, %s>::<<\n", __PIP_TYPENAME__(Key), __PIP_TYPENAME__(T));
|
printf("error with PIMap<%s, %s>::<<\n", __PIP_TYPENAME__(Key), __PIP_TYPENAME__(T));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -103,6 +103,7 @@
|
|||||||
template <typename T>
|
template <typename T>
|
||||||
class PIVector {
|
class PIVector {
|
||||||
public:
|
public:
|
||||||
|
typedef bool (*CompareFunc)(const T & , const T & );
|
||||||
|
|
||||||
//! \~\brief
|
//! \~\brief
|
||||||
//! \~english Constructs an empty vector.
|
//! \~english Constructs an empty vector.
|
||||||
@@ -1200,7 +1201,7 @@ public:
|
|||||||
//! \~\sa \a append(), \a prepend(), \a remove()
|
//! \~\sa \a append(), \a prepend(), \a remove()
|
||||||
inline PIVector<T> & insert(size_t index, const PIVector<T> & v) {
|
inline PIVector<T> & insert(size_t index, const PIVector<T> & v) {
|
||||||
if (v.isEmpty()) return *this;
|
if (v.isEmpty()) return *this;
|
||||||
#ifdef PIP_DEBUG
|
#ifndef NDEBUG
|
||||||
if (&v == this) {
|
if (&v == this) {
|
||||||
printf("error with PIVector<%s>::insert\n", __PIP_TYPENAME__(T));
|
printf("error with PIVector<%s>::insert\n", __PIP_TYPENAME__(T));
|
||||||
}
|
}
|
||||||
@@ -1442,7 +1443,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
inline PIVector<T> & push_back(const PIVector<T> & v) {
|
inline PIVector<T> & push_back(const PIVector<T> & v) {
|
||||||
#ifdef PIP_DEBUG
|
#ifndef NDEBUG
|
||||||
if (&v == this) {
|
if (&v == this) {
|
||||||
printf("error with PIVector<%s>::push_back\n", __PIP_TYPENAME__(T));
|
printf("error with PIVector<%s>::push_back\n", __PIP_TYPENAME__(T));
|
||||||
}
|
}
|
||||||
@@ -1547,7 +1548,7 @@ public:
|
|||||||
inline PIVector<PIVector<T>> reshape(size_t rows, size_t cols, ReshapeOrder order = byRow) const {
|
inline PIVector<PIVector<T>> reshape(size_t rows, size_t cols, ReshapeOrder order = byRow) const {
|
||||||
PIVector<PIVector<T>> ret;
|
PIVector<PIVector<T>> ret;
|
||||||
if (isEmpty()) return ret;
|
if (isEmpty()) return ret;
|
||||||
#ifdef PIP_DEBUG
|
#ifndef NDEBUG
|
||||||
if (rows*cols != piv_size) {
|
if (rows*cols != piv_size) {
|
||||||
printf("error with PIVector<%s>::reshape\n", __PIP_TYPENAME__(T));
|
printf("error with PIVector<%s>::reshape\n", __PIP_TYPENAME__(T));
|
||||||
}
|
}
|
||||||
@@ -1676,7 +1677,7 @@ private:
|
|||||||
if (as == piv_rsize) return;
|
if (as == piv_rsize) return;
|
||||||
PIINTROSPECTION_CONTAINER_ALLOC(T, (as-piv_rsize))
|
PIINTROSPECTION_CONTAINER_ALLOC(T, (as-piv_rsize))
|
||||||
T * p_d = (T*)(realloc((void*)(piv_data), as*sizeof(T)));
|
T * p_d = (T*)(realloc((void*)(piv_data), as*sizeof(T)));
|
||||||
#ifdef PIP_DEBUG
|
#ifndef NDEBUG
|
||||||
if (!p_d) {
|
if (!p_d) {
|
||||||
printf("error with PIVector<%s>::alloc\n", __PIP_TYPENAME__(T));
|
printf("error with PIVector<%s>::alloc\n", __PIP_TYPENAME__(T));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -479,7 +479,7 @@ bool PIEvaluator::fillElements() {
|
|||||||
for (int i = 0; i < content.variables.size_s(); ++i) {
|
for (int i = 0; i < content.variables.size_s(); ++i) {
|
||||||
var_index << PairII(i, content.variables[i].name.length());
|
var_index << PairII(i, content.variables[i].name.length());
|
||||||
}
|
}
|
||||||
var_index.sort([](const PairII & v1, const PairII & v2){return v1.second < v2.second;});
|
var_index.sort([](const PairII & v1, const PairII & v2)->bool{return v1.second < v2.second;});
|
||||||
for (int i = 0; i < var_index.size_s(); i++) {
|
for (int i = 0; i < var_index.size_s(); i++) {
|
||||||
int vind = var_index[i].first;
|
int vind = var_index[i].first;
|
||||||
curfind = content.variables[vind].name;
|
curfind = content.variables[vind].name;
|
||||||
|
|||||||
Reference in New Issue
Block a user