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/datetime/doc/swig | public_repos/datetime/doc/swig/test/Array2.h | #ifndef ARRAY2_H
#define ARRAY2_H
#include "Array1.h"
#include <stdexcept>
#include <string>
class Array2
{
public:
// Default constructor
Array2();
// Size/array constructor
Array2(int nrows, int ncols, long* data=0);
// Copy constructor
Array2(const Array2 & source);
// Destructor
~Array2();
... | 0 |
public_repos/datetime/doc/swig | public_repos/datetime/doc/swig/test/testTensor.py | #! /usr/bin/env python
# System imports
from distutils.util import get_platform
from math import sqrt
import os
import sys
import unittest
# Import NumPy
import numpy as np
major, minor = [ int(d) for d in np.__version__.split(".")[:2] ]
if major == 0: BadListError = TypeError
else: BadListErro... | 0 |
public_repos/datetime/doc/swig | public_repos/datetime/doc/swig/test/testFortran.py | #! /usr/bin/env python
# System imports
from distutils.util import get_platform
import os
import sys
import unittest
# Import NumPy
import numpy as np
major, minor = [ int(d) for d in np.__version__.split(".")[:2] ]
if major == 0: BadListError = TypeError
else: BadListError = ValueError
import Fortran
##... | 0 |
public_repos/datetime/doc/swig | public_repos/datetime/doc/swig/test/Array1.h | #ifndef ARRAY1_H
#define ARRAY1_H
#include <stdexcept>
#include <string>
class Array1
{
public:
// Default/length/array constructor
Array1(int length = 0, long* data = 0);
// Copy constructor
Array1(const Array1 & source);
// Destructor
~Array1();
// Assignment operator
Array1 & operator=(const Ar... | 0 |
public_repos/datetime/doc/swig | public_repos/datetime/doc/swig/test/Matrix.i | // -*- c++ -*-
%module Matrix
%{
#define SWIG_FILE_WITH_INIT
#include "Matrix.h"
%}
// Get the NumPy typemaps
%include "../numpy.i"
%init %{
import_array();
%}
%define %apply_numpy_typemaps(TYPE)
%apply (TYPE IN_ARRAY2[ANY][ANY]) {(TYPE matrix[ANY][ANY])};
%apply (TYPE* IN_ARRAY2, int DIM1, int DIM2) {(TYPE* mat... | 0 |
public_repos/datetime/doc/swig | public_repos/datetime/doc/swig/test/Fortran.h | #ifndef FORTRAN_H
#define FORTRAN_H
#define TEST_FUNC_PROTOS(TYPE, SNAME) \
\
TYPE SNAME ## SecondElement( TYPE * matrix, int rows, int cols); \
TEST_FUNC_PROTOS(signed char , schar )
TEST_FUNC_PROTOS(unsigned char , uchar )
TEST_FUNC_PROTOS(short , short )
TEST_FUNC_PROTOS(unsigned ... | 0 |
public_repos/datetime/doc/swig | public_repos/datetime/doc/swig/test/Vector.h | #ifndef VECTOR_H
#define VECTOR_H
// The following macro defines the prototypes for a family of
// functions that work with 1D arrays with the forms
//
// TYPE SNAMELength( TYPE vector[3]);
// TYPE SNAMEProd( TYPE * series, int size);
// TYPE SNAMESum( int size, TYPE * series);
// void SNAMERevers... | 0 |
public_repos/datetime/doc/swig | public_repos/datetime/doc/swig/test/testMatrix.py | #! /usr/bin/env python
# System imports
from distutils.util import get_platform
import os
import sys
import unittest
# Import NumPy
import numpy as np
major, minor = [ int(d) for d in np.__version__.split(".")[:2] ]
if major == 0: BadListError = TypeError
else: BadListError = ValueError
import Matrix
###... | 0 |
public_repos/datetime/doc/swig | public_repos/datetime/doc/swig/test/testFarray.py | #! /usr/bin/env python
# System imports
from distutils.util import get_platform
import os
import sys
import unittest
# Import NumPy
import numpy as np
major, minor = [ int(d) for d in np.__version__.split(".")[:2] ]
if major == 0: BadListError = TypeError
else: BadListError = ValueError
# Add the distutil... | 0 |
public_repos/datetime/doc/swig | public_repos/datetime/doc/swig/test/Fortran.cxx | #include <stdlib.h>
#include <math.h>
#include <iostream>
#include "Fortran.h"
#define TEST_FUNCS(TYPE, SNAME) \
\
TYPE SNAME ## SecondElement(TYPE * matrix, int rows, int cols) { \
TYPE result = matrix[1]; \
return result; \
} ... | 0 |
public_repos/datetime/doc/swig | public_repos/datetime/doc/swig/test/Array.i | // -*- c++ -*-
%module Array
%{
#define SWIG_FILE_WITH_INIT
#include "Array1.h"
#include "Array2.h"
%}
// Get the NumPy typemaps
%include "../numpy.i"
// Get the STL typemaps
%include "stl.i"
// Handle standard exceptions
%include "exception.i"
%exception
{
try
{
$action
}
catch (const std::invalid_ar... | 0 |
public_repos/datetime/doc/swig | public_repos/datetime/doc/swig/test/Matrix.h | #ifndef MATRIX_H
#define MATRIX_H
// The following macro defines the prototypes for a family of
// functions that work with 2D arrays with the forms
//
// TYPE SNAMEDet( TYPE matrix[2][2]);
// TYPE SNAMEMax( TYPE * matrix, int rows, int cols);
// TYPE SNAMEMin( int rows, int cols, TYPE * matrix);
... | 0 |
public_repos/datetime/doc/swig | public_repos/datetime/doc/swig/test/Tensor.i | // -*- c++ -*-
%module Tensor
%{
#define SWIG_FILE_WITH_INIT
#include "Tensor.h"
%}
// Get the NumPy typemaps
%include "../numpy.i"
%init %{
import_array();
%}
%define %apply_numpy_typemaps(TYPE)
%apply (TYPE IN_ARRAY3[ANY][ANY][ANY]) {(TYPE tensor[ANY][ANY][ANY])};
%apply (TYPE* IN_ARRAY3, int DIM1, int DIM2, i... | 0 |
public_repos/datetime/doc/swig | public_repos/datetime/doc/swig/test/testVector.py | #! /usr/bin/env python
# System imports
from distutils.util import get_platform
import os
import sys
import unittest
# Import NumPy
import numpy as np
major, minor = [ int(d) for d in np.__version__.split(".")[:2] ]
if major == 0: BadListError = TypeError
else: BadListError = ValueError
import Vector
###... | 0 |
public_repos/datetime/doc/swig | public_repos/datetime/doc/swig/doc/numpy_swig.html | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.4: http://... | 0 |
public_repos/datetime/doc/swig | public_repos/datetime/doc/swig/doc/testing.html | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.4: http://... | 0 |
public_repos/datetime/doc/swig | public_repos/datetime/doc/swig/doc/numpy_swig.txt | ==========================================
numpy.i: a SWIG Interface File for NumPy
==========================================
:Author: Bill Spotz
:Institution: Sandia National Laboratories
:Date: 1 December, 2007
.. contents::
Introduction
============
The Simple Wrapper and Interface Generator (or `S... | 0 |
public_repos/datetime/doc/swig | public_repos/datetime/doc/swig/doc/testing.txt | ============================
Testing the numpy.i Typemaps
============================
:Author: Bill Spotz
:Institution: Sandia National Laboratories
:Date: 6 April, 2007
.. contents::
Introduction
============
Writing tests for the ``numpy.i`` `SWIG <http://www.swig.org>`_
interface file is a combinato... | 0 |
public_repos/datetime/doc/swig | public_repos/datetime/doc/swig/doc/Makefile | # ReStructured Text
RST2HTML = rst2html.py
RST2LATEX = rst2latex.py
RFLAGS = --generator --time
HTML_FLAGS = --no-xml-declaration
LATEX_FLAGS =
LATEX = pdflatex
# Web pages that need to be made
WEB_PAGES = numpy_swig.html testing.html
# LaTeX files that need to be made
LATEX_FILES = numpy_swig.tex testing.tex
# PDF ... | 0 |
public_repos/datetime/doc | public_repos/datetime/doc/numpybook/runcode.py | # This script takes a lyx file and runs the python code in it.
# Then rewrites the lyx file again.
#
# Each section of code portion is assumed to be in the same namespace
# where a from numpy import * has been applied
#
# If a PYNEW inside a Note is encountered, the name space is restarted
#
# The output (if any) is ... | 0 |
public_repos/datetime/doc | public_repos/datetime/doc/numpybook/capi.lyx | #LyX 1.5.1 created this file. For more info see http://www.lyx.org/
\lyxformat 276
\begin_document
\begin_header
\textclass mybook
\language english
\inputencoding auto
\font_roman default
\font_sans default
\font_typewriter default
\font_default_family default
\font_sc false
\font_osf false
\font_sf_scale 100
\font_tt... | 0 |
public_repos/datetime/doc | public_repos/datetime/doc/numpybook/numpybook.lyx | #LyX 1.5.1 created this file. For more info see http://www.lyx.org/
\lyxformat 276
\begin_document
\begin_header
\textclass mybook
\begin_preamble
\usepackage{array}
% This gives us a better font in URL links (otherwise the default
% MonoSpace font is bitmapped, and it looks horrible in PDF)
\usepackage{courier}
\... | 0 |
public_repos/datetime/doc/numpybook | public_repos/datetime/doc/numpybook/Figures/threefundamental.eps | %!PS-Adobe-2.0 EPSF-2.0
%%Title: threefundamental.fig
%%Creator: fig2dev Version 3.2 Patchlevel 4
%%CreationDate: Mon Jan 16 15:40:51 2006
%%For: oliphant@den.local.net (Travis Oliphant)
%%BoundingBox: 0 0 438 162
%%Magnification: 1.0000
%%EndComments
/$F2psDict 200 dict def
$F2psDict begin
$F2psDict /mtrx matrix put
/... | 0 |
public_repos/datetime/doc/numpybook | public_repos/datetime/doc/numpybook/Figures/threefundamental.fig | #FIG 3.2
Landscape
Center
Inches
Letter
100.00
Single
-2
1200 2
6 1950 2850 4350 3450
2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5
1950 2850 4350 2850 4350 3450 1950 3450 1950 2850
2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2
2550 2850 2550 3450
2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2
3150 2850 3150 3450
2 1 0 1 0 7 50 -... | 0 |
public_repos/datetime/doc/numpybook | public_repos/datetime/doc/numpybook/Figures/contiguous.fig | #FIG 3.2
Landscape
Center
Inches
Letter
100.00
Single
-2
1200 2
6 3300 1500 10500 2250
2 2 0 3 0 7 50 -1 -1 0.000 0 0 -1 0 0 5
5700 1575 6900 1575 6900 2175 5700 2175 5700 1575
2 2 0 3 0 7 50 -1 -1 0.000 0 0 -1 0 0 5
7500 1575 8700 1575 8700 2175 7500 2175 7500 1575
2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5
3300 ... | 0 |
public_repos/datetime/doc/numpybook | public_repos/datetime/doc/numpybook/Figures/hierarchy.eps | %!PS-Adobe-2.0 EPSF-2.0
%%Title: hierarchy.dia
%%Creator: Dia v0.94
%%CreationDate: Wed Jan 4 16:44:07 2006
%%For: oliphant
%%Orientation: Portrait
%%Magnification: 1.0000
%%BoundingBox: 0 0 743 584
%%BeginSetup
%%EndSetup
%%EndComments
%%BeginProlog
[ /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.n... | 0 |
public_repos/datetime/doc/numpybook | public_repos/datetime/doc/numpybook/Figures/contiguous.eps | %!PS-Adobe-2.0 EPSF-2.0
%%Title: contiguous.fig
%%Creator: fig2dev Version 3.2 Patchlevel 4
%%CreationDate: Thu Aug 18 12:08:29 2005
%%For: oliphant@oliphant (Travis Oliphant)
%%BoundingBox: 0 0 434 215
%%Magnification: 1.0000
%%EndComments
/$F2psDict 200 dict def
$F2psDict begin
$F2psDict /mtrx matrix put
/col-1 {0 se... | 0 |
public_repos/datetime/doc/numpybook | public_repos/datetime/doc/numpybook/comparison/timing.py |
import timeit
pyrex_pre = """
import numpy as N
a = N.random.rand(%d,%d)
import filter
"""
pyrex_run = """
b = filter.filter(a)
"""
weave_pre = """
import numpy as N
a = N.random.rand(%d,%d)
import filter
"""
weave_run = """
b = filter.filter(a)
"""
ctypes_pre = """
import numpy as N
a = N.random.rand(%d,%d)
impo... | 0 |
public_repos/datetime/doc/numpybook/comparison | public_repos/datetime/doc/numpybook/comparison/weave/filter.py | from scipy import weave, zeros_like
def filter(a):
if a.ndim != 2:
raise ValueError, "a must be 2-d"
code = r"""
int i,j;
for(i=1;i<Na[0]-1;i++) {
for(j=1;j<Na[1]-1;j++) {
B2(i,j) = A2(i,j) + (A2(i-1,j) +
A2(i+1,j) + A2(i,j-1)
+ A2... | 0 |
public_repos/datetime/doc/numpybook/comparison | public_repos/datetime/doc/numpybook/comparison/weave/inline.py | from scipy import weave
from numpy import rand, zeros_like
def example1(a):
if not isinstance(a, list):
raise ValueError, "argument must be a list"
code = r"""
int i;
py::tuple results(2);
for (i=0; i<a.length(); i++) {
a[i] = i;
}
... | 0 |
public_repos/datetime/doc/numpybook/comparison | public_repos/datetime/doc/numpybook/comparison/weave/timeme | python2.4 -m timeit -s "import numpy as N; a=N.random.rand(100,200); import filter" "b = filter.filter(a)"
| 0 |
public_repos/datetime/doc/numpybook/comparison | public_repos/datetime/doc/numpybook/comparison/ctypes/newfile.dat |