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-refactor/numpy/distutils/tests/swig_ext | public_repos/numpy-refactor/numpy/distutils/tests/swig_ext/src/zoo.cc | #include "zoo.h"
#include <cstdio>
#include <cstring>
Zoo::Zoo()
{
n = 0;
}
void Zoo::shut_up(char *animal)
{
if (n < 10) {
strcpy(animals[n], animal);
n++;
}
}
void Zoo::display()
{
int i;
for(i = 0; i < n; i++)
printf("%s\n", animals[i]);
}
| 0 |
public_repos/numpy-refactor/numpy/distutils/tests/swig_ext | public_repos/numpy-refactor/numpy/distutils/tests/swig_ext/src/zoo.i | // -*- c++ -*-
// Example copied from http://linuxgazette.net/issue49/pramode.html
%module example2
%{
#include "zoo.h"
%}
%include "zoo.h"
| 0 |
public_repos/numpy-refactor/numpy/distutils/tests/swig_ext | public_repos/numpy-refactor/numpy/distutils/tests/swig_ext/src/example.i | /* -*- c -*- */
/* File : example.i */
%module example
%{
/* Put headers and other declarations here */
extern double My_variable;
extern int fact(int);
extern int my_mod(int n, int m);
%}
extern double My_variable;
extern int fact(int);
extern int my_mod(int n, int m);
| 0 |
public_repos/numpy-refactor/numpy/distutils/tests/swig_ext | public_repos/numpy-refactor/numpy/distutils/tests/swig_ext/tests/test_example2.py | import sys
from numpy.testing import *
from swig_ext import example2
class TestExample2(TestCase):
def test_zoo(self):
z = example2.Zoo()
z.shut_up('Tiger')
z.shut_up('Lion')
z.display()
if __name__ == "__main__":
run_module_suite()
| 0 |
public_repos/numpy-refactor/numpy/distutils/tests/swig_ext | public_repos/numpy-refactor/numpy/distutils/tests/swig_ext/tests/test_example.py | import sys
from numpy.testing import *
from swig_ext import example
class TestExample(TestCase):
def test_fact(self):
assert_equal(example.fact(10),3628800)
def test_cvar(self):
assert_equal(example.cvar.My_variable,3.0)
example.cvar.My_variable = 5
assert_equal(example.cvar.My... | 0 |
public_repos/numpy-refactor/numpy/distutils/tests | public_repos/numpy-refactor/numpy/distutils/tests/gen_ext/setup.py | #!/usr/bin/env python
fib3_f = '''
C FILE: FIB3.F
SUBROUTINE FIB(A,N)
C
C CALCULATE FIRST N FIBONACCI NUMBERS
C
INTEGER N
REAL*8 A(N)
Cf2py intent(in) n
Cf2py intent(out) a
Cf2py depend(n) a
DO I=1,N
IF (I.EQ.1) THEN
A(I) = 0.0D0
ELSEIF (I.EQ.2) THEN
... | 0 |
public_repos/numpy-refactor/numpy/distutils/tests/gen_ext | public_repos/numpy-refactor/numpy/distutils/tests/gen_ext/tests/test_fib3.py | import sys
from numpy.testing import *
from gen_ext import fib3
class TestFib3(TestCase):
def test_fib(self):
assert_array_equal(fib3.fib(6),[0,1,1,2,3,5])
if __name__ == "__main__":
run_module_suite()
| 0 |
public_repos/numpy-refactor/numpy/distutils | public_repos/numpy-refactor/numpy/distutils/mingw/gfortran_vs2003_hack.c | int _get_output_format(void)
{
return 0;
}
int _imp____lc_codepage = 0;
| 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/numarray/mlab.py |
from numpy.oldnumeric.mlab import *
import numpy.oldnumeric.mlab as nom
__all__ = nom.__all__
del nom
| 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/numarray/functions.py | # missing Numarray defined names (in from numarray import *)
##__all__ = ['ClassicUnpickler', 'Complex32_fromtype',
## 'Complex64_fromtype', 'ComplexArray', 'Error',
## 'MAX_ALIGN', 'MAX_INT_SIZE', 'MAX_LINE_WIDTH',
## 'NDArray', 'NewArray', 'NumArray',
## 'NumError', 'PRECISION'... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/numarray/image.py | try:
from stsci.image import *
except ImportError:
try:
from scipy.stsci.image import *
except ImportError:
msg = \
"""The image package is not installed
It can be downloaded by checking out the latest source from
http://svn.scipy.org/svn/scipy/trunk/Lib/stsci or by downloading and
installi... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/numarray/matrix.py |
__all__ = ['Matrix']
from numpy import matrix as _matrix
def Matrix(data, typecode=None, copy=1, savespace=0):
return _matrix(data, typecode, copy=copy)
| 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/numarray/alter_code1.py | """
This module converts code written for numarray to run with numpy
Makes the following changes:
* Changes import statements
import numarray.package
--> import numpy.numarray.package as numarray_package
with all numarray.package in code changed to numarray_package
import numarray --> import... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/numarray/numerictypes.py | """numerictypes: Define the numeric type objects
This module is designed so 'from numerictypes import *' is safe.
Exported symbols include:
Dictionary with all registered number types (including aliases):
typeDict
Numeric type objects:
Bool
Int8 Int16 Int32 Int64
UInt8 UInt16 UInt32 UInt64
Fl... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/numarray/ma.py |
from numpy.oldnumeric.ma import *
| 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/numarray/convolve.py | try:
from stsci.convolve import *
except ImportError:
try:
from scipy.stsci.convolve import *
except ImportError:
msg = \
"""The convolve package is not installed.
It can be downloaded by checking out the latest source from
http://svn.scipy.org/svn/scipy/trunk/Lib/stsci or by downloading an... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/numarray/setup.py | from os.path import join
from numpy.distutils.system_info import get_info
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('numarray', parent_package,top_path)
config.add_data_files('include/numpy/*')
config.add_extension... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/numarray/setupscons.py | from os.path import join
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('numarray',parent_package,top_path)
config.add_data_files('include/numpy/')
config.add_sconscript('SConstruct', source_files = ['_capi.c'])
retur... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/numarray/linear_algebra.py |
from numpy.oldnumeric.linear_algebra import *
import numpy.oldnumeric.linear_algebra as nol
__all__ = list(nol.__all__)
__all__ += ['qr_decomposition']
from numpy.linalg import qr as _qr
def qr_decomposition(a, mode='full'):
res = _qr(a, mode)
if mode == 'full':
return res
return (None, res)
| 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/numarray/ufuncs.py |
__all__ = ['abs', 'absolute', 'add', 'arccos', 'arccosh', 'arcsin', 'arcsinh',
'arctan', 'arctan2', 'arctanh', 'bitwise_and', 'bitwise_not',
'bitwise_or', 'bitwise_xor', 'ceil', 'cos', 'cosh', 'divide',
'equal', 'exp', 'fabs', 'floor', 'floor_divide',
'fmod', 'greater', 'gre... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/numarray/random_array.py |
__all__ = ['ArgumentError', 'F', 'beta', 'binomial', 'chi_square',
'exponential', 'gamma', 'get_seed', 'multinomial',
'multivariate_normal', 'negative_binomial', 'noncentral_F',
'noncentral_chi_square', 'normal', 'permutation', 'poisson',
'randint', 'random', 'random_integer... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/numarray/session.py | """ This module contains a "session saver" which saves the state of a
NumPy session to a file. At a later time, a different Python
process can be started and the saved session can be restored using
load().
The session saver relies on the Python pickle protocol to save and
restore objects. Objects which are not thems... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/numarray/_capi.c | #include <Python.h>
#define _libnumarray_MODULE
#include "include/numpy/libnumarray.h"
#include "numpy/npy_3kcompat.h"
#include "npy_api.h"
#include "npy_config.h"
#include <float.h>
#if (defined(__unix__) || defined(unix)) && !defined(USG)
#include <sys/param.h>
#endif
#if defined(__GLIBC__) || defined(__APPLE__)... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/numarray/util.py | import os
import numpy as np
__all__ = ['MathDomainError', 'UnderflowError', 'NumOverflowError',
'handleError', 'get_numarray_include_dirs']
class MathDomainError(ArithmeticError):
pass
class UnderflowError(ArithmeticError):
pass
class NumOverflowError(OverflowError, ArithmeticError):
pass
... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/numarray/compat.py |
__all__ = ['NewAxis', 'ArrayType']
from numpy import newaxis as NewAxis, ndarray as ArrayType
| 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/numarray/fft.py |
from numpy.oldnumeric.fft import *
import numpy.oldnumeric.fft as nof
__all__ = nof.__all__
del nof
| 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/numarray/SConscript | import os
import sys
from numscons import GetNumpyEnvironment
env = GetNumpyEnvironment(ARGUMENTS)
env.Prepend(CPPPATH=['numpy', "#$build_prefix/numpy/core/src/private",
os.environ['NDARRAY_INC_DIR']])
if sys.platform == 'win32':
env.Prepend(LIBPATH=[os.environ['NDARRAY_LIB_DIR']])... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/numarray/nd_image.py | try:
from ndimage import *
except ImportError:
try:
from scipy.ndimage import *
except ImportError:
msg = \
"""The nd_image package is not installed
It can be downloaded by checking out the latest source from
http://svn.scipy.org/svn/scipy/trunk/Lib/ndimage or by downloading and
installing ... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/numarray/SConstruct | from numscons import GetInitEnvironment
GetInitEnvironment(ARGUMENTS).DistutilsSConscript('SConscript')
| 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/numarray/alter_code2.py | """
This module converts code written for numpy.numarray to work
with numpy
FIXME: finish this.
"""
#__all__ = ['convertfile', 'convertall', 'converttree']
__all__ = []
import warnings
warnings.warn("numpy.numarray.alter_code2 is not working yet.")
import sys
import os
import glob
def makenewfile(name, filestr):
... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/numarray/__init__.py | from util import *
from numerictypes import *
from functions import *
from ufuncs import *
from compat import *
from session import *
import util
import numerictypes
import functions
import ufuncs
import compat
import session
__all__ = ['session', 'numerictypes']
__all__ += util.__all__
__all__ += numerictypes.__all_... | 0 |
public_repos/numpy-refactor/numpy/numarray/include | public_repos/numpy-refactor/numpy/numarray/include/numpy/numcomplex.h | /* See numarray.h for Complex32, Complex64:
typedef struct { Float32 r, i; } Complex32;
typedef struct { Float64 r, i; } Complex64;
*/
typedef struct { Float32 a, theta; } PolarComplex32;
typedef struct { Float64 a, theta; } PolarComplex64;
#define NUM_SQ(x) ((x)*(x))
#define NUM_CABSSQ(p) (NUM_SQ((p).r... | 0 |
public_repos/numpy-refactor/numpy/numarray/include | public_repos/numpy-refactor/numpy/numarray/include/numpy/libnumarray.h | /* Compatibility with numarray. Do not use in new code.
*/
#ifndef NUMPY_LIBNUMARRAY_H
#define NUMPY_LIBNUMARRAY_H
#include "numpy/arrayobject.h"
#include "arraybase.h"
#include "nummacro.h"
#include "numcomplex.h"
#include "ieeespecial.h"
#include "cfunc.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Header file f... | 0 |
public_repos/numpy-refactor/numpy/numarray/include | public_repos/numpy-refactor/numpy/numarray/include/numpy/arraybase.h | #if !defined(__arraybase_h)
#define _arraybase_h 1
#define SZ_BUF 79
#define MAXDIM NPY_MAXDIMS
#define MAXARGS 18
typedef npy_intp maybelong;
typedef npy_bool Bool;
typedef npy_int8 Int8;
typedef npy_uint8 UInt8;
typedef npy_int16 Int16;
typedef npy_uint16 UInt16;
typedef npy_int32 Int32;
typedef npy_uint32 UInt32;... | 0 |
public_repos/numpy-refactor/numpy/numarray/include | public_repos/numpy-refactor/numpy/numarray/include/numpy/ieeespecial.h | /* 32-bit special value ranges */
#if defined(_MSC_VER)
#define MKINT(x) (x##UL)
#define MKINT64(x) (x##Ui64)
#define BIT(x) (1Ui64 << (x))
#else
#define MKINT(x) (x##U)
#define MKINT64(x) (x##ULL)
#define BIT(x) (1ULL << (x))
#endif
#define NEG_QUIET_NAN_MIN32 MKINT(0xFFC00001)
#define NEG_QUIET_NAN_MAX32 MKI... | 0 |
public_repos/numpy-refactor/numpy/numarray/include | public_repos/numpy-refactor/numpy/numarray/include/numpy/nummacro.h | /* Primarily for compatibility with numarray C-API */
#if !defined(_ndarraymacro)
#define _ndarraymacro
/* The structs defined here are private implementation details of numarray
which are subject to change w/o notice.
*/
#define PY_BOOL_CHAR "b"
#define PY_INT8_CHAR "b"
#define PY_INT16_CHAR "h"
#define PY_INT32_C... | 0 |
public_repos/numpy-refactor/numpy/numarray/include | public_repos/numpy-refactor/numpy/numarray/include/numpy/cfunc.h | #if !defined(__cfunc__)
#define __cfunc__ 1
typedef PyObject *(*CFUNCasPyValue)(void *);
typedef int (*UFUNC)(long, long, long, void **, long*);
/* typedef void (*CFUNC_2ARG)(long, void *, void *); */
/* typedef void (*CFUNC_3ARG)(long, void *, void *, void *); */
typedef int (*CFUNCfromPyValue)(PyObject *, void *);
t... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/compat/setup.py | #!/usr/bin/env python
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('compat',parent_package,top_path)
return config
if __name__ == '__main__':
from numpy.distutils.core import setup
setup(configuration=configurat... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/compat/setupscons.py | #!/usr/bin/env python
import os.path
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('compat',parent_package,top_path)
return config
if __name__ == '__main__':
from numpy.distutils.core import setup
setup(configura... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/compat/_inspect.py | """Subset of inspect module from upstream python
We use this instead of upstream because upstream inspect is slow to import, and
significanly contributes to numpy import times. Importing this copy has almost
no overhead.
"""
import types
__all__ = ['getargspec', 'formatargspec']
# ----------------------------------... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/compat/py3k.py | """
Python 3 compatibility tools.
"""
__all__ = ['bytes', 'asbytes', 'isfileobj', 'getexception', 'strchar',
'unicode', 'asunicode', 'asbytes_nested', 'asunicode_nested',
'asstr', 'open_latin1']
import sys
# For now we use the V3 settings for IronPython as well. However, this isn't
# correct b... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/compat/__init__.py | """
Compatibility module.
This module contains duplicated code from Python itself or 3rd party
extensions, which may be included for the following reasons:
* compatibility
* we may only need a small subset of the copied library/module
"""
import _inspect
import py3k
from _inspect import getargspec, formatargspec... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/doc/basics.py | """
============
Array basics
============
Array types and conversions between types
=========================================
Numpy supports a much greater variety of numerical types than Python does.
This section shows which are available, and how to modify an array's data-type.
========== =======================... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/doc/structured_arrays.py | """
=====================================
Structured Arrays (aka Record Arrays)
=====================================
Introduction
============
Numpy provides powerful capabilities to create arrays of structs or records.
These arrays permit one to manipulate the data by the structs or by fields of
the struct. A simpl... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/doc/misc.py | """
=============
Miscellaneous
=============
IEEE 754 Floating Point Special Values:
-----------------------------------------------
Special values defined in numpy: nan, inf,
NaNs can be used as a poor-man's mask (if you don't care what the
original value was)
Note: cannot use equality to test NaNs. E.g.: ::
>>... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/doc/byteswapping.py | '''
=============================
Byteswapping and byte order
=============================
Introduction to byte ordering and ndarrays
==========================================
The ``ndarray`` is an object that provide a python array interface to data
in memory.
It often happens that the memory that you want to v... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/doc/constants.py | """
=========
Constants
=========
Numpy includes several constants:
%(constant_list)s
"""
#
# Note: the docstring is autogenerated.
#
import textwrap, re
# Maintain same format as in numpy.add_newdocs
constants = []
def add_newdoc(module, name, doc):
constants.append((name, doc))
add_newdoc('numpy', 'Inf',
... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/doc/performance.py | """
===========
Performance
===========
Placeholder for Improving Performance documentation.
"""
| 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/doc/indexing.py | """
==============
Array indexing
==============
Array indexing refers to any use of the square brackets ([]) to index
array values. There are many options to indexing, which give numpy
indexing great power, but with power comes some complexity and the
potential for confusion. This section is just an overview of the
v... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/doc/methods_vs_functions.py | """
=====================
Methods vs. Functions
=====================
Placeholder for Methods vs. Functions documentation.
"""
| 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/doc/creation.py | """
==============
Array Creation
==============
Introduction
============
There are 5 general mechanisms for creating arrays:
1) Conversion from other Python structures (e.g., lists, tuples)
2) Intrinsic numpy array array creation objects (e.g., arange, ones, zeros,
etc.)
3) Reading arrays from disk, either from... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/doc/broadcasting.py | """
========================
Broadcasting over arrays
========================
The term broadcasting describes how numpy treats arrays with different
shapes during arithmetic operations. Subject to certain constraints,
the smaller array is "broadcast" across the larger array so that they
have compatible shapes. Broadc... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/doc/subclassing.py | """
=============================
Subclassing ndarray in python
=============================
Credits
-------
This page is based with thanks on the wiki page on subclassing by Pierre
Gerard-Marchant - http://www.scipy.org/Subclasses.
Introduction
------------
Subclassing ndarray is relatively simple, but it has som... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/doc/ufuncs.py | """
===================
Universal Functions
===================
Ufuncs are, generally speaking, mathematical functions or operations that are
applied element-by-element to the contents of an array. That is, the result
in each output array element only depends on the value in the corresponding
input array (or arrays) a... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/doc/howtofind.py | """
=================
How to Find Stuff
=================
How to find things in NumPy.
"""
| 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/doc/jargon.py | """
======
Jargon
======
Placeholder for computer science, engineering and other jargon.
"""
| 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/doc/io.py | """
=========
Array I/O
=========
Placeholder for array I/O documentation.
"""
| 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/doc/internals.py | """
===============
Array Internals
===============
Internal organization of numpy arrays
=====================================
It helps to understand a bit about how numpy arrays are handled under the covers to help understand numpy better. This section will not go into great detail. Those wishing to understand the ... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/doc/glossary.py | """
========
Glossary
========
along an axis
Axes are defined for arrays with more than one dimension. A
2-dimensional array has two corresponding axes: the first running
vertically downwards across rows (axis 0), and the second running
horizontally across columns (axis 1).
Many operation can tak... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/doc/__init__.py | import os
ref_dir = os.path.join(os.path.dirname(__file__))
__all__ = [f[:-3] for f in os.listdir(ref_dir) if f.endswith('.py') and
not f.startswith('__')]
__all__.sort()
for f in __all__:
__import__(__name__ + '.' + f)
del f, ref_dir
__doc__ = """\
Topical documentation
=====================
The f... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/linalg/lapack_litemodule.c | /*This module contributed by Doug Heisterkamp
Modified by Jim Hugunin
More modifications by Jeff Whitaker
*/
#include "Python.h"
#include "numpy/noprefix.h"
#include "numpy/ndarraytypes.h"
#include "npy_descriptor.h"
#ifdef NO_APPEND_FORTRAN
# define FNAME(x) x
#else
# define FNAME(x) x##_
#endif
typedef struct { fl... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/linalg/lapack_lite.cpp | /* Cython code section 'h_code' */
#define PY_LONG_LONG long long
using namespace System::Collections;
using namespace System::Numerics;
using namespace System::Reflection;
using namespace System::Runtime::CompilerServices;
using namespace System::Runtime;
using namespace System::Security::Permissions;
using namespa... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/linalg/dlamch.c | #include <stdio.h>
#include "f2c.h"
/* If config.h is available, we only need dlamc3 */
#ifndef HAVE_CONFIG
doublereal dlamch_(char *cmach)
{
/* -- LAPACK auxiliary routine (version 3.0) --
Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
Courant Institute, Argonne National Lab, and Ric... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/linalg/numpy.pxd | from libc.stdint cimport intptr_t, uintptr_t
ctypedef signed char npy_byte
ctypedef signed short npy_short
ctypedef signed int npy_int
ctypedef signed long npy_long
ctypedef signed long long npy_longlong
ctypedef unsigned char npy_ubyte
ctypedef unsigned short npy_ushort
ctypedef unsigned ... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/linalg/blas_lite.c | /*
NOTE: This is generated code. Look in Misc/lapack_lite for information on
remaking this file.
*/
#include "f2c.h"
#ifdef HAVE_CONFIG
#include "config.h"
#else
extern doublereal dlamch_(char *);
#define EPSILON dlamch_("Epsilon")
#define SAFEMINIMUM dlamch_("Safe minimum")
#define PRECISION dlamch_("Precision"... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/linalg/setup.py |
import sys
from os.path import isdir
from numpy.distutils.system_info import get_info
def ndarray_lib_dir():
info = get_info('ndarray')
path = info['library_dirs'][0]
assert isdir(path)
return path
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configura... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/linalg/setupscons.py |
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
from numpy.distutils.system_info import get_info
config = Configuration('linalg',parent_package,top_path)
config.add_data_dir('tests')
config.add_sconscript('SConstruct',
... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/linalg/info.py | """\
Core Linear Algebra Tools
-------------------------
Linear algebra basics:
- norm Vector or matrix norm
- inv Inverse of a square matrix
- solve Solve a linear system of equations
- det Determinant of a square matrix
- lstsq Solve linear least-squares problem... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/linalg/lapack_lite.pyx | """ Cythonized version of lapack_litemodule.c
"""
cdef extern from "lapack_lite.h":
ctypedef struct f2c_doublecomplex:
double r, i
int lapack_dgeev "GLOBALFUNC(dgeev_)"(char *jobvl, char *jobvr, int *n, double *a, int *lda,double *wr,double *wi,double *vl, int *ldvl,double *vr, int *ldvr,double *w... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/linalg/python_xerbla.c | #include "npy_api.h"
#include "f2c.h"
/* Work around some Microsoft sillyness. */
#if _MSC_VER
#define snprintf sprintf_s
#endif
/*
From the original manpage:
--------------------------
XERBLA is an error handler for the LAPACK routines.
It is called by an LAPACK routine if an input parameter has an invalid v... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/linalg/npy_ironpython.h | #ifndef _NPY_IRONPYTHON_H_
#define _NPY_IRONPYTHON_H_
#include "npy_object.h"
#define Npy_INTERFACE_OBJECT(a) (System::Runtime::InteropServices::GCHandle::FromIntPtr((System::IntPtr)Npy_INTERFACE(a)).Target)
#endif
| 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/linalg/lapack_lite.h |
typedef struct { double r, i; } f2c_doublecomplex;
#ifdef __cplusplus
#define GLOBALFUNC(x) ::x
#else
#define GLOBALFUNC(x) x
#endif
#ifdef __cplusplus
extern "C" {
#endif
extern int dgeev_(char *jobvl, char *jobvr, int *n, double *a, int *lda,double *wr,double *wi,double *vl, int *ldvl,double *vr, int *ldvr,double... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/linalg/lapack_lite_clr.py | import sys
if sys.platform == 'cli':
import clr
clr.AddReference("lapack_lite")
from numpy__linalg__lapack_lite import *
| 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/linalg/f2c.h | /* f2c.h -- Standard Fortran to C header file */
/** barf [ba:rf] 2. "He suggested using FORTRAN, and everybody barfed."
- From The Shogakukan DICTIONARY OF NEW ENGLISH (Second edition) */
#ifndef F2C_INCLUDE
#define F2C_INCLUDE
typedef int integer;
typedef char *address;
typedef short int shortint;
typedef ... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/linalg/f2c_lite.c | #include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "f2c.h"
extern void s_wsfe(cilist *f) {;}
extern void e_wsfe(void) {;}
extern void do_fio(integer *c, char *s, ftnlen l) {;}
/* You'll want this if you redo the *_lite.c files with the -C option
* to f2c for checking array subscri... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/linalg/lapack_lite.vcxproj | <?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/linalg/SConscript | import os
from numscons import GetNumpyEnvironment, scons_get_mathlib
from numscons import CheckF77LAPACK
from numscons import write_info
env = GetNumpyEnvironment(ARGUMENTS)
env.Prepend(CPPPATH=[os.environ['NDARRAY_INC_DIR']])
config = env.NumpyConfigure(custom_tests = {'CheckLAPACK' : CheckF77LAPACK})
use_lapack =... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/linalg/zlapack_lite.c | /*
NOTE: This is generated code. Look in Misc/lapack_lite for information on
remaking this file.
*/
#include "f2c.h"
#ifdef HAVE_CONFIG
#include "config.h"
#else
extern doublereal dlamch_(char *);
#define EPSILON dlamch_("Epsilon")
#define SAFEMINIMUM dlamch_("Safe minimum")
#define PRECISION dlamch_("Precision"... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/linalg/dlapack_lite.c | #define MAXITERLOOPS 100
/*
NOTE: This is generated code. Look in Misc/lapack_lite for information on
remaking this file.
*/
#include "f2c.h"
#ifdef HAVE_CONFIG
#include "config.h"
#else
extern doublereal dlamch_(char *);
#define EPSILON dlamch_("Epsilon")
#define SAFEMINIMUM dlamch_("Safe minimum")
#define PRE... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/linalg/SConstruct | from numscons import GetInitEnvironment
GetInitEnvironment(ARGUMENTS).DistutilsSConscript('SConscript')
| 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/linalg/__init__.py | """
Core Linear Algebra Tools
=========================
=============== ==========================================================
Linear algebra basics
==========================================================================
norm Vector or matrix norm
inv Inverse of a square matrix
solve ... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/linalg/linalg.py | """Lite version of scipy.linalg.
Notes
-----
This module is a lite version of the linalg.py module in SciPy which
contains high-level Python interface to the LAPACK library. The lite
version only accesses the following LAPACK functions: dgesv, zgesv,
dgeev, zgeev, dgesdd, zgesdd, dgelsd, zgelsd, dsyevd, zheevd, dgetr... | 0 |
public_repos/numpy-refactor/numpy/linalg | public_repos/numpy-refactor/numpy/linalg/lapack_lite/clapack_scrub.py | #!/usr/bin/env python2.4
import sys, os
from cStringIO import StringIO
import re
from Plex import *
from Plex.Traditional import re as Re
class MyScanner(Scanner):
def __init__(self, info, name='<default>'):
Scanner.__init__(self, self.lexicon, info, name)
def begin(self, state_name):
# if se... | 0 |
public_repos/numpy-refactor/numpy/linalg | public_repos/numpy-refactor/numpy/linalg/lapack_lite/wrapped_routines | dgeev
zgeev
dsyevd
zheevd
dgelsd
zgelsd
dgesv
zgesv
dgetrf
zgetrf
dpotrf
zpotrf
dgesdd
zgesdd
dgeqrf
zgeqrf
# need this b/c it's not properly declared as external in the BLAS source
dcabs1
IGNORE: dlamch
| 0 |
public_repos/numpy-refactor/numpy/linalg | public_repos/numpy-refactor/numpy/linalg/lapack_lite/README | Regenerating lapack_lite source
===============================
:Author: David M. Cooke <cookedm@physics.mcmaster.ca>
The ``numpy/linalg/blas_lite.c``, ``numpy/linalg/dlapack_lite.c``, and
``numpy/linalg/zlapack_lite.c`` are ``f2c``'d versions of the LAPACK routines
required by the ``LinearAlgebra`` module, and wrapp... | 0 |
public_repos/numpy-refactor/numpy/linalg | public_repos/numpy-refactor/numpy/linalg/lapack_lite/make_lite.py | #!/usr/bin/env python
import sys, os
import fortran
import clapack_scrub
try: set
except NameError:
from sets import Set as set
# Arguments to pass to f2c. You'll always want -A for ANSI C prototypes
# Others of interest: -a to not make variables static by default
# -C to check array subscrip... | 0 |
public_repos/numpy-refactor/numpy/linalg | public_repos/numpy-refactor/numpy/linalg/lapack_lite/fortran.py | import re
import itertools
def isBlank(line):
return not line
def isLabel(line):
return line[0].isdigit()
def isComment(line):
return line[0] != ' '
def isContinuation(line):
return line[5] != ' '
COMMENT, STATEMENT, CONTINUATION = 0, 1, 2
def lineType(line):
"""Return the type of a line of Fortan... | 0 |
public_repos/numpy-refactor/numpy/linalg | public_repos/numpy-refactor/numpy/linalg/tests/test_linalg.py | """ Test functions for linalg module
"""
import numpy as np
from numpy.testing import *
from numpy import array, single, double, csingle, cdouble, dot, identity
from numpy import multiply, atleast_2d, inf, asarray, matrix
from numpy import linalg
from numpy.linalg import matrix_power, norm, matrix_rank
def ifthen(a, ... | 0 |
public_repos/numpy-refactor/numpy/linalg | public_repos/numpy-refactor/numpy/linalg/tests/test_regression.py | """ Test functions for linalg module
"""
from numpy.testing import *
import numpy as np
from numpy import linalg, arange, float64, array, dot, transpose
rlevel = 1
class TestRegression(TestCase):
def test_eig_build(self, level = rlevel):
"""Ticket #652"""
rva = array([1.03221168e+02 +0.j,
... | 0 |
public_repos/numpy-refactor/numpy/linalg | public_repos/numpy-refactor/numpy/linalg/tests/test_build.py | from subprocess import call, PIPE, Popen
import sys
import re
import numpy as np
from numpy.linalg import lapack_lite
from numpy.testing import TestCase, dec
from numpy.compat import asbytes_nested
class FindDependenciesLdd:
def __init__(self):
self.cmd = ['ldd']
try:
st = call(self.... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/fft/fftpack_cython.cpp | /* Cython code section 'h_code' */
#define PY_LONG_LONG long long
using namespace System::Collections;
using namespace System::Numerics;
using namespace System::Reflection;
using namespace System::Runtime::CompilerServices;
using namespace System::Runtime;
using namespace System::Security::Permissions;
using namespa... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/fft/fftpack_lite_clr.py | import sys
if sys.platform == 'cli':
import clr
clr.AddReference("fftpack_lite")
from numpy__fft__fftpack_cython import *
| 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/fft/numpy.pxd |
from libc.stdint cimport intptr_t
ctypedef int npy_int
ctypedef double double_t
ctypedef intptr_t npy_intp
ctypedef signed char npy_int8
ctypedef signed short npy_int16
ctypedef signed int npy_int32
ctypedef signed long long npy_int64
ctypedef unsigned char npy_uint8
ctypedef unsigned sh... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/fft/setup.py | from numpy.distutils.system_info import get_info
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('fft',parent_package,top_path)
config.add_data_dir('tests')
# Configure fftpack_lite
config.add_extension('fftpack_lite'... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/fft/setupscons.py | def configuration(parent_package = '', top_path = None):
from numpy.distutils.misc_util import Configuration, get_numpy_include_dirs
config = Configuration('fft', parent_package, top_path)
config.add_data_dir('tests')
config.add_sconscript('SConstruct',
source_files = ['fftpa... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/fft/info.py | """
Discrete Fourier Transform (:mod:`numpy.fft`)
=============================================
.. currentmodule:: numpy.fft
Standard FFTs
-------------
.. autosummary::
:toctree: generated/
fft Discrete Fourier transform.
ifft Inverse discrete Fourier transform.
fft2 Discrete Fourier t... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/fft/fftpack_litemodule.c | #ifdef _MSC_VER
#include <wtypes.h>
#endif
#include "fftpack.h"
#include "Python.h"
#include "numpy/arrayobject.h"
static PyObject *ErrorObject;
/* ----------------------------------------------------- */
static char fftpack_cfftf__doc__[] = "";
PyObject *
fftpack_cfftf(PyObject *NPY_UNUSED(self), PyObject *args)
... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/fft/npy_ironpython.h | #ifndef _NPY_IRONPYTHON_H_
#define _NPY_IRONPYTHON_H_
#include "npy_object.h"
#define Npy_INTERFACE_OBJECT(a) (System::Runtime::InteropServices::GCHandle::FromIntPtr((System::IntPtr)Npy_INTERFACE(a)).Target)
#endif
| 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/fft/helper.py | """
Discrete Fourier Transforms - helper.py
"""
# Created by Pearu Peterson, September 2002
__all__ = ['fftshift','ifftshift','fftfreq']
from numpy.core import asarray, concatenate, arange, take, \
integer, empty
import numpy.core.numerictypes as nt
import types
def fftshift(x,axes=None):
"""
Shift the z... | 0 |
public_repos/numpy-refactor/numpy | public_repos/numpy-refactor/numpy/fft/fftpack.c | /*
fftpack.c : A set of FFT routines in C.
Algorithmically based on Fortran-77 FFTPACK by Paul N. Swarztrauber (Version 4, 1985).
*/
/* isign is +1 for backward and -1 for forward transforms */
#include <math.h>
#include <stdio.h>
#define DOUBLE
#ifdef DOUBLE
#define Treal double
#else
#define Treal float
#endif
... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.