update boost on linux
This commit is contained in:
@@ -62,7 +62,9 @@
|
||||
// Set the name of our library, this will get undef'ed by auto_link.hpp
|
||||
// once it's done with it:
|
||||
//
|
||||
#define BOOST_LIB_NAME boost_numpy
|
||||
#define _BOOST_PYTHON_CONCAT(N, M, m) N ## M ## m
|
||||
#define BOOST_PYTHON_CONCAT(N, M, m) _BOOST_PYTHON_CONCAT(N, M, m)
|
||||
#define BOOST_LIB_NAME BOOST_PYTHON_CONCAT(boost_numpy, PY_MAJOR_VERSION, PY_MINOR_VERSION)
|
||||
//
|
||||
// If we're importing code from a dll, then tell auto_link.hpp about it:
|
||||
//
|
||||
@@ -75,4 +77,9 @@
|
||||
#include <boost/config/auto_link.hpp>
|
||||
#endif // auto-linking disabled
|
||||
|
||||
#undef BOOST_PYTHON_CONCAT
|
||||
#undef _BOOST_PYTHON_CONCAT
|
||||
|
||||
#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
|
||||
|
||||
#endif // CONFIG_NUMPY20170215_H_
|
||||
|
||||
@@ -13,11 +13,10 @@
|
||||
*/
|
||||
|
||||
#include <boost/python.hpp>
|
||||
#include <boost/python/numpy/numpy_object_mgr_traits.hpp>
|
||||
#include <boost/python/numpy/config.hpp>
|
||||
|
||||
#include <boost/python/numpy/numpy_object_mgr_traits.hpp>
|
||||
#include <boost/mpl/for_each.hpp>
|
||||
#include <boost/type_traits/add_pointer.hpp>
|
||||
#include <boost/python/detail/type_traits.hpp>
|
||||
|
||||
namespace boost { namespace python { namespace numpy {
|
||||
|
||||
@@ -90,7 +89,7 @@ struct builtin_dtype<T,true> {
|
||||
};
|
||||
|
||||
template <>
|
||||
struct builtin_dtype<bool,true> {
|
||||
struct BOOST_NUMPY_DECL builtin_dtype<bool,true> {
|
||||
static dtype get();
|
||||
};
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
|
||||
#include <boost/python.hpp>
|
||||
#include <boost/python/numpy/config.hpp>
|
||||
#ifdef BOOST_PYTHON_NUMPY_INTERNAL
|
||||
#define NO_IMPORT_ARRAY
|
||||
#define NO_IMPORT_UFUNC
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
#include <boost/python.hpp>
|
||||
#include <boost/utility/enable_if.hpp>
|
||||
#include <boost/type_traits/is_integral.hpp>
|
||||
#include <boost/python/detail/type_traits.hpp>
|
||||
#include <boost/python/numpy/numpy_object_mgr_traits.hpp>
|
||||
#include <boost/python/numpy/dtype.hpp>
|
||||
#include <boost/python/numpy/config.hpp>
|
||||
@@ -86,11 +86,11 @@ public:
|
||||
/// @brief Copy the scalar (deep for all non-object fields).
|
||||
ndarray copy() const;
|
||||
|
||||
/// @brief Return the size of the nth dimension.
|
||||
Py_intptr_t shape(int n) const { return get_shape()[n]; }
|
||||
/// @brief Return the size of the nth dimension. raises IndexError if k not in [-get_nd() : get_nd()-1 ]
|
||||
Py_intptr_t shape(int n) const;
|
||||
|
||||
/// @brief Return the stride of the nth dimension.
|
||||
Py_intptr_t strides(int n) const { return get_strides()[n]; }
|
||||
/// @brief Return the stride of the nth dimension. raises IndexError if k not in [-get_nd() : get_nd()-1]
|
||||
Py_intptr_t strides(int n) const;
|
||||
|
||||
/**
|
||||
* @brief Return the array's raw data pointer.
|
||||
@@ -176,7 +176,7 @@ ndarray from_data_impl(void * data,
|
||||
Container strides,
|
||||
object const & owner,
|
||||
bool writeable,
|
||||
typename boost::enable_if< boost::is_integral<typename Container::value_type> >::type * enabled = NULL)
|
||||
typename boost::enable_if< boost::python::detail::is_integral<typename Container::value_type> >::type * enabled = NULL)
|
||||
{
|
||||
std::vector<Py_intptr_t> shape_(shape.begin(),shape.end());
|
||||
std::vector<Py_intptr_t> strides_(strides.begin(), strides.end());
|
||||
|
||||
@@ -106,7 +106,7 @@ struct unary_ufunc
|
||||
dtype in_dtype = dtype::get_builtin<TArgument>();
|
||||
dtype out_dtype = dtype::get_builtin<TResult>();
|
||||
ndarray in_array = from_object(input, in_dtype, ndarray::ALIGNED);
|
||||
ndarray out_array = (output != object()) ?
|
||||
ndarray out_array = ! output.is_none() ?
|
||||
from_object(output, out_dtype, ndarray::ALIGNED | ndarray::WRITEABLE)
|
||||
: zeros(in_array.get_nd(), in_array.get_shape(), out_dtype);
|
||||
multi_iter iter = make_multi_iter(in_array, out_array);
|
||||
@@ -171,7 +171,7 @@ struct binary_ufunc
|
||||
ndarray in1_array = from_object(input1, in1_dtype, ndarray::ALIGNED);
|
||||
ndarray in2_array = from_object(input2, in2_dtype, ndarray::ALIGNED);
|
||||
multi_iter iter = make_multi_iter(in1_array, in2_array);
|
||||
ndarray out_array = (output != object())
|
||||
ndarray out_array = !output.is_none()
|
||||
? from_object(output, out_dtype, ndarray::ALIGNED | ndarray::WRITEABLE)
|
||||
: zeros(iter.get_nd(), iter.get_shape(), out_dtype);
|
||||
iter = make_multi_iter(in1_array, in2_array, out_array);
|
||||
|
||||
Reference in New Issue
Block a user