Module ImportFrom alias alias ImportFrom alias ImportFrom alias Import alias Assign NameStore Dict Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Assign NameStore Str Assign NameStore Str Assign NameStore Str ClassDef bases NameLoad body FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr Str Assign AttributeStore NameLoad attr Str Assign AttributeStore NameLoad attr Str Assign AttributeStore NameLoad attr Str Assign AttributeStore NameLoad attr Str Assign AttributeStore NameLoad attr ListLoad AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr ListLoad Str Str Str Assign AttributeStore NameLoad attr ListLoad NameLoad NameLoad Assign AttributeStore NameLoad attr ListLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Return AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam NameParam defaults Num body Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad If Call NameLoad NameLoad Str body Assign SubscriptStore NameLoad Index Str SubscriptLoad NameLoad Index AttributeLoad NameLoad attr Assign SubscriptStore NameLoad Index Str SubscriptLoad NameLoad Index AttributeLoad NameLoad attr Assign SubscriptStore NameLoad Index Str BinOpAdd AttributeLoad NameLoad attr Str Assign SubscriptStore NameLoad Index Str Call AttributeLoad AttributeLoad NameLoad attr attr Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults Num Num body Assign NameStore Call AttributeLoad NameLoad attr keyword NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Assign SubscriptStore NameLoad Index Str NameLoad Assign NameStore Str Assign SubscriptStore NameLoad Index Str BinOpMod NameLoad NameLoad Assign NameStore Str Assign NameStore BinOpMod NameLoad NameLoad Assign AttributeStore NameLoad attr Num Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr NameLoad TryExcept body If CompareNotEq AttributeLoad NameLoad attr Num body Return NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore BinOpMod Str Dict Str NameLoad Assign NameStore BinOpMod Str TupleLoad NameLoad NameLoad handlers ExceptHandler type NameLoad body Pass Return NameLoad decorator_list decorator_list
N/A __future__ absolute_import print_function c_spec common_base_converter c_spec num_to_c_types N/A numpy N/A num_typecode N/A ? b B h H i I l L q Q f d g F D G PyArray_BOOL PyArray_BYTE PyArray_UBYTE PyArray_SHORT PyArray_USHORT PyArray_INT PyArray_UINT PyArray_LONG PyArray_ULONG PyArray_LONGLONG PyArray_ULONGLONG PyArray_FLOAT PyArray_DOUBLE PyArray_LONGDOUBLE PyArray_CFLOAT PyArray_CDOUBLE PyArray_CLONGDOUBLE N/A type_check_code 
class numpy_type_handler
{
public:
    void conversion_numpy_check_type(PyArrayObject* arr_obj, int numeric_type,
                                     const char* name)
    {
        // Make sure input has correct numeric type.
        int arr_type = arr_obj->descr->type_num;
        if (PyTypeNum_ISEXTENDED(numeric_type))
        {
        char msg[80];
        sprintf(msg, "Conversion Error: extended types not supported for variable '%s'",
                name);
        throw_error(PyExc_TypeError, msg);
        }
        if (!PyArray_EquivTypenums(arr_type, numeric_type))
        {

        const char* type_names[23] = {"bool", "byte", "ubyte","short", "ushort",
                                "int", "uint", "long", "ulong", "longlong", "ulonglong",
                                "float", "double", "longdouble", "cfloat", "cdouble",
                                "clongdouble", "object", "string", "unicode", "void", "ntype",
                                "unknown"};
        char msg[500];
        sprintf(msg,"Conversion Error: received '%s' typed array instead of '%s' typed array for variable '%s'",
                type_names[arr_type],type_names[numeric_type],name);
        throw_error(PyExc_TypeError,msg);
        }
    }

    void numpy_check_type(PyArrayObject* arr_obj, int numeric_type, const char* name)
    {
        // Make sure input has correct numeric type.
        int arr_type = arr_obj->descr->type_num;
        if (PyTypeNum_ISEXTENDED(numeric_type))
        {
        char msg[80];
        sprintf(msg, "Conversion Error: extended types not supported for variable '%s'",
                name);
        throw_error(PyExc_TypeError, msg);
        }
        if (!PyArray_EquivTypenums(arr_type, numeric_type))
        {
            const char* type_names[23] = {"bool", "byte", "ubyte","short", "ushort",
                                    "int", "uint", "long", "ulong", "longlong", "ulonglong",
                                    "float", "double", "longdouble", "cfloat", "cdouble",
                                    "clongdouble", "object", "string", "unicode", "void", "ntype",
                                    "unknown"};
            char msg[500];
            sprintf(msg,"received '%s' typed array instead of '%s' typed array for variable '%s'",
                    type_names[arr_type],type_names[numeric_type],name);
            throw_error(PyExc_TypeError,msg);
        }
    }
};

