scalars.cpp
Go to the documentation of this file.
00001 // Copyright Jim Bosch 2010-2012.
00002 // Distributed under the Boost Software License, Version 1.0.
00003 //    (See accompanying file LICENSE_1_0.txt or copy at
00004 //          http://www.boost.org/LICENSE_1_0.txt)
00005 
00006 #define BOOST_NUMPY_INTERNAL
00007 #include <boost/numpy/internal.hpp>
00008 
00009 namespace boost 
00010 { 
00011 namespace python 
00012 {
00013 namespace converter 
00014 {
00015 NUMPY_OBJECT_MANAGER_TRAITS_IMPL(PyVoidArrType_Type, numpy::void_)
00016 } // namespace boost::python::converter
00017 } // namespace boost::python
00018 
00019 namespace numpy 
00020 {
00021 
00022 void_::void_(Py_ssize_t size)
00023   : object(python::detail::new_reference
00024       (PyObject_CallFunction((PyObject*)&PyVoidArrType_Type, const_cast<char*>("i"), size)))
00025 {}
00026 
00027 void_ void_::view(dtype const & dt) const 
00028 {
00029   return void_(python::detail::new_reference
00030     (PyObject_CallMethod(this->ptr(), const_cast<char*>("view"), const_cast<char*>("O"), dt.ptr())));
00031 }
00032 
00033 void_ void_::copy() const 
00034 {
00035   return void_(python::detail::new_reference
00036     (PyObject_CallMethod(this->ptr(), const_cast<char*>("copy"), const_cast<char*>(""))));
00037 }
00038 
00039 }
00040 }


boost_numpy
Author(s): Jim Bosch, Ankit Daftery
autogenerated on Fri Aug 28 2015 10:10:40