Search is not available for this dataset
repo_id
stringlengths
12
110
file_path
stringlengths
24
164
content
stringlengths
3
89.3M
__index_level_0__
int64
0
0
public_repos/numpy/numpy
public_repos/numpy/numpy/_core/cversions.py
"""Simple script to compute the api hash of the current API. The API has is defined by numpy_api_order and ufunc_api_order. """ from os.path import dirname from code_generators.genapi import fullapi_hash from code_generators.numpy_api import full_api if __name__ == '__main__': curdir = dirname(__file__) pri...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/_core/einsumfunc.pyi
from collections.abc import Sequence from typing import TypeVar, Any, overload, Literal from numpy import ( bool_, number, _OrderKACF, ) from numpy._typing import ( NDArray, _ArrayLikeBool_co, _ArrayLikeUInt_co, _ArrayLikeInt_co, _ArrayLikeFloat_co, _ArrayLikeComplex_co, _ArrayL...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/_core/shape_base.py
__all__ = ['atleast_1d', 'atleast_2d', 'atleast_3d', 'block', 'hstack', 'stack', 'vstack'] import functools import itertools import operator import warnings from . import numeric as _nx from . import overrides from .multiarray import array, asanyarray, normalize_axis_index from . import fromnumeric as _fro...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/_core/records.pyi
import os from collections.abc import Sequence, Iterable from typing import ( Any, TypeVar, overload, Protocol, SupportsIndex, Literal ) from numpy import ( ndarray, dtype, generic, void, _ByteOrder, _SupportsBuffer, _ShapeType, _DType_co, _OrderKACF, ) from...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/_core/defchararray.py
""" This module contains a set of functions for vectorized string operations and methods. .. note:: The `chararray` class exists for backwards compatibility with Numarray, it is not recommended for new development. Starting from numpy 1.4, if one needs arrays of strings, it is recommended to use arrays of ...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/_core/umath.py
""" Create the numpy._core.umath namespace for backward compatibility. In v1.16 the multiarray and umath c-extension modules were merged into a single _multiarray_umath extension module. So we replicate the old namespace by importing from the extension module. """ from . import _multiarray_umath from ._multiarray_uma...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/_core/records.py
""" Record Arrays ============= Record arrays expose the fields of structured arrays as properties. Most commonly, ndarrays contain elements of a single type, e.g. floats, integers, bools etc. However, it is possible for elements to be combinations of these using structured types, such as:: >>> a = np.array([(1, 2...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/_core/function_base.pyi
from typing import ( Literal as L, overload, Any, SupportsIndex, TypeVar, ) from numpy import floating, complexfloating, generic from numpy._typing import ( NDArray, DTypeLike, _DTypeLike, _ArrayLikeFloat_co, _ArrayLikeComplex_co, ) _SCT = TypeVar("_SCT", bound=generic) __all_...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/_core/feature_detection_stdio.h
#include <stdio.h> #include <fcntl.h> off_t ftello(FILE *stream); int fseeko(FILE *stream, off_t offset, int whence); int fallocate(int, int, off_t, off_t);
0
public_repos/numpy/numpy
public_repos/numpy/numpy/_core/numeric.py
import functools import itertools import operator import sys import warnings import numbers import builtins import numpy as np from . import multiarray from . import numerictypes as nt from .multiarray import ( ALLOW_THREADS, BUFSIZE, CLIP, MAXDIMS, MAY_SHARE_BOUNDS, MAY_SHARE_EXACT, RAISE, WRAP, arange, a...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/_core/memmap.py
from contextlib import nullcontext import operator import numpy as np from .._utils import set_module from .numeric import uint8, ndarray, dtype __all__ = ['memmap'] dtypedescr = dtype valid_filemodes = ["r", "c", "r+", "w+"] writeable_filemodes = ["r+", "w+"] mode_equivalents = { "readonly":"r", "copyonwrit...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/_core/overrides.py
"""Implementation of __array_function__ overrides from NEP-18.""" import collections import functools import os from .._utils import set_module from .._utils._inspect import getargspec from numpy._core._multiarray_umath import ( add_docstring, _get_implementing_args, _ArrayFunctionDispatcher) ARRAY_FUNCTIONS = ...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/_core/multiarray.py
""" Create the numpy._core.multiarray namespace for backward compatibility. In v1.16 the multiarray and umath c-extension modules were merged into a single _multiarray_umath extension module. So we replicate the old namespace by importing from the extension module. """ import functools from . import overrides from...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/_core/_type_aliases.py
""" Due to compatibility, numpy has a very large number of different naming conventions for the scalar types (those subclassing from `numpy.generic`). This file produces a convoluted set of dictionaries mapping names to types, and sometimes other mappings too. .. data:: allTypes A dictionary of names to types that...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/_core/fromnumeric.py
"""Module containing non-deprecated functions borrowed from Numeric. """ import functools import types import warnings import numpy as np from .._utils import set_module from . import multiarray as mu from . import overrides from . import umath as um from . import numerictypes as nt from .multiarray import asarray, a...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/_core/_asarray.py
""" Functions in the ``as*array`` family that promote array-likes into arrays. `require` fits this category despite its name not matching this pattern. """ from .overrides import ( array_function_dispatch, set_array_function_like_doc, set_module, ) from .multiarray import array, asanyarray __all__ = ["re...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/_core/multiarray.pyi
# TODO: Sort out any and all missing functions in this namespace import os import datetime as dt from collections.abc import Sequence, Callable, Iterable from typing import ( Literal as L, Any, overload, TypeVar, SupportsIndex, final, Final, Protocol, ClassVar, ) from numpy import ...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/_core/_ufunc_config.pyi
from collections.abc import Callable from typing import Any, Literal, TypedDict from numpy import _SupportsWrite _ErrKind = Literal["ignore", "warn", "raise", "call", "print", "log"] _ErrFunc = Callable[[str, int], Any] class _ErrDict(TypedDict): divide: _ErrKind over: _ErrKind under: _ErrKind invali...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/_core/arrayprint.pyi
from collections.abc import Callable from typing import Any, Literal, TypedDict, SupportsIndex # Using a private class is by no means ideal, but it is simply a consequence # of a `contextlib.context` returning an instance of aforementioned class from contextlib import _GeneratorContextManager from numpy import ( ...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/_core/function_base.py
import functools import warnings import operator import types import numpy as np from . import numeric as _nx from .numeric import result_type, nan, asanyarray, ndim from numpy._core.multiarray import add_docstring from numpy._core import overrides __all__ = ['logspace', 'linspace', 'geomspace'] array_function_disp...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/_core/mlib.ini.in
[meta] Name = mlib Description = Math library used with this version of numpy Version = 1.0 [default] Libs=@posix_mathlib@ Cflags= [msvc] Libs=@msvc_mathlib@ Cflags=
0
public_repos/numpy/numpy
public_repos/numpy/numpy/_core/_string_helpers.py
""" String-handling utilities to avoid locale-dependence. Used primarily to generate type name aliases. """ # "import string" is costly to import! # Construct the translation tables directly # "A" = chr(65), "a" = chr(97) _all_chars = tuple(map(chr, range(256))) _ascii_upper = _all_chars[65:65+26] _ascii_lower = _al...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/_core/_exceptions.py
""" Various richly-typed exceptions, that also help us deal with string formatting in python where it's easier. By putting the formatting in `__str__`, we also avoid paying the cost for users who silence the exceptions. """ from .._utils import set_module def _unpack_tuple(tup): if len(tup) == 1: return t...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/_core/_internal.pyi
from typing import Any, TypeVar, overload, Generic import ctypes as ct from numpy.typing import NDArray from numpy.ctypeslib import c_intp _CastT = TypeVar("_CastT", bound=ct._CanCastTo) # Copied from `ctypes.cast` _CT = TypeVar("_CT", bound=ct._CData) _PT = TypeVar("_PT", bound=int) # TODO: Let the likes of `shape...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/_core/npymath.ini.in
[meta] Name=npymath Description=Portable, core math library implementing C99 standard Version=0.1 [variables] pkgname=@pkgname@ prefix=${pkgdir} libdir=${prefix}@sep@lib includedir=${prefix}@sep@include [default] Libs=-L${libdir} -lnpymath Cflags=-I${includedir} Requires=mlib [msvc] Libs=/LIBPATH:${libdir} npymath.l...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/_core/getlimits.pyi
from numpy import ( finfo as finfo, iinfo as iinfo, ) __all__: list[str]
0
public_repos/numpy/numpy
public_repos/numpy/numpy/_core/feature_detection_misc.h
#include <stddef.h> int backtrace(void **, int); int madvise(void *, size_t, int);
0
public_repos/numpy/numpy
public_repos/numpy/numpy/_core/_methods.py
""" Array methods which are called by both the C-code for the method and the Python code for the NumPy-namespace function """ import os import pickle import warnings from contextlib import nullcontext from numpy._core import multiarray as mu from numpy._core import umath as um from numpy._core.multiarray import asany...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/_core/arrayprint.py
"""Array printing function $Id: arrayprint.py,v 1.9 2005/09/13 13:58:44 teoliphant Exp $ """ __all__ = ["array2string", "array_str", "array_repr", "set_printoptions", "get_printoptions", "printoptions", "format_float_positional", "format_float_scientific"] __docformat__ = 'restructuredtext' # #...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/_core/_machar.py
""" Machine arithmetic - determine the parameters of the floating-point arithmetic system Author: Pearu Peterson, September 2003 """ __all__ = ['MachAr'] from .fromnumeric import any from ._ufunc_config import errstate from .._utils import set_module # Need to speed this up...especially for longdouble # Deprecated...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/_core/__init__.py
""" Contains the core of NumPy: ndarray, ufuncs, dtypes, etc. Please note that this module is private. All functions and objects are available in the main ``numpy`` namespace - use that instead. """ import os from numpy.version import version as __version__ # disables OpenBLAS affinity setting of the main thread...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/_core/getlimits.py
"""Machine limits for Float32 and Float64 and (long double) if available... """ __all__ = ['finfo', 'iinfo'] import warnings from .._utils import set_module from ._machar import MachAr from . import numeric from . import numerictypes as ntypes from .numeric import array, inf, nan from .umath import log10, exp2, next...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/_core/_add_newdocs.py
""" This is only meant to add docs to objects defined in C-extension modules. The purpose is to allow easier editing of the docstrings without requiring a re-compile. NOTE: Many of the methods of ndarray have corresponding functions. If you update these docstrings, please keep also the ones in _core/fromnu...
0
public_repos/numpy/numpy/_core
public_repos/numpy/numpy/_core/include/meson.build
installed_headers = [ 'numpy/_neighborhood_iterator_imp.h', 'numpy/arrayobject.h', 'numpy/arrayscalars.h', 'numpy/_dtype_api.h', 'numpy/experimental_dtype_api.h', 'numpy/halffloat.h', 'numpy/ndarrayobject.h', 'numpy/ndarraytypes.h', 'numpy/npy_1_7_deprecated_api.h', 'numpy/npy_2_compat.h', 'numpy/...
0
public_repos/numpy/numpy/_core/include
public_repos/numpy/numpy/_core/include/numpy/arrayobject.h
#ifndef NUMPY_CORE_INCLUDE_NUMPY_ARRAYOBJECT_H_ #define NUMPY_CORE_INCLUDE_NUMPY_ARRAYOBJECT_H_ #define Py_ARRAYOBJECT_H #include "ndarrayobject.h" #endif /* NUMPY_CORE_INCLUDE_NUMPY_ARRAYOBJECT_H_ */
0
public_repos/numpy/numpy/_core/include
public_repos/numpy/numpy/_core/include/numpy/npy_1_7_deprecated_api.h
#ifndef NPY_DEPRECATED_INCLUDES #error "Should never include npy_*_*_deprecated_api directly." #endif #ifndef NUMPY_CORE_INCLUDE_NUMPY_NPY_1_7_DEPRECATED_API_H_ #define NUMPY_CORE_INCLUDE_NUMPY_NPY_1_7_DEPRECATED_API_H_ /* Emit a warning if the user did not specifically request the old API */ #ifndef NPY_NO_DEPRECATE...
0
public_repos/numpy/numpy/_core/include
public_repos/numpy/numpy/_core/include/numpy/_dtype_api.h
/* * DType related API shared by the (experimental) public API And internal API. */ #ifndef NUMPY_CORE_INCLUDE_NUMPY___DTYPE_API_H_ #define NUMPY_CORE_INCLUDE_NUMPY___DTYPE_API_H_ #define __EXPERIMENTAL_DTYPE_API_VERSION 15 struct PyArrayMethodObject_tag; /* * Largely opaque struct for DType classes (i.e. metacl...
0
public_repos/numpy/numpy/_core/include
public_repos/numpy/numpy/_core/include/numpy/arrayscalars.h
#ifndef NUMPY_CORE_INCLUDE_NUMPY_ARRAYSCALARS_H_ #define NUMPY_CORE_INCLUDE_NUMPY_ARRAYSCALARS_H_ #ifndef _MULTIARRAYMODULE typedef struct { PyObject_HEAD npy_bool obval; } PyBoolScalarObject; #endif typedef struct { PyObject_HEAD signed char obval; } PyByteScalarObject; typedef str...
0
public_repos/numpy/numpy/_core/include
public_repos/numpy/numpy/_core/include/numpy/npy_os.h
#ifndef NUMPY_CORE_INCLUDE_NUMPY_NPY_OS_H_ #define NUMPY_CORE_INCLUDE_NUMPY_NPY_OS_H_ #if defined(linux) || defined(__linux) || defined(__linux__) #define NPY_OS_LINUX #elif defined(__FreeBSD__) || defined(__NetBSD__) || \ defined(__OpenBSD__) || defined(__DragonFly__) #define NPY_OS_BSD #ifdef...
0
public_repos/numpy/numpy/_core/include
public_repos/numpy/numpy/_core/include/numpy/.doxyfile
INCLUDE_PATH += @CUR_DIR PREDEFINED += NPY_INTERNAL_BUILD
0
public_repos/numpy/numpy/_core/include
public_repos/numpy/numpy/_core/include/numpy/npy_3kcompat.h
/* * This is a convenience header file providing compatibility utilities * for supporting different minor versions of Python 3. * It was originally used to support the transition from Python 2, * hence the "3k" naming. * * If you want to use this for your own projects, it's recommended to make a * copy of it. Al...
0
public_repos/numpy/numpy/_core/include
public_repos/numpy/numpy/_core/include/numpy/npy_math.h
#ifndef NUMPY_CORE_INCLUDE_NUMPY_NPY_MATH_H_ #define NUMPY_CORE_INCLUDE_NUMPY_NPY_MATH_H_ #include <numpy/npy_common.h> #include <math.h> /* By adding static inline specifiers to npy_math function definitions when appropriate, compiler is given the opportunity to optimize */ #if NPY_INLINE_MATH #define NPY_INPLAC...
0
public_repos/numpy/numpy/_core/include
public_repos/numpy/numpy/_core/include/numpy/ufuncobject.h
#ifndef NUMPY_CORE_INCLUDE_NUMPY_UFUNCOBJECT_H_ #define NUMPY_CORE_INCLUDE_NUMPY_UFUNCOBJECT_H_ #include <numpy/npy_math.h> #include <numpy/npy_common.h> #ifdef __cplusplus extern "C" { #endif /* * The legacy generic inner loop for a standard element-wise or * generalized ufunc. */ typedef void (*PyUFuncGenericFu...
0
public_repos/numpy/numpy/_core/include
public_repos/numpy/numpy/_core/include/numpy/halffloat.h
#ifndef NUMPY_CORE_INCLUDE_NUMPY_HALFFLOAT_H_ #define NUMPY_CORE_INCLUDE_NUMPY_HALFFLOAT_H_ #include <Python.h> #include <numpy/npy_math.h> #ifdef __cplusplus extern "C" { #endif /* * Half-precision routines */ /* Conversions */ float npy_half_to_float(npy_half h); double npy_half_to_double(npy_half h); npy_half ...
0
public_repos/numpy/numpy/_core/include
public_repos/numpy/numpy/_core/include/numpy/npy_common.h
#ifndef NUMPY_CORE_INCLUDE_NUMPY_NPY_COMMON_H_ #define NUMPY_CORE_INCLUDE_NUMPY_NPY_COMMON_H_ /* need Python.h for npy_intp, npy_uintp */ #include <Python.h> /* numpconfig.h is auto-generated */ #include "numpyconfig.h" #ifdef HAVE_NPY_CONFIG_H #include <npy_config.h> #endif /* * using static inline modifiers when ...
0
public_repos/numpy/numpy/_core/include
public_repos/numpy/numpy/_core/include/numpy/ndarraytypes.h
#ifndef NUMPY_CORE_INCLUDE_NUMPY_NDARRAYTYPES_H_ #define NUMPY_CORE_INCLUDE_NUMPY_NDARRAYTYPES_H_ #include "npy_common.h" #include "npy_endian.h" #include "npy_cpu.h" #include "utils.h" #define NPY_NO_EXPORT NPY_VISIBILITY_HIDDEN /* Only use thread if configured in config and python supports it */ #if defined WITH_T...
0
public_repos/numpy/numpy/_core/include
public_repos/numpy/numpy/_core/include/numpy/npy_endian.h
#ifndef NUMPY_CORE_INCLUDE_NUMPY_NPY_ENDIAN_H_ #define NUMPY_CORE_INCLUDE_NUMPY_NPY_ENDIAN_H_ /* * NPY_BYTE_ORDER is set to the same value as BYTE_ORDER set by glibc in * endian.h */ #if defined(NPY_HAVE_ENDIAN_H) || defined(NPY_HAVE_SYS_ENDIAN_H) /* Use endian.h if available */ #if defined(NPY_HAVE_ENDIA...
0
public_repos/numpy/numpy/_core/include
public_repos/numpy/numpy/_core/include/numpy/npy_no_deprecated_api.h
/* * This include file is provided for inclusion in Cython *.pyd files where * one would like to define the NPY_NO_DEPRECATED_API macro. It can be * included by * * cdef extern from "npy_no_deprecated_api.h": pass * */ #ifndef NPY_NO_DEPRECATED_API /* put this check here since there may be multiple includes in ...
0
public_repos/numpy/numpy/_core/include
public_repos/numpy/numpy/_core/include/numpy/npy_cpu.h
/* * This set (target) cpu specific macros: * - Possible values: * NPY_CPU_X86 * NPY_CPU_AMD64 * NPY_CPU_PPC * NPY_CPU_PPC64 * NPY_CPU_PPC64LE * NPY_CPU_SPARC * NPY_CPU_S390 * NPY_CPU_IA64 * ...
0
public_repos/numpy/numpy/_core/include
public_repos/numpy/numpy/_core/include/numpy/npy_2_complexcompat.h
/* This header is designed to be copy-pasted into downstream packages, since it provides a compatibility layer between the old C struct complex types and the new native C99 complex types. The new macros are in numpy/npy_math.h, which is why it is included here. */ #ifndef NUMPY_CORE_INCLUDE_NUMPY_NPY_2_COMPLEXCOM...
0
public_repos/numpy/numpy/_core/include
public_repos/numpy/numpy/_core/include/numpy/experimental_dtype_api.h
/* * This header exports the new experimental DType API as proposed in * NEPs 41 to 43. For background, please check these NEPs. Otherwise, * this header also serves as documentation for the time being. * * The header includes `_dtype_api.h` which holds most definition while this * header mainly wraps functions...
0
public_repos/numpy/numpy/_core/include
public_repos/numpy/numpy/_core/include/numpy/ndarrayobject.h
/* * DON'T INCLUDE THIS DIRECTLY. */ #ifndef NUMPY_CORE_INCLUDE_NUMPY_NDARRAYOBJECT_H_ #define NUMPY_CORE_INCLUDE_NUMPY_NDARRAYOBJECT_H_ #ifdef __cplusplus extern "C" { #endif #include <Python.h> #include "ndarraytypes.h" /* Includes the "function" C-API -- these are all stored in a list of pointers --- one for...
0
public_repos/numpy/numpy/_core/include
public_repos/numpy/numpy/_core/include/numpy/numpyconfig.h
#ifndef NUMPY_CORE_INCLUDE_NUMPY_NPY_NUMPYCONFIG_H_ #define NUMPY_CORE_INCLUDE_NUMPY_NPY_NUMPYCONFIG_H_ #include "_numpyconfig.h" /* * On Mac OS X, because there is only one configuration stage for all the archs * in universal builds, any macro which depends on the arch needs to be * hardcoded. * * Note that dis...
0
public_repos/numpy/numpy/_core/include
public_repos/numpy/numpy/_core/include/numpy/_neighborhood_iterator_imp.h
#ifndef NUMPY_CORE_INCLUDE_NUMPY__NEIGHBORHOOD_IMP_H_ #error You should not include this header directly #endif /* * Private API (here for inline) */ static inline int _PyArrayNeighborhoodIter_IncrCoord(PyArrayNeighborhoodIterObject* iter); /* * Update to next item of the iterator * * Note: this simply increment ...
0
public_repos/numpy/numpy/_core/include
public_repos/numpy/numpy/_core/include/numpy/_numpyconfig.h.in
#mesondefine NPY_HAVE_ENDIAN_H #mesondefine NPY_SIZEOF_SHORT #mesondefine NPY_SIZEOF_INT #mesondefine NPY_SIZEOF_LONG #mesondefine NPY_SIZEOF_FLOAT #mesondefine NPY_SIZEOF_COMPLEX_FLOAT #mesondefine NPY_SIZEOF_DOUBLE #mesondefine NPY_SIZEOF_COMPLEX_DOUBLE #mesondefine NPY_SIZEOF_LONGDOUBLE #mesondefine NPY_SIZEOF_COMP...
0
public_repos/numpy/numpy/_core/include
public_repos/numpy/numpy/_core/include/numpy/utils.h
#ifndef NUMPY_CORE_INCLUDE_NUMPY_UTILS_H_ #define NUMPY_CORE_INCLUDE_NUMPY_UTILS_H_ #ifndef __COMP_NPY_UNUSED #if defined(__GNUC__) #define __COMP_NPY_UNUSED __attribute__ ((__unused__)) #elif defined(__ICC) #define __COMP_NPY_UNUSED __attribute__ ((__unused__)) #elif defined(__clang__) ...
0
public_repos/numpy/numpy/_core/include
public_repos/numpy/numpy/_core/include/numpy/npy_2_compat.h
/* * This header file defines relevant features which: * - Require runtime inspection depending on the NumPy version. * - May be needed when compiling with an older version of NumPy to allow * a smooth transition. * * As such, it is shipped with NumPy 2.0, but designed to be vendored in full * or parts by down...
0
public_repos/numpy/numpy/_core/include/numpy
public_repos/numpy/numpy/_core/include/numpy/libdivide/LICENSE.txt
zlib License ------------ Copyright (C) 2010 - 2019 ridiculous_fish, <libdivide@ridiculousfish.com> Copyright (C) 2016 - 2019 Kim Walisch, <kim.walisch@gmail.com> This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages aris...
0
public_repos/numpy/numpy/_core/include/numpy
public_repos/numpy/numpy/_core/include/numpy/libdivide/libdivide.h
// libdivide.h - Optimized integer division // https://libdivide.com // // Copyright (C) 2010 - 2019 ridiculous_fish, <libdivide@ridiculousfish.com> // Copyright (C) 2016 - 2019 Kim Walisch, <kim.walisch@gmail.com> // // libdivide is dual-licensed under the Boost or zlib licenses. // You may use libdivide under the ter...
0
public_repos/numpy/numpy/_core/include/numpy
public_repos/numpy/numpy/_core/include/numpy/random/bitgen.h
#ifndef NUMPY_CORE_INCLUDE_NUMPY_RANDOM_BITGEN_H_ #define NUMPY_CORE_INCLUDE_NUMPY_RANDOM_BITGEN_H_ #pragma once #include <stddef.h> #include <stdbool.h> #include <stdint.h> /* Must match the declaration in numpy/random/<any>.pxd */ typedef struct bitgen { void *state; uint64_t (*next_uint64)(void *st); uint32...
0
public_repos/numpy/numpy/_core/include/numpy
public_repos/numpy/numpy/_core/include/numpy/random/distributions.h
#ifndef NUMPY_CORE_INCLUDE_NUMPY_RANDOM_DISTRIBUTIONS_H_ #define NUMPY_CORE_INCLUDE_NUMPY_RANDOM_DISTRIBUTIONS_H_ #ifdef __cplusplus extern "C" { #endif #include <Python.h> #include "numpy/npy_common.h" #include <stddef.h> #include <stdbool.h> #include <stdint.h> #include "numpy/npy_math.h" #include "numpy/random/bi...
0
public_repos/numpy/numpy/_core
public_repos/numpy/numpy/_core/src/dummymodule.c
/* -*- c -*- */ /* * This is a dummy module whose purpose is to get distutils to generate the * configuration files before the libraries are made. */ #define NPY_NO_DEPRECATED_API NPY_API_VERSION #define NO_IMPORT_ARRAY #define PY_SSIZE_T_CLEAN #include <Python.h> #include "npy_pycompat.h" static struct PyMethod...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/npymath/npy_math_complex.c.src
/* * vim: syntax=c * * Implement some C99-compatible complex math functions * * Most of the code is taken from the msun library in FreeBSD (HEAD @ 4th * October 2013), under the following license: * * Copyright (c) 2007, 2011 David Schultz <das@FreeBSD.ORG> * Copyright (c) 2012 Stephen Montgomery-Smith <stephe...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/npymath/npy_math.c
/* * vim:syntax=c * This file is compiled into the npy_math library with externally visible * symbols, and the static and inline specifiers utilized in the npy_math * function definitions are switched off. */ #define NPY_INLINE_MATH 0 #include "npy_math_internal.h"
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/npymath/npy_math_private.h
/* * * ==================================================== * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. * * Developed at SunPro, a Sun Microsystems, Inc. business. * Permission to use, copy, modify, and distribute this * software is freely granted, provided that this notice * is preserve...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/npymath/ieee754.c.src
/* -*- c -*- */ /* * vim:syntax=c * * Low-level routines related to IEEE-754 format */ #include "npy_math_common.h" #include "npy_math_private.h" #include "numpy/utils.h" /* The below code is provided for compilers which do not yet provide C11 compatibility (gcc 4.5 and older) */ #ifndef LDBL_TRUE_MIN #define LD...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/npymath/npy_math_internal.h.src
/* * vim:syntax=c * A small module to implement missing C99 math capabilities required by numpy * * Please keep this independent of python ! Only basic types (npy_longdouble) * can be used, otherwise, pure C, without any use of Python facilities * * How to add a function to this section * ----------------------...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/npymath/ieee754.cpp
/* -*- c -*- */ /* * vim:syntax=c * * Low-level routines related to IEEE-754 format */ #include "numpy/utils.h" #include "npy_math_common.h" #include "npy_math_private.h" /* The below code is provided for compilers which do not yet provide C11 compatibility (gcc 4.5 and older) */ #ifndef LDBL_TRUE_MIN #define ...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/npymath/halffloat.cpp
#define NPY_NO_DEPRECATED_API NPY_API_VERSION /* * If these are 1, the conversions try to trigger underflow, * overflow, and invalid exceptions in the FP system when needed. */ #define NPY_HALF_GENERATE_OVERFLOW 1 #define NPY_HALF_GENERATE_INVALID 1 #include "numpy/halffloat.h" #include "common.hpp" /* *********...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/npymath/npy_math_common.h
/* * Common headers needed by every npy math compilation unit */ #include <Python.h> #include <math.h> #include <float.h> #include "npy_config.h" #include "numpy/npy_math.h"
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/npymath/arm64_exports.c
#if defined(__arm64__) && defined(__APPLE__) #include <math.h> /* * Export these for scipy, since the SciPy build for macos arm64 * downloads the macos x86_64 NumPy, and does not error when the * linker fails to use npymathlib.a. Importing numpy will expose * these external functions * See https://github.com/nump...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/common/numpy_tag.h
#ifndef _NPY_COMMON_TAG_H_ #define _NPY_COMMON_TAG_H_ #include "../npysort/npysort_common.h" namespace npy { template<typename... tags> struct taglist { static constexpr unsigned size = sizeof...(tags); }; struct integral_tag { }; struct floating_point_tag { }; struct complex_tag { }; struct date_tag { }; struct...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/common/half.hpp
#ifndef NUMPY_CORE_SRC_COMMON_HALF_HPP #define NUMPY_CORE_SRC_COMMON_HALF_HPP #include "npstd.hpp" #include "npy_cpu_dispatch.h" // NPY_HAVE_CPU_FEATURES #include "half_private.hpp" // TODO(@seiko2plus): // - covers half-precision operations that being supported by numpy/halffloat.h // - add support for arithmetic o...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/common/lowlevel_strided_loops.h
#ifndef NUMPY_CORE_SRC_COMMON_LOWLEVEL_STRIDED_LOOPS_H_ #define NUMPY_CORE_SRC_COMMON_LOWLEVEL_STRIDED_LOOPS_H_ #include "common.h" #include "npy_config.h" #include "array_method.h" #include "dtype_transfer.h" #include "mem_overlap.h" #include "mapping.h" /* For PyArray_ macros used below */ #include "numpy/ndarrayobj...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/common/cblasfuncs.h
#ifndef NUMPY_CORE_SRC_COMMON_CBLASFUNCS_H_ #define NUMPY_CORE_SRC_COMMON_CBLASFUNCS_H_ NPY_NO_EXPORT PyObject * cblas_matrixproduct(int, PyArrayObject *, PyArrayObject *, PyArrayObject *); #endif /* NUMPY_CORE_SRC_COMMON_CBLASFUNCS_H_ */
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/common/npy_svml.h
#if NPY_SIMD && defined(NPY_HAVE_AVX512_SKX) && defined(NPY_CAN_LINK_SVML) extern __m512 __svml_expf16(__m512 x); extern __m512 __svml_exp2f16(__m512 x); extern __m512 __svml_logf16(__m512 x); extern __m512 __svml_log2f16(__m512 x); extern __m512 __svml_log10f16(__m512 x); extern __m512 __svml_expm1f16(__m512 x); exter...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/common/npy_cpu_features.h
#ifndef NUMPY_CORE_SRC_COMMON_NPY_CPU_FEATURES_H_ #define NUMPY_CORE_SRC_COMMON_NPY_CPU_FEATURES_H_ #include <Python.h> // for PyObject #include "numpy/numpyconfig.h" // for NPY_VISIBILITY_HIDDEN #ifdef __cplusplus extern "C" { #endif enum npy_cpu_features { NPY_CPU_FEATURE_NONE = 0, // X86 NPY_CPU_FEATU...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/common/npy_config.h
#ifndef NUMPY_CORE_SRC_COMMON_NPY_CONFIG_H_ #define NUMPY_CORE_SRC_COMMON_NPY_CONFIG_H_ #include "config.h" #include "npy_cpu_dispatch.h" // brings NPY_HAVE_[CPU features] #include "numpy/numpyconfig.h" #include "numpy/utils.h" #include "numpy/npy_os.h" /* blocklist */ /* Disable broken functions on z/OS */ #if defi...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/common/array_assign.c
/* * This file implements some helper functions for the array assignment * routines. The actual assignment routines are in array_assign_*.c * * Written by Mark Wiebe (mwwiebe@gmail.com) * Copyright (c) 2011 by Enthought, Inc. * * See LICENSE.txt for the license. */ #define NPY_NO_DEPRECATED_API NPY_API_VERSION ...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/common/npy_argparse.c
#define NPY_NO_DEPRECATED_API NPY_API_VERSION #define _MULTIARRAYMODULE #define PY_SSIZE_T_CLEAN #include <Python.h> #include "numpy/ndarraytypes.h" #include "npy_argparse.h" #include "npy_pycompat.h" #include "npy_import.h" #include "arrayfunction_override.h" /** * Small wrapper converting to array just like CPy...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/common/npy_ctypes.h
#ifndef NUMPY_CORE_SRC_COMMON_NPY_CTYPES_H_ #define NUMPY_CORE_SRC_COMMON_NPY_CTYPES_H_ #include <Python.h> #include "npy_import.h" /* * Check if a python type is a ctypes class. * * Works like the Py<type>_Check functions, returning true if the argument * looks like a ctypes object. * * This entire function i...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/common/npy_fpmath.h
#ifndef NUMPY_CORE_SRC_COMMON_NPY_NPY_FPMATH_H_ #define NUMPY_CORE_SRC_COMMON_NPY_NPY_FPMATH_H_ #include "npy_config.h" #include "numpy/npy_os.h" #include "numpy/npy_cpu.h" #include "numpy/npy_common.h" #if !(defined(HAVE_LDOUBLE_IEEE_QUAD_BE) || \ defined(HAVE_LDOUBLE_IEEE_QUAD_LE) || \ defined(HAVE_LDO...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/common/mem_overlap.c
/* Solving memory overlap integer programs and bounded Diophantine equations with positive coefficients. Asking whether two strided arrays `a` and `b` overlap is equivalent to asking whether there is a solution to the following problem:: sum(stride_a[i] * x_a[i] for i in range(ndim_a)) - sum...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/common/binop_override.h
#ifndef NUMPY_CORE_SRC_COMMON_BINOP_OVERRIDE_H_ #define NUMPY_CORE_SRC_COMMON_BINOP_OVERRIDE_H_ #include <string.h> #include <Python.h> #include "numpy/arrayobject.h" #include "get_attr_string.h" /* * Logic for deciding when binops should return NotImplemented versus when * they should go ahead and call a ufunc (o...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/common/templ_common.h.src
#ifndef __NPY_TYPED_COMMON_INC #define __NPY_TYPED_COMMON_INC /* utility functions that profit from templates */ #include "numpy/npy_common.h" #include <assert.h> /**begin repeat * #name = int, uint, long, ulong, * longlong, ulonglong# * #type = npy_int, npy_uint, npy_long, npy_ulong, * npy_l...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/common/npy_dlpack.h
#include "Python.h" #include "dlpack/dlpack.h" #ifndef NPY_DLPACK_H #define NPY_DLPACK_H // Part of the Array API specification. #define NPY_DLPACK_CAPSULE_NAME "dltensor" #define NPY_DLPACK_USED_CAPSULE_NAME "used_dltensor" // Used internally by NumPy to store a base object // as it has to release a reference to th...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/common/half_private.hpp
#ifndef NUMPY_CORE_SRC_COMMON_HALF_PRIVATE_HPP #define NUMPY_CORE_SRC_COMMON_HALF_PRIVATE_HPP #include "npstd.hpp" #include "float_status.hpp" /* * The following functions that emulating float/double/half conversions * are copied from npymath without any changes to its functionality. */ namespace np { namespace ha...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/common/npy_cpu_dispatch.c
#include "npy_cpu_dispatch.h" static PyObject *npy__cpu_dispatch_registery = NULL; NPY_VISIBILITY_HIDDEN int npy_cpu_dispatch_tracer_init(PyObject *mod) { if (npy__cpu_dispatch_registery != NULL) { PyErr_Format(PyExc_RuntimeError, "CPU dispatcher tracer already initlized"); return -1; } Py...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/common/npstd.hpp
#ifndef NUMPY_CORE_SRC_COMMON_NPSTD_HPP #define NUMPY_CORE_SRC_COMMON_NPSTD_HPP #include <cstddef> #include <cstring> #include <cctype> #include <cstdint> #include <string> #include <algorithm> #include <utility> #include <cstdlib> #include <cmath> #include <complex> #include <type_traits> #include <numpy/npy_common...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/common/.doxyfile
INCLUDE_PATH += @CUR_DIR
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/common/npy_import.h
#ifndef NUMPY_CORE_SRC_COMMON_NPY_IMPORT_H_ #define NUMPY_CORE_SRC_COMMON_NPY_IMPORT_H_ #include <Python.h> /*! \brief Fetch and cache Python function. * * Import a Python function and cache it for use. The function checks if * cache is NULL, and if not NULL imports the Python function specified by * \a module an...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/common/npy_longdouble.h
#ifndef NUMPY_CORE_SRC_COMMON_NPY_LONGDOUBLE_H_ #define NUMPY_CORE_SRC_COMMON_NPY_LONGDOUBLE_H_ #include "npy_config.h" #include "numpy/ndarraytypes.h" /* Convert a npy_longdouble to a python `long` integer. * * Results are rounded towards zero. * * This performs the same task as PyLong_FromDouble, but for long d...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/common/npy_binsearch.h
#ifndef __NPY_BINSEARCH_H__ #define __NPY_BINSEARCH_H__ #include "npy_sort.h" #include <numpy/npy_common.h> #include <numpy/ndarraytypes.h> #ifdef __cplusplus extern "C" { #endif typedef void (PyArray_BinSearchFunc)(const char*, const char*, char*, npy_intp, npy_intp, ...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/common/npy_cpu_dispatch.h
#ifndef NUMPY_CORE_SRC_COMMON_NPY_CPU_DISPATCH_H_ #define NUMPY_CORE_SRC_COMMON_NPY_CPU_DISPATCH_H_ /** * This file is part of the NumPy CPU dispatcher. * * Please have a look at doc/reference/simd-optimizations.html * To get a better understanding of the mechanism behind it. */ #include "npy_cpu_features.h" // NP...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/common/npdef.hpp
#ifndef NUMPY_CORE_SRC_COMMON_NPDEF_HPP #define NUMPY_CORE_SRC_COMMON_NPDEF_HPP #if !defined(__cplusplus) || __cplusplus < 201703L #error "NumPy requires a compiler with at least C++17 enabled" #endif /// @addtogroup cpp_core_defs /// @{ /// Whether compiler supports C++20 #if __cplusplus > 202002L #define N...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/common/npy_partition.h
#ifndef NUMPY_CORE_SRC_COMMON_PARTITION_H_ #define NUMPY_CORE_SRC_COMMON_PARTITION_H_ #include "npy_sort.h" /* Python include is for future object sorts */ #include <Python.h> #include <numpy/ndarraytypes.h> #include <numpy/npy_common.h> #define NPY_MAX_PIVOT_STACK 50 typedef int (PyArray_PartitionFunc)(void *, np...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/common/npy_cpuinfo_parser.h
/* * Copyright (C) 2010 The Android Open Source Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code must retain the above copyright * notice, t...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/common/ufunc_override.h
#ifndef NUMPY_CORE_SRC_COMMON_UFUNC_OVERRIDE_H_ #define NUMPY_CORE_SRC_COMMON_UFUNC_OVERRIDE_H_ #include "npy_config.h" /* * Check whether an object has __array_ufunc__ defined on its class and it * is not the default, i.e., the object is not an ndarray, and its * __array_ufunc__ is not the same as that of ndarray...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/common/utils.hpp
#ifndef NUMPY_CORE_SRC_COMMON_UTILS_HPP #define NUMPY_CORE_SRC_COMMON_UTILS_HPP #include "npdef.hpp" #if NP_HAS_CPP20 #include <bit> #endif #include <type_traits> #include <string.h> namespace np { /** Create a value of type `To` from the bits of `from`. * * similar to `std::bit_cast` but compatible with C++...
0
public_repos/numpy/numpy/_core/src
public_repos/numpy/numpy/_core/src/common/npy_cpu_features.c
#include "npy_cpu_features.h" #include "npy_cpu_dispatch.h" // To guarantee the CPU baseline definitions are in scope. #include "numpy/npy_common.h" #include "numpy/npy_cpu.h" // To guarantee the CPU definitions are in scope. /******************** Private Definitions *********************/ // Hold all CPU features bo...
0