numpy_type_handler x__numpy_type_handler = numpy_type_handler();
#define conversion_numpy_check_type x__numpy_type_handler.conversion_numpy_check_type
#define numpy_check_type x__numpy_type_handler.numpy_check_type

 N/A size_check_code 
class numpy_size_handler
{
public:
    void conversion_numpy_check_size(PyArrayObject* arr_obj, int Ndims,
                                     const char* name)
    {
        if (arr_obj->nd != Ndims)
        {
            char msg[500];
            sprintf(msg,"Conversion Error: received '%d' dimensional array instead of '%d' dimensional array for variable '%s'",
                    arr_obj->nd,Ndims,name);
            throw_error(PyExc_TypeError,msg);
        }
    }

    void numpy_check_size(PyArrayObject* arr_obj, int Ndims, const char* name)
    {
        if (arr_obj->nd != Ndims)
        {
            char msg[500];
            sprintf(msg,"received '%d' dimensional array instead of '%d' dimensional array for variable '%s'",
                    arr_obj->nd,Ndims,name);
            throw_error(PyExc_TypeError,msg);
        }
    }
};

numpy_size_handler x__numpy_size_handler = numpy_size_handler();
#define conversion_numpy_check_size x__numpy_size_handler.conversion_numpy_check_size
#define numpy_check_size x__numpy_size_handler.numpy_check_size

 N/A numeric_init_code 
Py_Initialize();
import_array();
PyImport_ImportModule("numpy");
 array_converter N/A common_base_converter N/A init_info N/A N/A self N/A N/A N/A N/A N/A common_base_converter init_info self N/A N/A self type_name numpy N/A N/A self check_func PyArray_Check N/A N/A self c_type PyArrayObject* N/A N/A self return_type PyArrayObject* N/A N/A self to_c_return (PyArrayObject*) py_obj N/A N/A self matching_types N/A N/A numpy ndarray N/A N/A self headers N/A "numpy/arrayobject.h" <complex> <math.h> N/A N/A self support_code N/A size_check_code type_check_code N/A N/A self module_init_code N/A numeric_init_code N/A get_var_type N/A N/A self value N/A N/A N/A N/A N/A value dtype char N/A template_vars N/A N/A self inline N/A 0 N/A N/A res N/A N/A common_base_converter template_vars self inline N/A N/A hasattr self var_type N/A N/A N/A res N/A num_type N/A num_to_c_types N/A N/A self var_type N/A N/A res N/A num_typecode N/A num_typecode N/A N/A self var_type N/A N/A res N/A array_name N/A N/A self name _array N/A N/A res N/A cap_name N/A N/A N/A self name upper N/A res N/A declaration_code N/A N/A self templatize inline N/A 0 0 N/A N/A res N/A N/A self template_vars inline inline N/A cap_name N/A N/A N/A self name upper N/A N/A res N/A cap_name cap_name N/A code2 #define %(cap_name)s1(i) (*((%(num_type)s*)(%(array_name)s->data + (i)*S%(name)s[0])))
#define %(cap_name)s2(i,j) (*((%(num_type)s*)(%(array_name)s->data + (i)*S%(name)s[0] + (j)*S%(name)s[1])))
#define %(cap_name)s3(i,j,k) (*((%(num_type)s*)(%(array_name)s->data + (i)*S%(name)s[0] + (j)*S%(name)s[1] + (k)*S%(name)s[2])))
#define %(cap_name)s4(i,j,k,l) (*((%(num_type)s*)(%(array_name)s->data + (i)*S%(name)s[0] + (j)*S%(name)s[1] + (k)*S%(name)s[2] + (l)*S%(name)s[3])))
 N/A N/A res N/A _code2_ N/A code2 res N/A code %(py_var)s = %(var_lookup)s;
%(c_type)s %(array_name)s = %(var_convert)s;
conversion_numpy_check_type(%(array_name)s,%(num_typecode)s,"%(name)s");
%(_code2_)snpy_intp* N%(name)s = %(array_name)s->dimensions;
npy_intp* S%(name)s = %(array_name)s->strides;
int D%(name)s = %(array_name)s->nd;
%(num_type)s* %(name)s = (%(num_type)s*) %(array_name)s->data;
 N/A code N/A code res N/A N/A self __doundef 1 N/A code N/A cleanup_code N/A N/A self N/A N/A N/A code N/A N/A common_base_converter cleanup_code self N/A N/A N/A N/A N/A self __doundef 1 N/A N/A code N/A cap_name N/A N/A N/A self name upper N/A newcode N/A #undef %(cap_name)s1
#undef %(cap_name)s2
#undef %(cap_name)s3
#undef %(cap_name)s4
 N/A cap_name cap_name N/A code N/A %s%s N/A code newcode N/A N/A N/A AttributeError N/A N/A N/A code N/A N/A