From scipy-svn at scipy.org Sun Mar 2 21:47:43 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sun, 2 Mar 2008 20:47:43 -0600 (CST) Subject: [Scipy-svn] r3967 - in trunk/scipy/sparse: . tests Message-ID: <20080303024743.86BAD39C044@new.scipy.org> Author: wnbell Date: 2008-03-02 20:47:39 -0600 (Sun, 02 Mar 2008) New Revision: 3967 Modified: trunk/scipy/sparse/construct.py trunk/scipy/sparse/tests/test_construct.py Log: added sparse.vstack and sparse.hstack addresses ticket #602 Modified: trunk/scipy/sparse/construct.py =================================================================== --- trunk/scipy/sparse/construct.py 2008-03-01 00:44:34 UTC (rev 3966) +++ trunk/scipy/sparse/construct.py 2008-03-03 02:47:39 UTC (rev 3967) @@ -1,7 +1,8 @@ -""" Functions to construct sparse matrices +"""Functions to construct sparse matrices """ -__all__ = [ 'spdiags', 'eye', 'identity', 'kron', 'kronsum', 'bmat' ] +__all__ = [ 'spdiags', 'eye', 'identity', 'kron', 'kronsum', + 'hstack', 'vstack', 'bmat' ] from itertools import izip @@ -199,15 +200,63 @@ return (L+R).asformat(format) #since L + R is not always same format +def hstack( blocks, format=None, dtype=None ): + """Stack sparse matrices horizontally (column wise) + Parameters + ========== -def bmat( blocks, format=None, dtype=None ): + blocks -- sequence of sparse matrices with compatible shapes + format -- sparse format of the result (e.g. "csr") + - by default an appropriate sparse matrix format is returned. + This choice is subject to change. + + Example + ======= + + >>> from scipy.sparse import coo_matrix, vstack + >>> A = coo_matrix([[1,2],[3,4]]) + >>> B = coo_matrix([[5],[6]]) + >>> hstack( [A,B] ).todense() + matrix([[1, 2, 5], + [3, 4, 6]]) + + """ - Build a sparse matrix from sparse sub-blocks + return bmat([blocks], format=format, dtype=dtype) +def vstack( blocks, format=None, dtype=None ): + """Stack sparse matrices vertically (row wise) + Parameters ========== + blocks -- sequence of sparse matrices with compatible shapes + format -- sparse format of the result (e.g. "csr") + - by default an appropriate sparse matrix format is returned. + This choice is subject to change. + + Example + ======= + + >>> from scipy.sparse import coo_matrix, vstack + >>> A = coo_matrix([[1,2],[3,4]]) + >>> B = coo_matrix([[5,6]]) + >>> vstack( [A,B] ).todense() + matrix([[1, 2], + [3, 4], + [5, 6]]) + + + """ + return bmat([ [b] for b in blocks ], format=format, dtype=dtype) + +def bmat( blocks, format=None, dtype=None ): + """Build a sparse matrix from sparse sub-blocks + + Parameters + ========== + blocks -- grid of sparse matrices with compatible shapes - an entry of None implies an all-zero matrix format -- sparse format of the result (e.g. "csr") @@ -263,7 +312,7 @@ if bcol_lengths[j] == 0: bcol_lengths[j] = A.shape[1] else: - if bcol_lengths[j] != A.shape[0]: + if bcol_lengths[j] != A.shape[1]: raise ValueError('blocks[:,%d] has incompatible column dimensions' % j) Modified: trunk/scipy/sparse/tests/test_construct.py =================================================================== --- trunk/scipy/sparse/tests/test_construct.py 2008-03-01 00:44:34 UTC (rev 3966) +++ trunk/scipy/sparse/tests/test_construct.py 2008-03-03 02:47:39 UTC (rev 3967) @@ -124,7 +124,25 @@ numpy.kron(b, numpy.eye(len(a))) assert_array_equal(result,expected) + def test_vstack(self): + A = coo_matrix([[1,2],[3,4]]) + B = coo_matrix([[5,6]]) + + expected = matrix([[1, 2], + [3, 4], + [5, 6]]) + assert_equal( vstack( [A,B] ).todense(), expected ) + + def test_hstack(self): + + A = coo_matrix([[1,2],[3,4]]) + B = coo_matrix([[5],[6]]) + + expected = matrix([[1, 2, 5], + [3, 4, 6]]) + assert_equal( hstack( [A,B] ).todense(), expected ) + def test_bmat(self): A = coo_matrix([[1,2],[3,4]]) From scipy-svn at scipy.org Mon Mar 3 22:58:34 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Mon, 3 Mar 2008 21:58:34 -0600 (CST) Subject: [Scipy-svn] r3968 - trunk/scipy/ndimage Message-ID: <20080304035834.0E5F839C071@new.scipy.org> Author: stefan Date: 2008-03-03 21:58:32 -0600 (Mon, 03 Mar 2008) New Revision: 3968 Modified: trunk/scipy/ndimage/interpolation.py Log: Fix spelling mistake in docstring. Modified: trunk/scipy/ndimage/interpolation.py =================================================================== --- trunk/scipy/ndimage/interpolation.py 2008-03-03 02:47:39 UTC (rev 3967) +++ trunk/scipy/ndimage/interpolation.py 2008-03-04 03:58:32 UTC (rev 3968) @@ -149,7 +149,7 @@ The array of coordinates is used to find, for each point in the output, the corresponding coordinates in the input. The value of the input at - that coordinates is determined by spline interpolation of the + those coordinates is determined by spline interpolation of the requested order. The shape of the output is derived from that of the coordinate From scipy-svn at scipy.org Tue Mar 4 21:14:01 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Tue, 4 Mar 2008 20:14:01 -0600 (CST) Subject: [Scipy-svn] r3969 - trunk/scipy/ndimage Message-ID: <20080305021401.2834A39C080@new.scipy.org> Author: tom.waite Date: 2008-03-04 20:13:58 -0600 (Tue, 04 Mar 2008) New Revision: 3969 Modified: trunk/scipy/ndimage/_registration.py Log: Added fMRI series co-registration and resampling. Modified: trunk/scipy/ndimage/_registration.py =================================================================== --- trunk/scipy/ndimage/_registration.py 2008-03-04 03:58:32 UTC (rev 3968) +++ trunk/scipy/ndimage/_registration.py 2008-03-05 02:13:58 UTC (rev 3969) @@ -75,7 +75,7 @@ remaped_image = N.zeros(layers*rows*cols, dtype=N.uint8).reshape(layers, rows, cols) remaped_image = {'data' : remaped_image, 'mat' : image['mat'], 'dim' : image['dim'], 'fwhm' : image['fwhm']} - imdata = build_structs(step=1) + imdata = build_structs() if resample == 'linear': # trilinear interpolation mapping. @@ -88,7 +88,7 @@ def get_inverse_mappings(parm_vector): # get the inverse mapping to rotate the G matrix to F space following registration - imdata = build_structs(step=1) + imdata = build_structs() # inverse angles and translations imdata['parms'][0] = -parm_vector[0] imdata['parms'][1] = -parm_vector[1] @@ -106,8 +106,6 @@ start = time.time() # smooth of the images if smimage: - image_F_xyz1 = filter_image_3D(image1['data'], image1['fwhm'], ftype) - image1['data'] = image_F_xyz1 image_F_xyz2 = filter_image_3D(image2['data'], image2['fwhm'], ftype) image2['data'] = image_F_xyz2 parm_vector = multires_registration(image1, image2, imdata, lite, smhist, method, opt_method) @@ -210,13 +208,13 @@ def resample_image(smimage=0, ftype=2, alpha=0.0, beta=0.0, gamma=0.0, - Tx=0.0, Ty=0.0, Tz=0.0, stepsize=1): + Tx=0.0, Ty=0.0, Tz=0.0): # takes an image and 3D rotate using trilinear interpolation anat_desc = load_anatMRI_desc() image1 = load_volume(anat_desc, imagename='ANAT1_V0001.img') image2 = load_volume(anat_desc, imagename=None) - imdata = build_structs(step=stepsize) + imdata = build_structs() imdata['parms'][0] = alpha imdata['parms'][1] = beta imdata['parms'][2] = gamma @@ -270,13 +268,9 @@ # rot_matrix is the 4x4 constructed (current angles and translates) transform matrix # sample_vector is the subsample vector for x-y-z - # F_inv = N.linalg.inv(image_F['mat']) - # composite = N.dot(F_inv, rot_matrix) - # composite = N.dot(composite, image_G['mat']) F_inv = N.linalg.inv(image_F['mat']) composite = N.dot(F_inv, image_G['mat']) composite = N.dot(composite, rot_matrix) - #print ' composite ', composite # allocate memory from Python as memory leaks when created in C-ext joint_histogram = N.zeros([256, 256], dtype=N.float64); @@ -436,8 +430,10 @@ def load_volume(imagedesc, imagename=None, threshold=0.999, debug=0): - # imagename of none means to create a blank image + # load MRI or fMRI volume and return an autoscaled 8 bit image. + # autoscale is using integrated histogram to deal with outlier high amplitude voxels if imagename == None: + # imagename of none means to create a blank image ImageVolume = N.zeros(imagedesc['layers']*imagedesc['rows']*imagedesc['cols'], dtype=N.uint16).reshape(imagedesc['layers'], imagedesc['rows'], imagedesc['cols']) else: @@ -514,33 +510,40 @@ files_fMRI = glob.glob(path) return files_fMRI -def build_aligned_fMRI_mean_volume(path): - desc = load_fMRI_desc() - ave_fMRI_volume = N.zeros(desc['layers']*desc['rows']*desc['cols'], - dtype=N.float64).reshape(desc['layers'], desc['rows'], desc['cols']) - data = read_fMRI_directory(path) - count = 0 - for i in data: - print 'add volume ', i - # this uses integrated histogram normalization - image = load_volume(desc, i) - # co-reg successive pairs, then remap and ave - ave_fMRI_volume = ave_fMRI_volume + image['data'].astype(N.float64) - count = count + 1 - ave_fMRI_volume = ave_fMRI_volume / float(count) +def check_alignment(image1, image2, imdata, method='ncc', lite=0, smhist=0, + alpha=0.0, beta=0.0, gamma=0.0, Tx=0, Ty=0, Tz=0, ret_histo=0): + + # + # to test the cost function and view the joint histogram + # for 2 images. used for debug + # + imdata['parms'][0] = alpha + imdata['parms'][1] = beta + imdata['parms'][2] = gamma + imdata['parms'][3] = Tx + imdata['parms'][4] = Ty + imdata['parms'][5] = Tz + M = build_rotate_matrix(imdata['parms']) + optfunc_args = (image1, image2, imdata['step'], imdata['fwhm'], lite, smhist, method, ret_histo) - return ave_fMRI_volume + if ret_histo: + cost, joint_histogram = optimize_function(imdata['parms'], optfunc_args) + return cost, joint_histogram + else: + cost = optimize_function(imdata['parms'], optfunc_args) + return cost + # -# ---- testing/debug routines ---- +# ---- demo/debug routines ---- # def build_scale_image(image, scale): - (layers, rows, cols) = image['data'].shape # # rescale the 'mat' (voxel to physical mapping matrix) # + (layers, rows, cols) = image['data'].shape M = image['mat'] * scale # dimensions D = N.zeros(3, dtype=N.int32); @@ -557,7 +560,7 @@ return scaled_image -def get_test_MRI_volumes(scale=2, alpha=3.0, beta=4.0, gamma=5.0): +def demo_MRI_volume_align(scale=2, alpha=3.0, beta=4.0, gamma=5.0, Tx = 0.0, Ty = 0.0, Tz = 0.0): # # this is for coreg MRI / fMRI scale test. The volume is anatomical MRI. # the image is rotated in 3D. after rotation the image is scaled. @@ -566,64 +569,142 @@ anat_desc = load_anatMRI_desc() image1 = load_volume(anat_desc, imagename='ANAT1_V0001.img') image2 = load_volume(anat_desc, imagename=None) - imdata = build_structs(step=1) + imdata = build_structs() image1['fwhm'] = build_fwhm(image1['mat'], imdata['step']) image2['fwhm'] = build_fwhm(image2['mat'], imdata['step']) imdata['parms'][0] = alpha imdata['parms'][1] = beta imdata['parms'][2] = gamma + imdata['parms'][3] = Tx + imdata['parms'][4] = Ty + imdata['parms'][5] = Tz M = build_rotate_matrix(imdata['parms']) + # rotate volume. linear interpolation means the volume is low pass filtered R.register_linear_resample(image1['data'], image2['data'], M, imdata['step']) + # subsample volume image3 = build_scale_image(image2, scale) return image1, image3, imdata -def get_test_fMRI_rotated(fMRIVol, alpha=3.0, beta=4.0, gamma=5.0): +def demo_rotate_fMRI_volume(fMRIVol, x): # - # return rotated fMRIVol + # return rotated fMRIVol. the fMRIVol is already loaded, and gets rotated # desc = load_fMRI_desc() image = load_volume(desc, imagename=None) - imdata = build_structs(step=1) + imdata = build_structs() image['fwhm'] = build_fwhm(image['mat'], imdata['step']) - imdata['parms'][0] = alpha - imdata['parms'][1] = beta - imdata['parms'][2] = gamma + imdata['parms'][0] = x[0] # alpha + imdata['parms'][1] = x[1] # beta + imdata['parms'][2] = x[2] # gamma + imdata['parms'][3] = x[3] # Tx + imdata['parms'][4] = x[4] # Ty + imdata['parms'][5] = x[5] # Tz M = build_rotate_matrix(imdata['parms']) + # rotate volume. cubic spline interpolation means the volume is NOT low pass filtered R.register_cubic_resample(fMRIVol['data'], image['data'], M, imdata['step']) return image +def demo_MRI_coregistration(optimizer_method='powell', histo_method=1, smooth_histo=0, smooth_image=0, ftype=1): + # demo of alignment of fMRI series with anatomical MRI + # in this demo, each fMRI volume is first perturbed (rotated, translated) + # by a random value. The initial registration is measured, then the optimal + # alignment is computed and the registration measure made following the volume remap. + # The fMRI registration is done with the first fMRI volume using normalized cross-correlation. + # Each fMRI volume is rotated to the fMRI-0 volume and the series is ensemble averaged. + # The ensemble averaged is then registered with the anatomical MRI volume using normalized mutual information. + # The fMRI series is then rotated with this parameter. The alignments are done with 3D cubic splines. -def test_image_filter(image, imdata, ftype=2): - # - # test the 3D image filter on an image. ftype 1 is SPM, ftype 2 is simple Gaussian - # - image['fwhm'] = build_fwhm(image['mat'], imdata['step']) - filt_image = filter_image_3D(image['data'], image['fwhm'], ftype) - return filt_image + # read the anatomical MRI volume + anat_desc = load_anatMRI_desc() + imageF_anat = load_volume(anat_desc, imagename='ANAT1_V0001.img') + # the sampling structure + imdata = build_structs() + # the volume filter + imageF_anat['fwhm'] = build_fwhm(imageF_anat['mat'], imdata['step']) + # read in the file list of the fMRI data + metric_test = N.dtype([('cost', 'f'), + ('align_cost', 'f'), + ('rotate', 'f', 6), + ('align_rotate', 'f', 6)]) -def test_alignment(image1, image2, imdata, method='ncc', lite=0, smhist=0, - alpha=0.0, beta=0.0, gamma=0.0, Tx=0, Ty=0, Tz=0, ret_histo=0): - - # - # to test the cost function and view the joint histogram - # for 2 images. used for debug - # - imdata['parms'][0] = alpha - imdata['parms'][1] = beta - imdata['parms'][2] = gamma - imdata['parms'][3] = Tx - imdata['parms'][4] = Ty - imdata['parms'][5] = Tz - M = build_rotate_matrix(imdata['parms']) - optfunc_args = (image1, image2, imdata['step'], imdata['fwhm'], lite, smhist, method, ret_histo) + fMRIdata = read_fMRI_directory('fMRIData\*.img') + fmri_desc = load_fMRI_desc() + fmri_series = {} + ave_fMRI_volume = N.zeros(fmri_desc['layers']*fmri_desc['rows']*fmri_desc['cols'], + dtype=N.float64).reshape(fmri_desc['layers'], fmri_desc['rows'], fmri_desc['cols']) + count = 0 + number_volumes = len(fMRIdata) + measures = N.zeros(number_volumes, dtype=metric_test) + # load and perturb (rotation, translation) the fMRI volumes + for i in fMRIdata: + image = load_volume(fmri_desc, i) + # random perturbation of angle, translation for each volume beyond the first + if count == 0: + image['fwhm'] = build_fwhm(image['mat'], imdata['step']) + fmri_series[count] = image + count = count + 1 + else: + x = N.random.random(6) - 0.5 + x = 10.0 * x + fmri_series[count] = demo_rotate_fMRI_volume(image, x) + measures[count]['rotate'][0:6] = x[0:6] + count = count + 1 - if ret_histo: - cost, joint_histogram = optimize_function(imdata['parms'], optfunc_args) - return cost, joint_histogram - else: - cost = optimize_function(imdata['parms'], optfunc_args) - return cost + # load and register the fMRI volumes with volume_0 using normalized cross correlation metric + imageF = fmri_series[0] + if smooth_image: + image_F_xyz = filter_image_3D(imageF['data'], imageF['fwhm'], ftype) + imageF['data'] = image_F_xyz + for i in range(1, number_volumes): + imageG = fmri_series[i] + # the measure prior to alignment + measures[i]['cost'] = check_alignment(imageF, imageG, imdata, method='ncc', + lite=histo_method, smhist=smooth_histo) + x = python_coreg(imageF, imageG, imdata, lite=histo_method, method='ncc', + opt_method=optimizer_method, smhist=smooth_histo, smimage=smooth_image) + measures[i]['align_rotate'][0:6] = x[0:6] + measures[i]['align_cost'] = check_alignment(imageF, imageG, imdata, method='ncc', + lite=histo_method, smhist=smooth_histo, + alpha=x[0], beta=x[1], gamma=x[2], Tx=x[3], Ty=x[4], Tz=x[5]) + + # align the volumes and average them for co-registration with the anatomical MRI + ave_fMRI_volume = fmri_series[0]['data'].astype(N.float64) + for i in range(1, number_volumes): + image = fmri_series[i] + x[0:6] = measures[i]['align_rotate'][0:6] + # overwrite the fMRI volume with the aligned volume + fmri_series[i] = remap_image(image, x, resample='cubic') + ave_fMRI_volume = ave_fMRI_volume + fmri_series[i]['data'].astype(N.float64) + + ave_fMRI_volume = (ave_fMRI_volume / float(number_volumes)).astype(N.uint8) + ave_fMRI_volume = {'data' : ave_fMRI_volume, 'mat' : imageF['mat'], + 'dim' : imageF['dim'], 'fwhm' : imageF['fwhm']} + # register (using normalized mutual information) with the anatomical MRI + if smooth_image: + image_F_anat_xyz = filter_image_3D(imageF_anat['data'], imageF_anat['fwhm'], ftype) + imageF_anat['data'] = image_F_anat_xyz + x = python_coreg(imageF_anat, ave_fMRI_volume, imdata, lite=histo_method, + method='nmi', opt_method=optimizer_method, smhist=smooth_histo, smimage=smooth_image) + print 'functional-anatomical align parameters ' + print x + for i in range(number_volumes): + image = fmri_series[i] + # overwrite the fMRI volume with the anatomical-aligned volume + fmri_series[i] = remap_image(image, x, resample='cubic') + + return measures, imageF_anat, fmri_series + + +def demo_fMRI_resample(imageF_anat, fmri_series): + resampled_fmri_series = {} + number_volumes = len(fmri_series) + for i in range(number_volumes): + resampled_fmri_series[i] = resize_image(fmri_series[i], imageF_anat['mat']) + + return resampled_fmri_series + + From scipy-svn at scipy.org Wed Mar 5 01:09:00 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Wed, 5 Mar 2008 00:09:00 -0600 (CST) Subject: [Scipy-svn] r3970 - branches/build_with_scons/scipy/fftpack Message-ID: <20080305060900.C8A4E39C03D@new.scipy.org> Author: cdavid Date: 2008-03-05 00:08:51 -0600 (Wed, 05 Mar 2008) New Revision: 3970 Added: branches/build_with_scons/scipy/fftpack/SConstruct branches/build_with_scons/scipy/fftpack/setupscons.py Log: fftpack now builds with scons Added: branches/build_with_scons/scipy/fftpack/SConstruct =================================================================== --- branches/build_with_scons/scipy/fftpack/SConstruct 2008-03-05 02:13:58 UTC (rev 3969) +++ branches/build_with_scons/scipy/fftpack/SConstruct 2008-03-05 06:08:51 UTC (rev 3970) @@ -0,0 +1,46 @@ +# Last Change: Wed Mar 05 02:00 PM 2008 J +# vim:syntax=python +from os.path import join as pjoin + +from numpy.distutils.misc_util import get_numpy_include_dirs +from numscons import GetNumpyEnvironment, write_info +from numscons import CheckFFT, IsMKL, IsFFTW2, IsFFTW3 + +env = GetNumpyEnvironment(ARGUMENTS) + +env.AppendUnique(CPPPATH = get_numpy_include_dirs()) +env.AppendUnique(CPPPATH = env['F2PYINCLUDEDIR']) + +# Check fft implementation +config = env.NumpyConfigure(custom_tests = {'CheckFFT': CheckFFT}) +has_fft = config.CheckFFT() +config.Finish() +write_info(env) + +# Tweak defineds depending on the fft used +if has_fft: + if IsMKL(env, 'fft'): + env.Append(CPPDEFINES = "SCIPY_MKL_H") + elif IsFFTW3(env, 'fft'): + env.Append(CPPDEFINES = "SCIPY_FFTW3_H") + elif IsFFTW2(env, 'fft'): + env.Append(CPPDEFINES = "SCIPY_FFTW2_H") + else: + pass + +# Build dfftpack +src = env.Glob(pjoin('dfftpack', '*.f')) +dfftpack = env.NumpyStaticExtLibrary('dfftpack', source = [str(s) for s in src]) +env.AppendUnique(LIBS = ['dfftpack']) +env.AppendUnique(LIBPATH = env['build_dir']) + +# Build _fftpack +src = ['src/zfft.c','src/drfft.c','src/zrfft.c', 'src/zfftnd.c'] +wsrc = env.F2py(pjoin(env['build_dir'], '_fftpackmodule.c'), + pjoin(env['build_dir'], 'fftpack.pyf')) +env.NumpyPythonExtension('_fftpack', source = src + wsrc) + +# Build convolve +src = ['src/convolve.c'] +wsrc = env.F2py(pjoin(env['build_dir'], 'convolve.pyf')) +env.NumpyPythonExtension('convolve', source = src + wsrc) Added: branches/build_with_scons/scipy/fftpack/setupscons.py =================================================================== --- branches/build_with_scons/scipy/fftpack/setupscons.py 2008-03-05 02:13:58 UTC (rev 3969) +++ branches/build_with_scons/scipy/fftpack/setupscons.py 2008-03-05 06:08:51 UTC (rev 3970) @@ -0,0 +1,25 @@ +#!/usr/bin/env python +# Created by Pearu Peterson, August 2002 + +from os.path import join + +def configuration(parent_package='',top_path=None): + from numpy.distutils.misc_util import Configuration + from numpy.distutils.system_info import get_info + config = Configuration('fftpack',parent_package, top_path) + + config.add_sconscript('SConstruct') + config.add_data_dir('tests') + + return config + +if __name__ == '__main__': + from numpy.distutils.core import setup + from fftpack_version import fftpack_version + setup(version=fftpack_version, + description='fftpack - Discrete Fourier Transform package', + author='Pearu Peterson', + author_email = 'pearu at cens.ioc.ee', + maintainer_email = 'scipy-dev at scipy.org', + license = 'SciPy License (BSD Style)', + **configuration(top_path='').todict()) Property changes on: branches/build_with_scons/scipy/fftpack/setupscons.py ___________________________________________________________________ Name: svn:executable + * From scipy-svn at scipy.org Wed Mar 5 01:17:22 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Wed, 5 Mar 2008 00:17:22 -0600 (CST) Subject: [Scipy-svn] r3971 - in branches/build_with_scons/scipy: . integrate Message-ID: <20080305061722.8122A39C03D@new.scipy.org> Author: cdavid Date: 2008-03-05 00:17:13 -0600 (Wed, 05 Mar 2008) New Revision: 3971 Added: branches/build_with_scons/scipy/integrate/SConstruct branches/build_with_scons/scipy/integrate/setupscons.py Modified: branches/build_with_scons/scipy/setupscons.py Log: integrate now builds with scons. Added: branches/build_with_scons/scipy/integrate/SConstruct =================================================================== --- branches/build_with_scons/scipy/integrate/SConstruct 2008-03-05 06:08:51 UTC (rev 3970) +++ branches/build_with_scons/scipy/integrate/SConstruct 2008-03-05 06:17:13 UTC (rev 3971) @@ -0,0 +1,60 @@ +# Last Change: Wed Mar 05 03:00 PM 2008 J +# vim:syntax=python +from os.path import join as pjoin +import warnings + +from numpy.distutils.misc_util import get_numpy_include_dirs +from numscons import GetNumpyEnvironment, CheckF77Clib, CheckF77BLAS + +env = GetNumpyEnvironment(ARGUMENTS) + +# Configuration +config = env.NumpyConfigure(custom_tests = {'CheckF77Clib' : CheckF77Clib, + 'CheckF77BLAS' : CheckF77BLAS}) + +if not config.CheckF77Clib(): + raise Exception("Could not check F77 runtime, needed for interpolate") +if not config.CheckF77BLAS(): + warnings.warn("Could not find F77 BLAS") + +config.Finish() + +env.AppendUnique(CPPPATH = get_numpy_include_dirs()) +env.AppendUnique(CPPPATH = env['F2PYINCLUDEDIR']) + +# XXX: lapack integration + +# Build linpack_lite +src = [str(s) for s in env.Glob(pjoin('linpack_lite', '*.f'))] +linpack_lite = env.NumpyStaticExtLibrary('linpack_lite', source = src) + +# Build mach +# XXX: do not use optimization flags for mach +src = [str(s) for s in env.Glob(pjoin('mach', '*.f'))] +mach = env.NumpyStaticExtLibrary('mach', source = src) + +# Build quadpack +src = [str(s) for s in env.Glob(pjoin('quadpack', '*.f'))] +quadpack = env.NumpyStaticExtLibrary('quadpack', source = src) + +# Build odepack +src = [str(s) for s in env.Glob(pjoin('odepack', '*.f'))] +odepack = env.NumpyStaticExtLibrary('odepack', source = src) + +#env.AppendUnique(LIBS = ['linpack_lite', 'quadpack', 'odepack', 'mach']) +env.AppendUnique(LIBPATH = env['build_dir']) + +# Build _quadpack +env.NumpyPythonExtension('_quadpack', source = '_quadpackmodule.c', + LIBS = ['quadpack', 'linpack_lite', 'mach'], + LINKFLAGSEND = env['F77_LDFLAGS']) + +# Build _odepack +env.NumpyPythonExtension('_odepack', source = '_odepackmodule.c', + LIBS = ['odepack', 'linpack_lite', 'mach'], + LINKFLAGSEND = env['F77_LDFLAGS']) + +# Build vode +env.NumpyPythonExtension('vode', source = 'vode.pyf', + LIBS = ['odepack', 'linpack_lite', 'mach'], + LINKFLAGSEND = env['F77_LDFLAGS']) Copied: branches/build_with_scons/scipy/integrate/setupscons.py (from rev 3969, branches/build_with_scons/scipy/integrate/setup.py) =================================================================== --- branches/build_with_scons/scipy/integrate/setup.py 2008-03-05 02:13:58 UTC (rev 3969) +++ branches/build_with_scons/scipy/integrate/setupscons.py 2008-03-05 06:17:13 UTC (rev 3971) @@ -0,0 +1,17 @@ +#!/usr/bin/env python + +from os.path import join + +def configuration(parent_package='',top_path=None): + from numpy.distutils.misc_util import Configuration + + config = Configuration('integrate', parent_package, top_path) + + config.add_sconscript('SConstruct') + config.add_data_dir('tests') + + return config + +if __name__ == '__main__': + from numpy.distutils.core import setup + setup(**configuration(top_path='').todict()) Modified: branches/build_with_scons/scipy/setupscons.py =================================================================== --- branches/build_with_scons/scipy/setupscons.py 2008-03-05 06:08:51 UTC (rev 3970) +++ branches/build_with_scons/scipy/setupscons.py 2008-03-05 06:17:13 UTC (rev 3971) @@ -4,7 +4,7 @@ config = Configuration('scipy',parent_package,top_path, setup_name = 'setupscons.py') config.add_subpackage('cluster') config.add_subpackage('fftpack') - #config.add_subpackage('integrate') + config.add_subpackage('integrate') #config.add_subpackage('interpolate') #config.add_subpackage('io') #config.add_subpackage('lib') From scipy-svn at scipy.org Wed Mar 5 01:32:47 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Wed, 5 Mar 2008 00:32:47 -0600 (CST) Subject: [Scipy-svn] r3972 - in branches/build_with_scons/scipy: . interpolate Message-ID: <20080305063247.3246239C1EF@new.scipy.org> Author: cdavid Date: 2008-03-05 00:32:32 -0600 (Wed, 05 Mar 2008) New Revision: 3972 Added: branches/build_with_scons/scipy/interpolate/SConstruct branches/build_with_scons/scipy/interpolate/setupscons.py Modified: branches/build_with_scons/scipy/setupscons.py Log: Interpolate now builds with scons. Added: branches/build_with_scons/scipy/interpolate/SConstruct =================================================================== --- branches/build_with_scons/scipy/interpolate/SConstruct 2008-03-05 06:17:13 UTC (rev 3971) +++ branches/build_with_scons/scipy/interpolate/SConstruct 2008-03-05 06:32:32 UTC (rev 3972) @@ -0,0 +1,32 @@ +# Last Change: Wed Mar 05 03:00 PM 2008 J +# vim:syntax=python +from os.path import join as pjoin + +from numpy.distutils.misc_util import get_numpy_include_dirs +from numscons import GetNumpyEnvironment, CheckF77Clib + +env = GetNumpyEnvironment(ARGUMENTS) + +config = env.NumpyConfigure(custom_tests = {'CheckF77Clib' : CheckF77Clib}) +if not config.CheckF77Clib(): + raise Exception("Could not check F77 runtime, needed for interpolate") +config.Finish() + +env.AppendUnique(CPPPATH = get_numpy_include_dirs()) +env.AppendUnique(CPPPATH = env['F2PYINCLUDEDIR']) +env.AppendUnique(LINKFLAGS = env['F77_LDFLAGS']) + +# Build fitpack +src = [str(s) for s in env.Glob(pjoin('fitpack', '*.f'))] +fitpack = env.NumpyStaticExtLibrary('fitpack', source = src) + +env.AppendUnique(LIBS = ['fitpack']) +env.AppendUnique(LIBPATH = env['build_dir']) + +# Build _fitpack +env.NumpyPythonExtension('_fitpack', source = '_fitpackmodule.c') + +# Build dfitpack +dfitpack_wrap = env.F2py(pjoin(env['build_dir'], 'dfitpack'), + pjoin(env['build_dir'], 'fitpack.pyf')) +env.NumpyPythonExtension('dfitpack', source = dfitpack_wrap) Copied: branches/build_with_scons/scipy/interpolate/setupscons.py (from rev 3969, branches/build_with_scons/scipy/interpolate/setup.py) =================================================================== --- branches/build_with_scons/scipy/interpolate/setup.py 2008-03-05 02:13:58 UTC (rev 3969) +++ branches/build_with_scons/scipy/interpolate/setupscons.py 2008-03-05 06:32:32 UTC (rev 3972) @@ -0,0 +1,17 @@ +#!/usr/bin/env python + +from os.path import join + +def configuration(parent_package='',top_path=None): + from numpy.distutils.misc_util import Configuration + + config = Configuration('interpolate', parent_package, top_path) + + config.add_sconscript('SConstruct') + config.add_data_dir('tests') + + return config + +if __name__ == '__main__': + from numpy.distutils.core import setup + setup(**configuration(top_path='').todict()) Modified: branches/build_with_scons/scipy/setupscons.py =================================================================== --- branches/build_with_scons/scipy/setupscons.py 2008-03-05 06:17:13 UTC (rev 3971) +++ branches/build_with_scons/scipy/setupscons.py 2008-03-05 06:32:32 UTC (rev 3972) @@ -5,7 +5,7 @@ config.add_subpackage('cluster') config.add_subpackage('fftpack') config.add_subpackage('integrate') - #config.add_subpackage('interpolate') + config.add_subpackage('interpolate') #config.add_subpackage('io') #config.add_subpackage('lib') #config.add_subpackage('linalg') From scipy-svn at scipy.org Wed Mar 5 01:37:23 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Wed, 5 Mar 2008 00:37:23 -0600 (CST) Subject: [Scipy-svn] r3973 - in branches/build_with_scons/scipy: . io Message-ID: <20080305063723.F275539C00C@new.scipy.org> Author: cdavid Date: 2008-03-05 00:37:15 -0600 (Wed, 05 Mar 2008) New Revision: 3973 Added: branches/build_with_scons/scipy/io/SConstruct branches/build_with_scons/scipy/io/setupscons.py Modified: branches/build_with_scons/scipy/setupscons.py Log: io now builds with numscons. Added: branches/build_with_scons/scipy/io/SConstruct =================================================================== --- branches/build_with_scons/scipy/io/SConstruct 2008-03-05 06:32:32 UTC (rev 3972) +++ branches/build_with_scons/scipy/io/SConstruct 2008-03-05 06:37:15 UTC (rev 3973) @@ -0,0 +1,11 @@ +# Last Change: Wed Mar 05 03:00 PM 2008 J +# vim:syntax=python +from os.path import join + +from numpy.distutils.misc_util import get_numpy_include_dirs +from numscons import GetNumpyEnvironment + +env = GetNumpyEnvironment(ARGUMENTS) + +env.AppendUnique(CPPPATH = get_numpy_include_dirs()) +env.NumpyPythonExtension('numpyio', source = 'numpyiomodule.c') Copied: branches/build_with_scons/scipy/io/setupscons.py (from rev 3969, branches/build_with_scons/scipy/io/setup.py) =================================================================== --- branches/build_with_scons/scipy/io/setup.py 2008-03-05 02:13:58 UTC (rev 3969) +++ branches/build_with_scons/scipy/io/setupscons.py 2008-03-05 06:37:15 UTC (rev 3973) @@ -0,0 +1,17 @@ +#!/usr/bin/env python + +def configuration(parent_package='',top_path=None): + from numpy.distutils.misc_util import Configuration + config = Configuration('io', parent_package, top_path) + + config.add_sconscript('SConstruct') + + config.add_data_dir('tests') + config.add_data_dir('examples') + config.add_data_dir('docs') + config.add_subpackage('matlab') + return config + +if __name__ == '__main__': + from numpy.distutils.core import setup + setup(**configuration(top_path='').todict()) Modified: branches/build_with_scons/scipy/setupscons.py =================================================================== --- branches/build_with_scons/scipy/setupscons.py 2008-03-05 06:32:32 UTC (rev 3972) +++ branches/build_with_scons/scipy/setupscons.py 2008-03-05 06:37:15 UTC (rev 3973) @@ -6,7 +6,7 @@ config.add_subpackage('fftpack') config.add_subpackage('integrate') config.add_subpackage('interpolate') - #config.add_subpackage('io') + config.add_subpackage('io') #config.add_subpackage('lib') #config.add_subpackage('linalg') #config.add_subpackage('linsolve') From scipy-svn at scipy.org Wed Mar 5 02:00:27 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Wed, 5 Mar 2008 01:00:27 -0600 (CST) Subject: [Scipy-svn] r3974 - in branches/build_with_scons/scipy: . lib lib/blas lib/lapack Message-ID: <20080305070027.B11C339C1F7@new.scipy.org> Author: cdavid Date: 2008-03-05 01:00:10 -0600 (Wed, 05 Mar 2008) New Revision: 3974 Added: branches/build_with_scons/scipy/lib/blas/SConstruct branches/build_with_scons/scipy/lib/blas/scons_support.py branches/build_with_scons/scipy/lib/blas/setupscons.py branches/build_with_scons/scipy/lib/lapack/SConstruct branches/build_with_scons/scipy/lib/lapack/scons_support.py branches/build_with_scons/scipy/lib/lapack/setupscons.py branches/build_with_scons/scipy/lib/setupscons.py Modified: branches/build_with_scons/scipy/setupscons.py Log: lib now builds with numscons. Added: branches/build_with_scons/scipy/lib/blas/SConstruct =================================================================== --- branches/build_with_scons/scipy/lib/blas/SConstruct 2008-03-05 06:37:15 UTC (rev 3973) +++ branches/build_with_scons/scipy/lib/blas/SConstruct 2008-03-05 07:00:10 UTC (rev 3974) @@ -0,0 +1,83 @@ +# Last Change: Wed Mar 05 03:00 PM 2008 J +# vim:syntax=python + +import os +from os.path import join as pjoin, splitext + +from numpy.distutils.misc_util import get_numpy_include_dirs +from numscons import get_python_inc#, get_pythonlib_dir +from numscons import GetNumpyEnvironment +from numscons import CheckCBLAS, CheckF77BLAS,\ + IsVeclib, IsAccelerate, \ + IsATLAS, GetATLASVersion +from numscons import write_info + +from scons_support import do_generate_fake_interface, generate_interface_emitter + +env = GetNumpyEnvironment(ARGUMENTS) +env.Append(CPPPATH = [get_python_inc(), get_numpy_include_dirs()]) +#if os.name == 'nt': +# # NT needs the pythonlib to run any code importing Python.h, including +# # simple code using only typedef and so on, so we need it for configuration +# # checks +# env.AppendUnique(LIBPATH = [get_pythonlib_dir()]) + +env['BUILDERS']['GenerateFakePyf'] = Builder(action = do_generate_fake_interface, + emitter = generate_interface_emitter) + +#======================= +# Starting Configuration +#======================= +config = env.NumpyConfigure(custom_tests = {'CheckCBLAS' : CheckCBLAS, + 'CheckBLAS' : CheckF77BLAS}) + +#-------------- +# Checking Blas +#-------------- +st = config.CheckBLAS(check_version = 1) +if not st: + raise RuntimeError("no blas found, necessary for linalg module") +if IsATLAS(env, 'blas'): + version = GetATLASVersion(env) + env.Append(CPPDEFINES = [('ATLAS_INFO', '"\\"%s"\\"' % version)]) +else: + env.Append(CPPDEFINES = [('NO_ATLAS_INFO', 1)]) + +if config.CheckCBLAS(): + has_cblas = 1 +else: + has_cblas = 0 + +config.Finish() +write_info(env) + +#========== +# Build +#========== + +# XXX: handle cblas wrapper for complex (check in numpy.scons or here ?) +env.AppendUnique(CPPPATH = env['F2PYINCLUDEDIR']) +env.AppendUnique(F2PYOPTIONS = '--quiet') + +#------------ +# fblas +#------------ +env.NumpyFromFTemplate('fblas.pyf', 'fblas.pyf.src') +source = ['fblas.pyf'] +if IsVeclib(env, 'blas') or IsAccelerate(env, 'blas'): + env.NumpyFromCTemplate('fblaswrap_veclib_c.c', 'fblaswrap_veclib_c.c.src') + source.append('fblaswrap_veclib_c.c') +else: + env.NumpyFromFTemplate('fblaswrap.f', 'fblaswrap.f.src') + source.append('fblaswrap.f') +env.NumpyPythonExtension('fblas', source) + +#------------ +# cblas +#------------ +source = ['cblas.pyf'] +if has_cblas: + env.NumpyFromFTemplate('cblas.pyf', 'cblas.pyf.src') +else: + print env.GenerateFakePyf('cblas', 'cblas.pyf.src') +env.NumpyPythonExtension('cblas', source) Added: branches/build_with_scons/scipy/lib/blas/scons_support.py =================================================================== --- branches/build_with_scons/scipy/lib/blas/scons_support.py 2008-03-05 06:37:15 UTC (rev 3973) +++ branches/build_with_scons/scipy/lib/blas/scons_support.py 2008-03-05 07:00:10 UTC (rev 3974) @@ -0,0 +1,30 @@ +from os.path import join as pjoin, splitext, basename as pbasename + +def generate_interface_emitter(target, source, env): + source = [pjoin(env['build_dir'], str(i)) for i in source] + target = [pjoin(env['build_dir'], str(i)) for i in target] + base = str(target[0]) + return (['%s.pyf' % base], source) + +def do_generate_fake_interface(target, source, env): + """Generate a (fake) .pyf file from another pyf file (!).""" + # XXX: do this correctly + target_name = str(target[0]) + source_name = str(source[0]) + + # XXX handle skip names + name = splitext(pbasename(target_name))[0] + #generate_interface(name, source_name, target_name) + + f = open(target_name, 'w') + f.write('python module '+name+'\n') + f.write('usercode void empty_module(void) {}\n') + f.write('interface\n') + f.write('subroutine empty_module()\n') + f.write('intent(c) empty_module\n') + f.write('end subroutine empty_module\n') + f.write('end interface\nend python module'+name+'\n') + f.close() + + return 0 + Copied: branches/build_with_scons/scipy/lib/blas/setupscons.py (from rev 3969, branches/build_with_scons/scipy/lib/blas/setup.py) =================================================================== --- branches/build_with_scons/scipy/lib/blas/setup.py 2008-03-05 02:13:58 UTC (rev 3969) +++ branches/build_with_scons/scipy/lib/blas/setupscons.py 2008-03-05 07:00:10 UTC (rev 3974) @@ -0,0 +1,16 @@ +#!/usr/bin/env python + +def configuration(parent_package='',top_path=None): + from numpy.distutils.misc_util import Configuration + from numpy.distutils.system_info import get_info + + config = Configuration('blas',parent_package,top_path) + + config.add_sconscript('SConstruct') + config.add_data_dir('tests') + + return config + +if __name__ == '__main__': + from numpy.distutils.core import setup + setup(**configuration(top_path='').todict()) Added: branches/build_with_scons/scipy/lib/lapack/SConstruct =================================================================== --- branches/build_with_scons/scipy/lib/lapack/SConstruct 2008-03-05 06:37:15 UTC (rev 3973) +++ branches/build_with_scons/scipy/lib/lapack/SConstruct 2008-03-05 07:00:10 UTC (rev 3974) @@ -0,0 +1,94 @@ +# Last Change: Wed Mar 05 03:00 PM 2008 J +# vim:syntax=python + +import os +from os.path import join as pjoin, splitext + +from numpy.distutils.misc_util import get_numpy_include_dirs +from numscons import get_python_inc +from numscons import GetNumpyEnvironment +from numscons import CheckF77LAPACK,\ + CheckCLAPACK, \ + IsATLAS, GetATLASVersion, \ + CheckF77Clib +from numscons import write_info + +from scons_support import do_generate_fake_interface, \ + generate_interface_emitter + +env = GetNumpyEnvironment(ARGUMENTS) +env.Append(CPPPATH = [get_python_inc(), get_numpy_include_dirs()]) +#if os.name == 'nt': +# # NT needs the pythonlib to run any code importing Python.h, including +# # simple code using only typedef and so on, so we need it for configuration +# # checks +# env.AppendUnique(LIBPATH = [get_pythonlib_dir()]) + +#======================= +# Starting Configuration +#======================= +config = env.NumpyConfigure(custom_tests = {'CheckCLAPACK' : CheckCLAPACK, + 'CheckLAPACK' : CheckF77LAPACK, + 'CheckF77Clib' : CheckF77Clib}) + +#-------------- +# Checking Blas +#-------------- +if not config.CheckF77Clib(): + raise RuntimeError("Could not check F/C runtime library for %s/%s, " \ + "contact the maintainer" % (env['CC'], env['F77'])) + +st = config.CheckLAPACK(check_version = 1) +if not st: + raise RuntimeError("no lapack found, necessary for lapack module") + +if IsATLAS(env, 'lapack'): + version = GetATLASVersion(env) + env.Append(CPPDEFINES = [('ATLAS_INFO', '"\\"%s"\\"' % version)]) +else: + env.Append(CPPDEFINES = [('NO_ATLAS_INFO', 1)]) + +if config.CheckCLAPACK(): + has_clapack = 1 +else: + has_clapack = 0 + +config.Finish() +write_info(env) + +#========== +# Build +#========== +env.AppendUnique(CPPPATH = env['F2PYINCLUDEDIR']) +env.AppendUnique(F2PYOPTIONS = '--quiet') + +env['BUILDERS']['GenerateFakePyf'] = Builder(action = do_generate_fake_interface, + emitter = generate_interface_emitter) + +#------------ +# flapack +#------------ +yop = env.NumpyFromFTemplate('flapack.pyf', 'flapack.pyf.src') +env.NumpyPythonExtension('flapack', source = ['flapack.pyf']) + +#------------ +# clapack +#------------ +if has_clapack: + env.NumpyFromFTemplate('clapack.pyf', 'clapack.pyf.src') +else: + env.GenerateFakePyf('clapack', 'clapack.pyf.src') +env.NumpyPythonExtension('clapack', source = 'clapack.pyf') + +#---------------- +# calc_lwork: +#---------------- +calc_src = env.F2py(pjoin(env['build_dir'], 'calc_lworkmodule.c'), + source = pjoin(env['build_dir'], 'calc_lwork.f')) +env.NumpyPythonExtension('calc_lwork', source = calc_src + ['calc_lwork.f'], + LINKFLAGSEND = env['F77_LDFLAGS']) + +#-------------- +# Atlas version +#-------------- +env.NumpyPythonExtension('atlas_version', 'atlas_version.c') Added: branches/build_with_scons/scipy/lib/lapack/scons_support.py =================================================================== --- branches/build_with_scons/scipy/lib/lapack/scons_support.py 2008-03-05 06:37:15 UTC (rev 3973) +++ branches/build_with_scons/scipy/lib/lapack/scons_support.py 2008-03-05 07:00:10 UTC (rev 3974) @@ -0,0 +1,30 @@ +from os.path import join as pjoin, splitext, basename as pbasename + +def generate_interface_emitter(target, source, env): + source = [pjoin(env['build_dir'], str(i)) for i in source] + target = [pjoin(env['build_dir'], str(i)) for i in target] + base = str(target[0]) + return (['%s.pyf' % base], source) + +def do_generate_fake_interface(target, source, env): + """Generate a (fake) .pyf file from another pyf file (!).""" + # XXX: do this correctly + target_name = str(target[0]) + source_name = str(source[0]) + + # XXX handle skip names + name = splitext(pbasename(target_name))[0] + #generate_interface(name, source_name, target_name) + + f = open(target_name, 'w') + f.write('python module '+name+'\n') + f.write('usercode void empty_module(void) {}\n') + f.write('interface\n') + f.write('subroutine empty_module()\n') + f.write('intent(c) empty_module\n') + f.write('end subroutine empty_module\n') + f.write('end interface\nend python module'+name+'\n') + f.close() + + return 0 + Copied: branches/build_with_scons/scipy/lib/lapack/setupscons.py (from rev 3969, branches/build_with_scons/scipy/lib/lapack/setup.py) =================================================================== --- branches/build_with_scons/scipy/lib/lapack/setup.py 2008-03-05 02:13:58 UTC (rev 3969) +++ branches/build_with_scons/scipy/lib/lapack/setupscons.py 2008-03-05 07:00:10 UTC (rev 3974) @@ -0,0 +1,20 @@ +#!/usr/bin/env python + +import os +from glob import glob + +def configuration(parent_package='',top_path=None): + from numpy.distutils.misc_util import Configuration + from numpy.distutils.system_info import get_info + + config = Configuration('lapack',parent_package,top_path) + + config.add_sconscript('SConstruct') + config.add_data_dir('tests') + + return config + +if __name__ == '__main__': + from numpy.distutils.core import setup + + setup(**configuration(top_path='').todict()) Copied: branches/build_with_scons/scipy/lib/setupscons.py (from rev 3969, branches/build_with_scons/scipy/lib/setup.py) =================================================================== --- branches/build_with_scons/scipy/lib/setup.py 2008-03-05 02:13:58 UTC (rev 3969) +++ branches/build_with_scons/scipy/lib/setupscons.py 2008-03-05 07:00:10 UTC (rev 3974) @@ -0,0 +1,16 @@ +#!/usr/bin/env python + +def configuration(parent_package='',top_path=None): + from numpy.distutils.misc_util import Configuration + + config = Configuration('lib',parent_package,top_path, + setup_name = 'setupscons.py') + config.add_subpackage('blas') + config.add_subpackage('lapack') + + return config + +if __name__ == '__main__': + from numpy.distutils.core import setup + + setup(**configuration(top_path='').todict()) Modified: branches/build_with_scons/scipy/setupscons.py =================================================================== --- branches/build_with_scons/scipy/setupscons.py 2008-03-05 06:37:15 UTC (rev 3973) +++ branches/build_with_scons/scipy/setupscons.py 2008-03-05 07:00:10 UTC (rev 3974) @@ -7,7 +7,7 @@ config.add_subpackage('integrate') config.add_subpackage('interpolate') config.add_subpackage('io') - #config.add_subpackage('lib') + config.add_subpackage('lib') #config.add_subpackage('linalg') #config.add_subpackage('linsolve') #config.add_subpackage('maxentropy') From scipy-svn at scipy.org Wed Mar 5 02:28:22 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Wed, 5 Mar 2008 01:28:22 -0600 (CST) Subject: [Scipy-svn] r3975 - in branches/build_with_scons/scipy: . linalg Message-ID: <20080305072822.2EA6339C1AE@new.scipy.org> Author: cdavid Date: 2008-03-05 01:28:08 -0600 (Wed, 05 Mar 2008) New Revision: 3975 Added: branches/build_with_scons/scipy/linalg/SConstruct branches/build_with_scons/scipy/linalg/scons_support.py branches/build_with_scons/scipy/linalg/setupscons.py Modified: branches/build_with_scons/scipy/setupscons.py Log: linalg now builds with numscons. Added: branches/build_with_scons/scipy/linalg/SConstruct =================================================================== --- branches/build_with_scons/scipy/linalg/SConstruct 2008-03-05 07:00:10 UTC (rev 3974) +++ branches/build_with_scons/scipy/linalg/SConstruct 2008-03-05 07:28:08 UTC (rev 3975) @@ -0,0 +1,148 @@ +# Last Change: Wed Mar 05 03:00 PM 2008 J +# vim:syntax=python + +import os +from os.path import join as pjoin, splitext + +from numpy.distutils.misc_util import get_numpy_include_dirs +from numscons import get_python_inc#, get_pythonlib_dir +from numscons import GetNumpyEnvironment +from numscons import CheckCBLAS, CheckF77BLAS, CheckF77LAPACK,\ + CheckCLAPACK, IsVeclib, IsAccelerate, \ + IsATLAS, GetATLASVersion, CheckF77Clib +from numscons import write_info + +from scons_support import do_generate_interface, do_generate_fake_interface, \ + generate_interface_emitter + +#from scons_support import CheckBrokenMathlib, define_no_smp, \ +# generate_config_header, generate_config_header_emitter + +env = GetNumpyEnvironment(ARGUMENTS) +env.Append(CPPPATH = [get_python_inc(), get_numpy_include_dirs()]) +#if os.name == 'nt': +# # NT needs the pythonlib to run any code importing Python.h, including +# # simple code using only typedef and so on, so we need it for configuration +# # checks +# env.AppendUnique(LIBPATH = [get_pythonlib_dir()]) + +#======================= +# Starting Configuration +#======================= +config = env.NumpyConfigure(custom_tests = {'CheckCBLAS' : CheckCBLAS, + 'CheckBLAS' : CheckF77BLAS, + 'CheckCLAPACK' : CheckCLAPACK, + 'CheckLAPACK' : CheckF77LAPACK, + 'CheckF77Clib' : CheckF77Clib}) + +#-------------- +# Checking Blas +#-------------- +if not config.CheckF77Clib(): + raise RuntimeError("Could not check F/C runtime library for %s/%s, " \ + "contact the maintainer" % (env['CC'], env['F77'])) + +st = config.CheckBLAS(check_version = 1) +if not st: + raise RuntimeError("no blas found, necessary for linalg module") +if IsATLAS(env, 'blas'): + version = GetATLASVersion(env) + env.Append(CPPDEFINES = [('ATLAS_INFO', '"\\"%s"\\"' % version)]) +else: + env.Append(CPPDEFINES = [('NO_ATLAS_INFO', 1)]) + +st = config.CheckLAPACK() +if not st: + raise RuntimeError("no lapack found, necessary for linalg module") + +if config.CheckCBLAS(): + has_cblas = 1 +else: + has_cblas = 0 + +if config.CheckCLAPACK(): + has_clapack = 1 +else: + has_clapack = 0 + +config.Finish() +write_info(env) + +#========== +# Build +#========== + +# XXX: handle cblas wrapper for complex (check in numpy.scons or here ?) +env.AppendUnique(CPPPATH = env['F2PYINCLUDEDIR']) +env.AppendUnique(F2PYOPTIONS = '--quiet') + +env['BUILDERS']['haha'] = Builder(action = do_generate_interface, + emitter = generate_interface_emitter) + +env['BUILDERS']['hihi'] = Builder(action = do_generate_fake_interface, + emitter = generate_interface_emitter) + +#------------ +# fblas +#------------ +env.haha('fblas', 'generic_fblas.pyf') +source = ['fblas.pyf'] +if IsVeclib(env, 'blas') or IsAccelerate(env, 'blas'): + source.append(pjoin('src', 'fblaswrap_veclib_c.c')) +else: + source.append(pjoin('src', 'fblaswrap.f')) +env.NumpyPythonExtension('fblas', source) + +#------------ +# cblas +#------------ +if has_cblas: + env.haha('cblas', 'generic_cblas.pyf') +else: + env.hihi('cblas', 'generic_cblas.pyf') +env.NumpyPythonExtension('cblas', source = 'cblas.pyf') + +#------------ +# flapack +#------------ +yop = env.haha('flapack', 'generic_flapack.pyf') +# XXX: automatically scan dependency on flapack_user_routines.pyf ? +env.Depends(yop, pjoin(env['build_dir'], 'flapack_user_routines.pyf')) +env.NumpyPythonExtension('flapack', source = ['flapack.pyf']) + +#------------ +# clapack +#------------ +if has_clapack: + env.haha('clapack', 'generic_clapack.pyf') +else: + env.hihi('clapack', 'generic_clapack.pyf') +env.NumpyPythonExtension('clapack', source = 'clapack.pyf') + +#---------------- +# _flinalg +#---------------- +_flinalg_fsrc = ['det.f', 'lu.f'] +_flinalg_src = env.F2py( + pjoin(env['build_dir'], 'src', '_flinalgmodule.c'), + source = [pjoin(env['build_dir'], 'src', i) for i in _flinalg_fsrc]) + +env.NumpyPythonExtension( + '_flinalg', source = _flinalg_src + [pjoin('src', i) for i in _flinalg_fsrc]) + +#---------------- +# calc_lwork: +#---------------- +calc_src = env.F2py(pjoin(env['build_dir'], 'src', 'calc_lworkmodule.c'), + source = pjoin(env['build_dir'], 'src', 'calc_lwork.f')) +env.NumpyPythonExtension('calc_lwork', + source = calc_src + [pjoin('src', 'calc_lwork.f')], + LINKFLAGSEND = env['F77_LDFLAGS']) + +#-------------- +# Atlas version +#-------------- +atlas_env = env.Copy() +if not IsATLAS(env, 'blas'): + atlas_env.AppendUnique(CPPDEFINES = "NO_ATLAS_INFO") +atlas_env.NumpyPythonExtension('atlas_version', 'atlas_version.c') Added: branches/build_with_scons/scipy/linalg/scons_support.py =================================================================== --- branches/build_with_scons/scipy/linalg/scons_support.py 2008-03-05 07:00:10 UTC (rev 3974) +++ branches/build_with_scons/scipy/linalg/scons_support.py 2008-03-05 07:28:08 UTC (rev 3975) @@ -0,0 +1,43 @@ +from os.path import join as pjoin, splitext, basename as pbasename + +from interface_gen import generate_interface + +def do_generate_interface(target, source, env): + """Generate a .pyf file from another pyf file (!).""" + # XXX: do this correctly + target_name = str(target[0]) + source_name = str(source[0]) + + # XXX handle skip names + name = splitext(pbasename(target_name))[0] + generate_interface(name, source_name, target_name) + return 0 + +def generate_interface_emitter(target, source, env): + source = [pjoin(env['build_dir'], str(i)) for i in source] + target = [pjoin(env['build_dir'], str(i)) for i in target] + base = str(target[0]) + return (['%s.pyf' % base], source) + +def do_generate_fake_interface(target, source, env): + """Generate a (fake) .pyf file from another pyf file (!).""" + # XXX: do this correctly + target_name = str(target[0]) + source_name = str(source[0]) + + # XXX handle skip names + name = splitext(pbasename(target_name))[0] + generate_interface(name, source_name, target_name) + + f = open(target_name, 'w') + f.write('python module '+name+'\n') + f.write('usercode void empty_module(void) {}\n') + f.write('interface\n') + f.write('subroutine empty_module()\n') + f.write('intent(c) empty_module\n') + f.write('end subroutine empty_module\n') + f.write('end interface\nend python module'+name+'\n') + f.close() + + return 0 + Copied: branches/build_with_scons/scipy/linalg/setupscons.py (from rev 3969, branches/build_with_scons/scipy/linalg/setup.py) =================================================================== --- branches/build_with_scons/scipy/linalg/setup.py 2008-03-05 02:13:58 UTC (rev 3969) +++ branches/build_with_scons/scipy/linalg/setupscons.py 2008-03-05 07:28:08 UTC (rev 3975) @@ -0,0 +1,18 @@ +#!/usr/bin/env python + +def configuration(parent_package='',top_path=None): + from numpy.distutils.misc_util import Configuration + + config = Configuration('linalg',parent_package,top_path) + + config.add_sconscript('SConstruct') + config.add_data_dir('tests') + + return config + +if __name__ == '__main__': + from numpy.distutils.core import setup + from linalg_version import linalg_version + + setup(version=linalg_version, + **configuration(top_path='').todict()) Modified: branches/build_with_scons/scipy/setupscons.py =================================================================== --- branches/build_with_scons/scipy/setupscons.py 2008-03-05 07:00:10 UTC (rev 3974) +++ branches/build_with_scons/scipy/setupscons.py 2008-03-05 07:28:08 UTC (rev 3975) @@ -8,7 +8,7 @@ config.add_subpackage('interpolate') config.add_subpackage('io') config.add_subpackage('lib') - #config.add_subpackage('linalg') + config.add_subpackage('linalg') #config.add_subpackage('linsolve') #config.add_subpackage('maxentropy') #config.add_subpackage('misc') From scipy-svn at scipy.org Wed Mar 5 03:05:53 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Wed, 5 Mar 2008 02:05:53 -0600 (CST) Subject: [Scipy-svn] r3977 - in branches/build_with_scons/scipy: . maxentropy misc Message-ID: <20080305080553.26A7439C21B@new.scipy.org> Author: cdavid Date: 2008-03-05 02:05:39 -0600 (Wed, 05 Mar 2008) New Revision: 3977 Added: branches/build_with_scons/scipy/maxentropy/setupscons.py branches/build_with_scons/scipy/misc/setupscons.py Modified: branches/build_with_scons/scipy/setupscons.py Log: Add misc and maxentropy to numscons build. Copied: branches/build_with_scons/scipy/maxentropy/setupscons.py (from rev 3975, branches/build_with_scons/scipy/maxentropy/setup.py) Copied: branches/build_with_scons/scipy/misc/setupscons.py (from rev 3975, branches/build_with_scons/scipy/misc/setup.py) Modified: branches/build_with_scons/scipy/setupscons.py =================================================================== --- branches/build_with_scons/scipy/setupscons.py 2008-03-05 07:45:06 UTC (rev 3976) +++ branches/build_with_scons/scipy/setupscons.py 2008-03-05 08:05:39 UTC (rev 3977) @@ -9,9 +9,9 @@ config.add_subpackage('io') config.add_subpackage('lib') config.add_subpackage('linalg') - #config.add_subpackage('linsolve') - #config.add_subpackage('maxentropy') - #config.add_subpackage('misc') + config.add_subpackage('linsolve') + config.add_subpackage('maxentropy') + config.add_subpackage('misc') #config.add_subpackage('odr') #config.add_subpackage('optimize') #config.add_subpackage('sandbox') From scipy-svn at scipy.org Wed Mar 5 03:11:18 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Wed, 5 Mar 2008 02:11:18 -0600 (CST) Subject: [Scipy-svn] r3978 - branches/build_with_scons/scipy/odr Message-ID: <20080305081118.3775039C21B@new.scipy.org> Author: cdavid Date: 2008-03-05 02:11:09 -0600 (Wed, 05 Mar 2008) New Revision: 3978 Added: branches/build_with_scons/scipy/odr/SConstruct branches/build_with_scons/scipy/odr/setupscons.py Log: odr now builds with numscons. Added: branches/build_with_scons/scipy/odr/SConstruct =================================================================== --- branches/build_with_scons/scipy/odr/SConstruct 2008-03-05 08:05:39 UTC (rev 3977) +++ branches/build_with_scons/scipy/odr/SConstruct 2008-03-05 08:11:09 UTC (rev 3978) @@ -0,0 +1,61 @@ +# Last Change: Wed Mar 05 04:00 PM 2008 J +# vim:syntax=python + +import os +from os.path import join as pjoin, splitext + +from numpy.distutils.misc_util import get_numpy_include_dirs +from numscons import get_python_inc#, get_pythonlib_dir +from numscons import GetNumpyEnvironment +from numscons import CheckF77BLAS, CheckF77Clib + +from numscons import write_info + +env = GetNumpyEnvironment(ARGUMENTS) +env.Append(CPPPATH = [get_python_inc(), get_numpy_include_dirs()]) +#if os.name == 'nt': +# # NT needs the pythonlib to run any code importing Python.h, including +# # simple code using only typedef and so on, so we need it for configuration +# # checks +# env.AppendUnique(LIBPATH = [get_pythonlib_dir()]) + +#======================= +# Starting Configuration +#======================= +config = env.NumpyConfigure(custom_tests = {'CheckBLAS' : CheckF77BLAS, + 'CheckF77Clib' : CheckF77Clib}) + +if not config.CheckF77Clib(): + raise RuntimeError("Could not check F/C runtime library for %s/%s, " \ + "contact the maintainer" % (env['CC'], env['F77'])) + +#-------------- +# Checking Blas +#-------------- +st = config.CheckBLAS() +if not st: + has_blas = 0 +else: + has_blas = 1 + +config.Finish() +write_info(env) + +#========== +# Build +#========== + +# odr lib +libodr_src = [pjoin('odrpack', i) for i in ['d_odr.f', 'd_mprec.f', 'dlunoc.f']] +if has_blas: + libodr_src.append(pjoin('odrpack', 'd_lpk.f')) +else: + libodr_src.append(pjoin('odrpack', 'd_lpkbls.f')) + +env.NumpyStaticExtLibrary('odrpack', source = libodr_src) +env.AppendUnique(LIBS = 'odrpack') +env.AppendUnique(LIBPATH = env['build_dir']) + +# odr pyextension +env.NumpyPythonExtension('__odrpack', '__odrpack.c', + LINKFLAGSEND = env['F77_LDFLAGS']) Copied: branches/build_with_scons/scipy/odr/setupscons.py (from rev 3975, branches/build_with_scons/scipy/odr/setup.py) =================================================================== --- branches/build_with_scons/scipy/odr/setup.py 2008-03-05 07:28:08 UTC (rev 3975) +++ branches/build_with_scons/scipy/odr/setupscons.py 2008-03-05 08:11:09 UTC (rev 3978) @@ -0,0 +1,17 @@ +#!/usr/bin/env python + +from os.path import join + +def configuration(parent_package='', top_path=None): + from numpy.distutils.misc_util import Configuration + + config = Configuration('odr', parent_package, top_path) + + config.add_sconscript('SConstruct') + config.add_data_dir('tests') + + return config + +if __name__ == '__main__': + from numpy.distutils.core import setup + setup(**configuration(top_path='').todict()) From scipy-svn at scipy.org Wed Mar 5 03:15:05 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Wed, 5 Mar 2008 02:15:05 -0600 (CST) Subject: [Scipy-svn] r3979 - in branches/build_with_scons/scipy: . optimize Message-ID: <20080305081505.D383C39C06A@new.scipy.org> Author: cdavid Date: 2008-03-05 02:14:54 -0600 (Wed, 05 Mar 2008) New Revision: 3979 Added: branches/build_with_scons/scipy/optimize/SConstruct branches/build_with_scons/scipy/optimize/setupscons.py Modified: branches/build_with_scons/scipy/setupscons.py Log: optimize now builds with numscons. Added: branches/build_with_scons/scipy/optimize/SConstruct =================================================================== --- branches/build_with_scons/scipy/optimize/SConstruct 2008-03-05 08:11:09 UTC (rev 3978) +++ branches/build_with_scons/scipy/optimize/SConstruct 2008-03-05 08:14:54 UTC (rev 3979) @@ -0,0 +1,91 @@ +# Last Change: Wed Mar 05 05:00 PM 2008 J +# vim:syntax=python + +import os +from os.path import join as pjoin, splitext + +from numpy.distutils.misc_util import get_numpy_include_dirs +from numscons import get_python_inc#, get_pythonlib_dir +from numscons import GetNumpyEnvironment +from numscons import CheckF77LAPACK, CheckF77Clib + +from numscons import write_info + +env = GetNumpyEnvironment(ARGUMENTS) +env.Append(CPPPATH = get_numpy_include_dirs()) +env.Append(CPPPATH = env['F2PYINCLUDEDIR']) +#if os.name == 'nt': +# # NT needs the pythonlib to run any code importing Python.h, including +# # simple code using only typedef and so on, so we need it for configuration +# # checks +# env.AppendUnique(LIBPATH = [get_pythonlib_dir()]) + +#======================= +# Starting Configuration +#======================= +config = env.NumpyConfigure(custom_tests = {'CheckLAPACK' : CheckF77LAPACK, + 'CheckF77Clib' : CheckF77Clib}) + +#----------------- +# Checking Lapack +#----------------- +if not config.CheckF77Clib(): + raise RuntimeLibrary("Could not check C/F runtime library for %s/%s"\ + " , contact the maintainer" % (env['CC'], env['F77'])) + +st = config.CheckLAPACK() +if not st: + has_lapack = 0 +else: + has_lapack = 1 + +config.Finish() +write_info(env) + +#========== +# Build +#========== + +# minpack lib +minpack_src = [str(s) for s in env.Glob(pjoin('minpack', '*.f'))] +env.NumpyStaticExtLibrary('minpack', source = minpack_src) + +# rootfind lib +rootfind_src = [str(s) for s in env.Glob(pjoin('Zeros', '*.c'))] +env.NumpyStaticExtLibrary('rootfind', source = rootfind_src) + +env.AppendUnique(LIBS = ['minpack', 'rootfind']) +env.AppendUnique(LIBPATH = env['build_dir']) + +# _minpack pyextension +env.NumpyPythonExtension('_minpack', '_minpackmodule.c', + LINKFLAGSEND = env['F77_LDFLAGS']) + +# _zeros pyextension +env.NumpyPythonExtension('_zeros', 'zeros.c') + +# _lbfgsb pyextension +src = pjoin('lbfgsb', 'routines.f') +lbfgsb_src = env.F2py(pjoin(env['build_dir'], '_lbfgsbmodule.c'), + pjoin(env['build_dir'], 'lbfgsb', 'lbfgsb.pyf')) +env.NumpyPythonExtension('_lbfgsb', source = [src] + lbfgsb_src, + LINKFLAGSEND = env['F77_LDFLAGS']) + +# _cobyla pyextension +src = [pjoin('cobyla', i) for i in ['cobyla2.f', 'trstlp.f']] +wrap_src = env.F2py(pjoin(env['build_dir'], 'cobyla', '_cobylamodule.c'), + pjoin(env['build_dir'], 'cobyla', 'cobyla.pyf')) +env.NumpyPythonExtension('_cobyla', source = src + wrap_src, + LINKFLAGSEND = env['F77_LDFLAGS']) + +# _minpack2 pyextension +src = [pjoin('minpack2', i) for i in ['dcsrch.f', 'dcstep.f']] +wrap_src = env.F2py(pjoin(env['build_dir'], 'minpack2', 'minpack2module.c'), + pjoin(env['build_dir'], 'minpack2', 'minpack2.pyf')) +env.NumpyPythonExtension('minpack2', source = src + wrap_src, + LINKFLAGSEND = env['F77_LDFLAGS']) + +# moduleTNC pyextension +env.NumpyPythonExtension('moduleTNC', + source = [pjoin('tnc', i) for i in \ + ['moduleTNC.c', 'tnc.c']]) Copied: branches/build_with_scons/scipy/optimize/setupscons.py (from rev 3975, branches/build_with_scons/scipy/optimize/setup.py) =================================================================== --- branches/build_with_scons/scipy/optimize/setup.py 2008-03-05 07:28:08 UTC (rev 3975) +++ branches/build_with_scons/scipy/optimize/setupscons.py 2008-03-05 08:14:54 UTC (rev 3979) @@ -0,0 +1,17 @@ +#!/usr/bin/env python + +from os.path import join + +def configuration(parent_package='',top_path=None): + from numpy.distutils.misc_util import Configuration + from numpy.distutils.system_info import get_info + config = Configuration('optimize',parent_package, top_path) + + config.add_sconscript('SConstruct') + config.add_data_dir('tests') + + return config + +if __name__ == '__main__': + from numpy.distutils.core import setup + setup(**configuration(top_path='').todict()) Modified: branches/build_with_scons/scipy/setupscons.py =================================================================== --- branches/build_with_scons/scipy/setupscons.py 2008-03-05 08:11:09 UTC (rev 3978) +++ branches/build_with_scons/scipy/setupscons.py 2008-03-05 08:14:54 UTC (rev 3979) @@ -12,8 +12,8 @@ config.add_subpackage('linsolve') config.add_subpackage('maxentropy') config.add_subpackage('misc') - #config.add_subpackage('odr') - #config.add_subpackage('optimize') + config.add_subpackage('odr') + config.add_subpackage('optimize') #config.add_subpackage('sandbox') #config.add_subpackage('signal') #config.add_subpackage('sparse') From scipy-svn at scipy.org Wed Mar 5 03:16:01 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Wed, 5 Mar 2008 02:16:01 -0600 (CST) Subject: [Scipy-svn] r3980 - in branches/build_with_scons/scipy: . sandbox Message-ID: <20080305081601.EEDA039C265@new.scipy.org> Author: cdavid Date: 2008-03-05 02:15:51 -0600 (Wed, 05 Mar 2008) New Revision: 3980 Added: branches/build_with_scons/scipy/sandbox/setupscons.py Modified: branches/build_with_scons/scipy/setupscons.py Log: sandbox handled by setupscons.py. Copied: branches/build_with_scons/scipy/sandbox/setupscons.py (from rev 3975, branches/build_with_scons/scipy/sandbox/setup.py) Modified: branches/build_with_scons/scipy/setupscons.py =================================================================== --- branches/build_with_scons/scipy/setupscons.py 2008-03-05 08:14:54 UTC (rev 3979) +++ branches/build_with_scons/scipy/setupscons.py 2008-03-05 08:15:51 UTC (rev 3980) @@ -14,7 +14,7 @@ config.add_subpackage('misc') config.add_subpackage('odr') config.add_subpackage('optimize') - #config.add_subpackage('sandbox') + config.add_subpackage('sandbox') #config.add_subpackage('signal') #config.add_subpackage('sparse') #config.add_subpackage('special') From scipy-svn at scipy.org Wed Mar 5 03:17:31 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Wed, 5 Mar 2008 02:17:31 -0600 (CST) Subject: [Scipy-svn] r3981 - in branches/build_with_scons/scipy: . signal Message-ID: <20080305081731.19F9A39C06A@new.scipy.org> Author: cdavid Date: 2008-03-05 02:17:19 -0600 (Wed, 05 Mar 2008) New Revision: 3981 Added: branches/build_with_scons/scipy/signal/SConstruct branches/build_with_scons/scipy/signal/setupscons.py Modified: branches/build_with_scons/scipy/setupscons.py Log: signal now builds with numscons. Modified: branches/build_with_scons/scipy/setupscons.py =================================================================== --- branches/build_with_scons/scipy/setupscons.py 2008-03-05 08:15:51 UTC (rev 3980) +++ branches/build_with_scons/scipy/setupscons.py 2008-03-05 08:17:19 UTC (rev 3981) @@ -15,7 +15,7 @@ config.add_subpackage('odr') config.add_subpackage('optimize') config.add_subpackage('sandbox') - #config.add_subpackage('signal') + config.add_subpackage('signal') #config.add_subpackage('sparse') #config.add_subpackage('special') #config.add_subpackage('splinalg') Added: branches/build_with_scons/scipy/signal/SConstruct =================================================================== --- branches/build_with_scons/scipy/signal/SConstruct 2008-03-05 08:15:51 UTC (rev 3980) +++ branches/build_with_scons/scipy/signal/SConstruct 2008-03-05 08:17:19 UTC (rev 3981) @@ -0,0 +1,19 @@ +# Last Change: Wed Mar 05 05:00 PM 2008 J +# vim:syntax=python +from os.path import join + +from numpy.distutils.misc_util import get_numpy_include_dirs +from numscons import GetNumpyEnvironment + +env = GetNumpyEnvironment(ARGUMENTS) + +env.AppendUnique(CPPPATH = get_numpy_include_dirs()) +env.NumpyPythonExtension('sigtools', + source = ['sigtoolsmodule.c',\ + 'firfilter.c', \ + 'medianfilter.c']) + +env.NumpyPythonExtension('spline', + source = ['splinemodule.c', 'S_bspline_util.c', + 'D_bspline_util.c', 'C_bspline_util.c', + 'Z_bspline_util.c','bspline_util.c']) Copied: branches/build_with_scons/scipy/signal/setupscons.py (from rev 3979, branches/build_with_scons/scipy/signal/setup.py) =================================================================== --- branches/build_with_scons/scipy/signal/setup.py 2008-03-05 08:14:54 UTC (rev 3979) +++ branches/build_with_scons/scipy/signal/setupscons.py 2008-03-05 08:17:19 UTC (rev 3981) @@ -0,0 +1,15 @@ +#!/usr/bin/env python + +def configuration(parent_package='',top_path=None): + from numpy.distutils.misc_util import Configuration + + config = Configuration('signal', parent_package, top_path) + + config.add_sconscript('SConstruct') + config.add_data_dir('tests') + + return config + +if __name__ == '__main__': + from numpy.distutils.core import setup + setup(**configuration(top_path='').todict()) From scipy-svn at scipy.org Wed Mar 5 03:50:15 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Wed, 5 Mar 2008 02:50:15 -0600 (CST) Subject: [Scipy-svn] r3982 - branches/build_with_scons/scipy/sparse/linalg/eigen/arpack Message-ID: <20080305085015.1A65639C0CE@new.scipy.org> Author: cdavid Date: 2008-03-05 02:50:06 -0600 (Wed, 05 Mar 2008) New Revision: 3982 Added: branches/build_with_scons/scipy/sparse/linalg/eigen/arpack/SConstruct branches/build_with_scons/scipy/sparse/linalg/eigen/arpack/setupscons.py Log: sparse.linalg.eigen.arpack now builds with numscons. Added: branches/build_with_scons/scipy/sparse/linalg/eigen/arpack/SConstruct =================================================================== --- branches/build_with_scons/scipy/sparse/linalg/eigen/arpack/SConstruct 2008-03-05 08:17:19 UTC (rev 3981) +++ branches/build_with_scons/scipy/sparse/linalg/eigen/arpack/SConstruct 2008-03-05 08:50:06 UTC (rev 3982) @@ -0,0 +1,44 @@ +from os.path import join as pjoin + +from numpy.distutils.misc_util import get_numpy_include_dirs + +from numscons import GetNumpyEnvironment +from numscons import CheckF77LAPACK, CheckF77Clib +from numscons import write_info + +env = GetNumpyEnvironment(ARGUMENTS) + +#======================= +# Starting Configuration +#======================= +config = env.NumpyConfigure(custom_tests = {'CheckLAPACK' : CheckF77LAPACK, + 'CheckF77Clib' : CheckF77Clib}) + +#----------------- +# Checking Lapack +#----------------- +st = config.CheckLAPACK() +if not st: + raise RuntimeError("no lapack found, necessary for arpack module") + +config.Finish() +write_info(env) + +# Build arpack +arpack_src = env.Glob(pjoin('ARPACK', 'SRC', '*.f')) +arpack_src += env.Glob(pjoin('ARPACK', 'UTIL', '*.f')) +arpack_src += env.Glob(pjoin('ARPACK', 'LAPACK', '*.f')) + +src = [str(s) for s in arpack_src] + +env.AppendUnique(CPPPATH = pjoin('ARPACK', 'SRC')) +arpack_lib = env.NumpyStaticExtLibrary('arpack', source = src) + +# Build _arpack extension +env.AppendUnique(CPPPATH = env['F2PYINCLUDEDIR']) +env.AppendUnique(CPPPATH = get_numpy_include_dirs()) + +env.NumpyFromFTemplate('arpack.pyf', 'arpack.pyf.src') +wsrc = env.F2py(pjoin(env['build_dir'], '_arpackmodule.c'), + pjoin(env['build_dir'], 'arpack.pyf')) +env.NumpyPythonExtension('_arpack', source = '_arpackmodule.c', LIBS = arpack_lib) Copied: branches/build_with_scons/scipy/sparse/linalg/eigen/arpack/setupscons.py (from rev 3979, branches/build_with_scons/scipy/sparse/linalg/eigen/arpack/setup.py) =================================================================== --- branches/build_with_scons/scipy/sparse/linalg/eigen/arpack/setup.py 2008-03-05 08:14:54 UTC (rev 3979) +++ branches/build_with_scons/scipy/sparse/linalg/eigen/arpack/setupscons.py 2008-03-05 08:50:06 UTC (rev 3982) @@ -0,0 +1,37 @@ +#!/usr/bin/env python + +from os.path import join + +def configuration(parent_package='',top_path=None): + from numpy.distutils.misc_util import Configuration + + config = Configuration('arpack',parent_package,top_path) +# +# lapack_opt = get_info('lapack_opt') +# +# if not lapack_opt: +# raise NotFoundError,'no lapack/blas resources found' +# +# config = Configuration('arpack', parent_package, top_path) +# +# arpack_sources=[join('ARPACK','SRC', '*.f')] +# arpack_sources.extend([join('ARPACK','UTIL', '*.f')]) +# arpack_sources.extend([join('ARPACK','LAPACK', '*.f')]) +# +# config.add_library('arpack', sources=arpack_sources, +# include_dirs=[join('ARPACK', 'SRC')]) +# +# +# config.add_extension('_arpack', +# sources='arpack.pyf.src', +# libraries=['arpack'], +# extra_info = lapack_opt +# ) +# + config.add_sconscript('SConstruct') + config.add_data_dir('tests') + return config + +if __name__ == '__main__': + from numpy.distutils.core import setup + setup(**configuration(top_path='').todict()) From scipy-svn at scipy.org Wed Mar 5 03:51:12 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Wed, 5 Mar 2008 02:51:12 -0600 (CST) Subject: [Scipy-svn] r3983 - branches/build_with_scons/scipy/sparse/linalg/eigen Message-ID: <20080305085112.1874839C1F0@new.scipy.org> Author: cdavid Date: 2008-03-05 02:51:06 -0600 (Wed, 05 Mar 2008) New Revision: 3983 Added: branches/build_with_scons/scipy/sparse/linalg/eigen/setupscons.py Log: sparse.linalg.eigen now builds with numscons. Copied: branches/build_with_scons/scipy/sparse/linalg/eigen/setupscons.py (from rev 3979, branches/build_with_scons/scipy/sparse/linalg/eigen/setup.py) =================================================================== --- branches/build_with_scons/scipy/sparse/linalg/eigen/setup.py 2008-03-05 08:14:54 UTC (rev 3979) +++ branches/build_with_scons/scipy/sparse/linalg/eigen/setupscons.py 2008-03-05 08:51:06 UTC (rev 3983) @@ -0,0 +1,14 @@ +#!/usr/bin/env python + +def configuration(parent_package='',top_path=None): + from numpy.distutils.misc_util import Configuration + + config = Configuration('eigen',parent_package,top_path, setup_name = 'setupscons.py') + + config.add_subpackage(('arpack')) + + return config + +if __name__ == '__main__': + from numpy.distutils.core import setup + setup(**configuration(top_path='').todict()) From scipy-svn at scipy.org Wed Mar 5 04:33:31 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Wed, 5 Mar 2008 03:33:31 -0600 (CST) Subject: [Scipy-svn] r3984 - branches/build_with_scons/scipy/sparse/linalg/dsolve/umfpack Message-ID: <20080305093331.2526839C3F8@new.scipy.org> Author: cdavid Date: 2008-03-05 03:33:21 -0600 (Wed, 05 Mar 2008) New Revision: 3984 Added: branches/build_with_scons/scipy/sparse/linalg/dsolve/umfpack/SConstruct branches/build_with_scons/scipy/sparse/linalg/dsolve/umfpack/setupscons.py Log: sparse.linalg.dsolve.umfpack now builds with numscons. Added: branches/build_with_scons/scipy/sparse/linalg/dsolve/umfpack/SConstruct =================================================================== --- branches/build_with_scons/scipy/sparse/linalg/dsolve/umfpack/SConstruct 2008-03-05 08:51:06 UTC (rev 3983) +++ branches/build_with_scons/scipy/sparse/linalg/dsolve/umfpack/SConstruct 2008-03-05 09:33:21 UTC (rev 3984) @@ -0,0 +1,35 @@ +from os.path import join as pjoin + +from numpy.distutils.misc_util import get_numpy_include_dirs + +from numscons import GetNumpyEnvironment +from numscons import CheckF77BLAS, CheckF77Clib, NumpyCheckLibAndHeader +from numscons import write_info + +env = GetNumpyEnvironment(ARGUMENTS) + +#======================= +# Starting Configuration +#======================= +config = env.NumpyConfigure(custom_tests = + {'CheckBLAS' : CheckF77BLAS, + 'CheckF77Clib' : CheckF77Clib, + 'NumpyCheckLibAndHeader' : NumpyCheckLibAndHeader}) + +#----------------- +# Checking Lapack +#----------------- +st = config.CheckBLAS() +if not st: + raise RuntimeError("no blas found, necessary for umfpack module") + +has_umfpack = config.NumpyCheckLibAndHeader( + 'umfpack', None, 'umfpack.h', section = 'umfpack', autoadd = 1) +config.Finish() +write_info(env) + +if has_umfpack: + env.Append(SWIGFLAGS = '-python') + env.Append(SWIGFLAGS = '$_CPPINCFLAGS') + env.Append(CPPPATH = get_numpy_include_dirs()) + env.NumpyPythonExtension('__umfpack', source = 'umfpack.i') Copied: branches/build_with_scons/scipy/sparse/linalg/dsolve/umfpack/setupscons.py (from rev 3979, branches/build_with_scons/scipy/sparse/linalg/dsolve/umfpack/setup.py) =================================================================== --- branches/build_with_scons/scipy/sparse/linalg/dsolve/umfpack/setup.py 2008-03-05 08:14:54 UTC (rev 3979) +++ branches/build_with_scons/scipy/sparse/linalg/dsolve/umfpack/setupscons.py 2008-03-05 09:33:21 UTC (rev 3984) @@ -0,0 +1,32 @@ +#!/usr/bin/env python +# 05.12.2005, c +# last change: 27.03.2006 +def configuration(parent_package='',top_path=None): + from numpy.distutils.misc_util import Configuration + + config = Configuration( 'umfpack', parent_package, top_path ) + config.add_sconscript('SConstruct') + config.add_data_dir('tests') + +# umf_info = get_info( 'umfpack', notfound_action = 1 ) +# +# umfpack_i_file = config.paths('umfpack.i')[0] +# def umfpack_i(ext, build_dir): +# if umf_info: +# return umfpack_i_file +# +# blas_info = get_info('blas_opt') +# build_info = {} +# dict_append(build_info, **umf_info) +# dict_append(build_info, **blas_info) +# +# config.add_extension( '__umfpack', +# sources = [umfpack_i], +# depends = ['umfpack.i'], +# **build_info) +# + return config + +if __name__ == "__main__": + from numpy.distutils.core import setup + setup(**configuration(top_path='').todict()) From scipy-svn at scipy.org Wed Mar 5 04:56:58 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Wed, 5 Mar 2008 03:56:58 -0600 (CST) Subject: [Scipy-svn] r3985 - branches/build_with_scons/scipy/sparse/linalg/dsolve Message-ID: <20080305095658.41EED39C19C@new.scipy.org> Author: cdavid Date: 2008-03-05 03:56:48 -0600 (Wed, 05 Mar 2008) New Revision: 3985 Added: branches/build_with_scons/scipy/sparse/linalg/dsolve/SConstruct branches/build_with_scons/scipy/sparse/linalg/dsolve/setupscons.py Log: sparse.linalg.dsolve builds with numscons. Added: branches/build_with_scons/scipy/sparse/linalg/dsolve/SConstruct =================================================================== --- branches/build_with_scons/scipy/sparse/linalg/dsolve/SConstruct 2008-03-05 09:33:21 UTC (rev 3984) +++ branches/build_with_scons/scipy/sparse/linalg/dsolve/SConstruct 2008-03-05 09:56:48 UTC (rev 3985) @@ -0,0 +1,47 @@ +from os.path import join as pjoin +import sys + +from numpy.distutils.misc_util import get_numpy_include_dirs + +from numscons import GetNumpyEnvironment +from numscons import CheckF77LAPACK +from numscons import write_info + +env = GetNumpyEnvironment(ARGUMENTS) + +#======================= +# Starting Configuration +#======================= +config = env.NumpyConfigure(custom_tests = {'CheckLapack' : CheckF77LAPACK}) + +#----------------- +# Checking Lapack +#----------------- +st = config.CheckLapack() +if not st: + raise RuntimeError("no lapack found, necessary for dsolve module") + +config.Finish() +write_info(env) + +# Build superlu lib +superlu_env = env.Copy() +superlu_def = {} +if sys.platform == 'win32': + superlu_def['NO_TIMER'] = 1 +superlu_def['USE_VENDOR_BLAS'] = 2 +superlu_env.Append(CPPDEFINES = superlu_def) + +superlu_src = [str(s) for s in superlu_env.Glob(pjoin('SuperLU', 'SRC', '*.c'))] +superlu = superlu_env.NumpyStaticExtLibrary('superlu_src', source = superlu_src) + +# Build python extensions +pyenv = env.Copy() +pyenv.Append(CPPPATH = get_numpy_include_dirs()) +common_src = ['_superlu_utils.c', '_superluobject.c'] + +for prec in ['z', 'd', 'c', 's']: + pyenv.NumpyPythonExtension('_%ssuperlu' % prec, + source = common_src + \ + ['_%ssuperlumodule.c' % prec], + LIBS = superlu) Copied: branches/build_with_scons/scipy/sparse/linalg/dsolve/setupscons.py (from rev 3979, branches/build_with_scons/scipy/sparse/linalg/dsolve/setup.py) =================================================================== --- branches/build_with_scons/scipy/sparse/linalg/dsolve/setup.py 2008-03-05 08:14:54 UTC (rev 3979) +++ branches/build_with_scons/scipy/sparse/linalg/dsolve/setupscons.py 2008-03-05 09:56:48 UTC (rev 3985) @@ -0,0 +1,20 @@ +#!/usr/bin/env python +from os.path import join +import sys + +def configuration(parent_package='',top_path=None): + from numpy.distutils.misc_util import Configuration + from numpy.distutils.system_info import get_info + + config = Configuration('dsolve',parent_package,top_path, + setup_name = 'setupscons.py') + + config.add_sconscript('SConstruct') + config.add_data_dir('tests') + config.add_subpackage('umfpack') + + return config + +if __name__ == '__main__': + from numpy.distutils.core import setup + setup(**configuration(top_path='').todict()) From scipy-svn at scipy.org Wed Mar 5 05:07:06 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Wed, 5 Mar 2008 04:07:06 -0600 (CST) Subject: [Scipy-svn] r3986 - branches/build_with_scons/scipy/sparse/linalg/isolve Message-ID: <20080305100706.D3A4E39C36D@new.scipy.org> Author: cdavid Date: 2008-03-05 04:06:57 -0600 (Wed, 05 Mar 2008) New Revision: 3986 Added: branches/build_with_scons/scipy/sparse/linalg/isolve/SConstruct branches/build_with_scons/scipy/sparse/linalg/isolve/setupscons.py Log: sparse.linalg.isolve now builds with numscons. Added: branches/build_with_scons/scipy/sparse/linalg/isolve/SConstruct =================================================================== --- branches/build_with_scons/scipy/sparse/linalg/isolve/SConstruct 2008-03-05 09:56:48 UTC (rev 3985) +++ branches/build_with_scons/scipy/sparse/linalg/isolve/SConstruct 2008-03-05 10:06:57 UTC (rev 3986) @@ -0,0 +1,57 @@ +# Last Change: Wed Mar 05 06:00 PM 2008 J +# vim:syntax=python + +from os.path import join as pjoin, splitext + +from numpy.distutils.misc_util import get_numpy_include_dirs +from numscons import GetNumpyEnvironment +from numscons import CheckF77LAPACK + +from numscons import write_info + +env = GetNumpyEnvironment(ARGUMENTS) +env.Append(CPPPATH = [get_numpy_include_dirs(), env['F2PYINCLUDEDIR']]) +#if os.name == 'nt': +# # NT needs the pythonlib to run any code importing Python.h, including +# # simple code using only typedef and so on, so we need it for configuration +# # checks +# env.AppendUnique(LIBPATH = [get_pythonlib_dir()]) + +#======================= +# Starting Configuration +#======================= +config = env.NumpyConfigure(custom_tests = {'CheckLAPACK' : CheckF77LAPACK}) + +#----------------- +# Checking Lapack +#----------------- +st = config.CheckLAPACK() +if not st: + raise RuntimeError("no lapack found, necessary for isolve module") + +config.Finish() +write_info(env) + +#-------------------- +# iterative methods +#-------------------- +methods = ['BiCGREVCOM.f.src', + 'BiCGSTABREVCOM.f.src', + 'CGREVCOM.f.src', + 'CGSREVCOM.f.src', +# 'ChebyREVCOM.f.src', + 'GMRESREVCOM.f.src', +# 'JacobiREVCOM.f.src', + 'QMRREVCOM.f.src', +# 'SORREVCOM.f.src' + ] +Util = ['STOPTEST2.f.src','getbreak.f.src'] +raw_sources = methods + Util + ['_iterative.pyf.src'] + +sources = [] +for method in raw_sources: + target = splitext(method)[0] + res = env.NumpyFromFTemplate(target, pjoin('iterative', method)) + sources.append(res[0]) + +env.NumpyPythonExtension('_iterative', source = sources) Copied: branches/build_with_scons/scipy/sparse/linalg/isolve/setupscons.py (from rev 3979, branches/build_with_scons/scipy/sparse/linalg/isolve/setup.py) =================================================================== --- branches/build_with_scons/scipy/sparse/linalg/isolve/setup.py 2008-03-05 08:14:54 UTC (rev 3979) +++ branches/build_with_scons/scipy/sparse/linalg/isolve/setupscons.py 2008-03-05 10:06:57 UTC (rev 3986) @@ -0,0 +1,16 @@ +#!/usr/bin/env python + +def configuration(parent_package='',top_path=None): + from numpy.distutils.misc_util import Configuration + + config = Configuration('isolve',parent_package,top_path) + + config.add_sconscript('SConstruct') + config.add_data_dir('tests') + + return config + +if __name__ == '__main__': + from numpy.distutils.core import setup + + setup(**configuration(top_path='').todict()) From scipy-svn at scipy.org Wed Mar 5 07:22:45 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Wed, 5 Mar 2008 06:22:45 -0600 (CST) Subject: [Scipy-svn] r3987 - in branches/build_with_scons/scipy/sparse/linalg: . dsolve Message-ID: <20080305122245.CC03B39C2D2@new.scipy.org> Author: cdavid Date: 2008-03-05 06:22:33 -0600 (Wed, 05 Mar 2008) New Revision: 3987 Added: branches/build_with_scons/scipy/sparse/linalg/setupscons.py Modified: branches/build_with_scons/scipy/sparse/linalg/dsolve/SConstruct Log: sparse.linalg now builds with numscons. Modified: branches/build_with_scons/scipy/sparse/linalg/dsolve/SConstruct =================================================================== --- branches/build_with_scons/scipy/sparse/linalg/dsolve/SConstruct 2008-03-05 10:06:57 UTC (rev 3986) +++ branches/build_with_scons/scipy/sparse/linalg/dsolve/SConstruct 2008-03-05 12:22:33 UTC (rev 3987) @@ -32,12 +32,12 @@ superlu_def['USE_VENDOR_BLAS'] = 2 superlu_env.Append(CPPDEFINES = superlu_def) -superlu_src = [str(s) for s in superlu_env.Glob(pjoin('SuperLU', 'SRC', '*.c'))] +superlu_src = superlu_env.Glob(pjoin('SuperLU', 'SRC', '*.c')) superlu = superlu_env.NumpyStaticExtLibrary('superlu_src', source = superlu_src) # Build python extensions pyenv = env.Copy() -pyenv.Append(CPPPATH = get_numpy_include_dirs()) +pyenv.Append(CPPPATH = [get_numpy_include_dirs(), env['src_dir']]) common_src = ['_superlu_utils.c', '_superluobject.c'] for prec in ['z', 'd', 'c', 's']: Copied: branches/build_with_scons/scipy/sparse/linalg/setupscons.py (from rev 3979, branches/build_with_scons/scipy/sparse/linalg/setup.py) =================================================================== --- branches/build_with_scons/scipy/sparse/linalg/setup.py 2008-03-05 08:14:54 UTC (rev 3979) +++ branches/build_with_scons/scipy/sparse/linalg/setupscons.py 2008-03-05 12:22:33 UTC (rev 3987) @@ -0,0 +1,19 @@ +#!/usr/bin/env python + +def configuration(parent_package='',top_path=None): + from numpy.distutils.misc_util import Configuration + + config = Configuration('linalg',parent_package,top_path, + setup_name = 'setupscons.py') + + config.add_subpackage(('isolve')) + config.add_subpackage(('dsolve')) + config.add_subpackage(('eigen')) + + config.add_data_dir('tests') + + return config + +if __name__ == '__main__': + from numpy.distutils.core import setup + setup(**configuration(top_path='').todict()) From scipy-svn at scipy.org Wed Mar 5 07:30:19 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Wed, 5 Mar 2008 06:30:19 -0600 (CST) Subject: [Scipy-svn] r3988 - branches/build_with_scons/scipy/sparse Message-ID: <20080305123019.AFD4739C048@new.scipy.org> Author: cdavid Date: 2008-03-05 06:30:12 -0600 (Wed, 05 Mar 2008) New Revision: 3988 Added: branches/build_with_scons/scipy/sparse/SConstruct branches/build_with_scons/scipy/sparse/setupscons.py Log: sparse now builds with numscons... Added: branches/build_with_scons/scipy/sparse/SConstruct =================================================================== --- branches/build_with_scons/scipy/sparse/SConstruct 2008-03-05 12:22:33 UTC (rev 3987) +++ branches/build_with_scons/scipy/sparse/SConstruct 2008-03-05 12:30:12 UTC (rev 3988) @@ -0,0 +1,18 @@ +# Last Change: Wed Mar 05 09:00 PM 2008 J +# vim:syntax=python +from os.path import join + +from numpy.distutils.misc_util import get_numpy_include_dirs +from numscons import GetNumpyEnvironment + +env = GetNumpyEnvironment(ARGUMENTS) + +env.AppendUnique(CPPPATH = get_numpy_include_dirs()) + +env.NumpyPythonExtension('_sparsetools', + source = [join('sparsetools', 'sparsetools_wrap.cxx')]) + +# Copy this python file into the distutils lib dir +env.Command(join(env['distutils_installdir'], 'sparsetools.py'), + join(env['src_dir'], 'sparsetools', 'sparsetools.py'), + Copy('$TARGET', '$SOURCE')) Copied: branches/build_with_scons/scipy/sparse/setupscons.py (from rev 3979, branches/build_with_scons/scipy/sparse/setup.py) =================================================================== --- branches/build_with_scons/scipy/sparse/setup.py 2008-03-05 08:14:54 UTC (rev 3979) +++ branches/build_with_scons/scipy/sparse/setupscons.py 2008-03-05 12:30:12 UTC (rev 3988) @@ -0,0 +1,21 @@ +#!/usr/bin/env python + +from os.path import join +import sys + +def configuration(parent_package='',top_path=None): + import numpy + from numpy.distutils.misc_util import Configuration + + config = Configuration('sparse',parent_package,top_path, + setup_name = 'setupscons.py') + + config.add_data_dir('tests') + config.add_sconscript('SConstruct') + config.add_subpackage('linalg') + + return config + +if __name__ == '__main__': + from numpy.distutils.core import setup + setup(**configuration(top_path='').todict()) From scipy-svn at scipy.org Wed Mar 5 07:33:21 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Wed, 5 Mar 2008 06:33:21 -0600 (CST) Subject: [Scipy-svn] r3989 - in branches/build_with_scons/scipy: fftpack integrate interpolate optimize sparse/linalg/dsolve sparse/linalg/eigen/arpack Message-ID: <20080305123321.97A5C39C048@new.scipy.org> Author: cdavid Date: 2008-03-05 06:33:10 -0600 (Wed, 05 Mar 2008) New Revision: 3989 Modified: branches/build_with_scons/scipy/fftpack/SConstruct branches/build_with_scons/scipy/integrate/SConstruct branches/build_with_scons/scipy/interpolate/SConstruct branches/build_with_scons/scipy/optimize/SConstruct branches/build_with_scons/scipy/sparse/linalg/dsolve/SConstruct branches/build_with_scons/scipy/sparse/linalg/eigen/arpack/SConstruct Log: Replace all Glob calls by NumpyGlob to take into account build directories and src directories. Modified: branches/build_with_scons/scipy/fftpack/SConstruct =================================================================== --- branches/build_with_scons/scipy/fftpack/SConstruct 2008-03-05 12:30:12 UTC (rev 3988) +++ branches/build_with_scons/scipy/fftpack/SConstruct 2008-03-05 12:33:10 UTC (rev 3989) @@ -29,7 +29,7 @@ pass # Build dfftpack -src = env.Glob(pjoin('dfftpack', '*.f')) +src = env.NumpyGlob(pjoin('dfftpack', '*.f')) dfftpack = env.NumpyStaticExtLibrary('dfftpack', source = [str(s) for s in src]) env.AppendUnique(LIBS = ['dfftpack']) env.AppendUnique(LIBPATH = env['build_dir']) Modified: branches/build_with_scons/scipy/integrate/SConstruct =================================================================== --- branches/build_with_scons/scipy/integrate/SConstruct 2008-03-05 12:30:12 UTC (rev 3988) +++ branches/build_with_scons/scipy/integrate/SConstruct 2008-03-05 12:33:10 UTC (rev 3989) @@ -25,20 +25,20 @@ # XXX: lapack integration # Build linpack_lite -src = [str(s) for s in env.Glob(pjoin('linpack_lite', '*.f'))] +src = [str(s) for s in env.NumpyGlob(pjoin('linpack_lite', '*.f'))] linpack_lite = env.NumpyStaticExtLibrary('linpack_lite', source = src) # Build mach # XXX: do not use optimization flags for mach -src = [str(s) for s in env.Glob(pjoin('mach', '*.f'))] +src = [str(s) for s in env.NumpyGlob(pjoin('mach', '*.f'))] mach = env.NumpyStaticExtLibrary('mach', source = src) # Build quadpack -src = [str(s) for s in env.Glob(pjoin('quadpack', '*.f'))] +src = [str(s) for s in env.NumpyGlob(pjoin('quadpack', '*.f'))] quadpack = env.NumpyStaticExtLibrary('quadpack', source = src) # Build odepack -src = [str(s) for s in env.Glob(pjoin('odepack', '*.f'))] +src = [str(s) for s in env.NumpyGlob(pjoin('odepack', '*.f'))] odepack = env.NumpyStaticExtLibrary('odepack', source = src) #env.AppendUnique(LIBS = ['linpack_lite', 'quadpack', 'odepack', 'mach']) Modified: branches/build_with_scons/scipy/interpolate/SConstruct =================================================================== --- branches/build_with_scons/scipy/interpolate/SConstruct 2008-03-05 12:30:12 UTC (rev 3988) +++ branches/build_with_scons/scipy/interpolate/SConstruct 2008-03-05 12:33:10 UTC (rev 3989) @@ -17,7 +17,7 @@ env.AppendUnique(LINKFLAGS = env['F77_LDFLAGS']) # Build fitpack -src = [str(s) for s in env.Glob(pjoin('fitpack', '*.f'))] +src = [str(s) for s in env.NumpyGlob(pjoin('fitpack', '*.f'))] fitpack = env.NumpyStaticExtLibrary('fitpack', source = src) env.AppendUnique(LIBS = ['fitpack']) Modified: branches/build_with_scons/scipy/optimize/SConstruct =================================================================== --- branches/build_with_scons/scipy/optimize/SConstruct 2008-03-05 12:30:12 UTC (rev 3988) +++ branches/build_with_scons/scipy/optimize/SConstruct 2008-03-05 12:33:10 UTC (rev 3989) @@ -47,11 +47,11 @@ #========== # minpack lib -minpack_src = [str(s) for s in env.Glob(pjoin('minpack', '*.f'))] +minpack_src = [str(s) for s in env.NumpyGlob(pjoin('minpack', '*.f'))] env.NumpyStaticExtLibrary('minpack', source = minpack_src) # rootfind lib -rootfind_src = [str(s) for s in env.Glob(pjoin('Zeros', '*.c'))] +rootfind_src = [str(s) for s in env.NumpyGlob(pjoin('Zeros', '*.c'))] env.NumpyStaticExtLibrary('rootfind', source = rootfind_src) env.AppendUnique(LIBS = ['minpack', 'rootfind']) Modified: branches/build_with_scons/scipy/sparse/linalg/dsolve/SConstruct =================================================================== --- branches/build_with_scons/scipy/sparse/linalg/dsolve/SConstruct 2008-03-05 12:30:12 UTC (rev 3988) +++ branches/build_with_scons/scipy/sparse/linalg/dsolve/SConstruct 2008-03-05 12:33:10 UTC (rev 3989) @@ -32,7 +32,7 @@ superlu_def['USE_VENDOR_BLAS'] = 2 superlu_env.Append(CPPDEFINES = superlu_def) -superlu_src = superlu_env.Glob(pjoin('SuperLU', 'SRC', '*.c')) +superlu_src = superlu_env.NumpyGlob(pjoin('SuperLU', 'SRC', '*.c')) superlu = superlu_env.NumpyStaticExtLibrary('superlu_src', source = superlu_src) # Build python extensions Modified: branches/build_with_scons/scipy/sparse/linalg/eigen/arpack/SConstruct =================================================================== --- branches/build_with_scons/scipy/sparse/linalg/eigen/arpack/SConstruct 2008-03-05 12:30:12 UTC (rev 3988) +++ branches/build_with_scons/scipy/sparse/linalg/eigen/arpack/SConstruct 2008-03-05 12:33:10 UTC (rev 3989) @@ -25,9 +25,9 @@ write_info(env) # Build arpack -arpack_src = env.Glob(pjoin('ARPACK', 'SRC', '*.f')) -arpack_src += env.Glob(pjoin('ARPACK', 'UTIL', '*.f')) -arpack_src += env.Glob(pjoin('ARPACK', 'LAPACK', '*.f')) +arpack_src = env.NumpyGlob(pjoin('ARPACK', 'SRC', '*.f')) +arpack_src += env.NumpyGlob(pjoin('ARPACK', 'UTIL', '*.f')) +arpack_src += env.NumpyGlob(pjoin('ARPACK', 'LAPACK', '*.f')) src = [str(s) for s in arpack_src] From scipy-svn at scipy.org Wed Mar 5 07:39:44 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Wed, 5 Mar 2008 06:39:44 -0600 (CST) Subject: [Scipy-svn] r3990 - branches/build_with_scons/scipy/special Message-ID: <20080305123944.BA1D539C048@new.scipy.org> Author: cdavid Date: 2008-03-05 06:39:32 -0600 (Wed, 05 Mar 2008) New Revision: 3990 Added: branches/build_with_scons/scipy/special/SConstruct branches/build_with_scons/scipy/special/setupscons.py Log: special now builds with numscons. Added: branches/build_with_scons/scipy/special/SConstruct =================================================================== --- branches/build_with_scons/scipy/special/SConstruct 2008-03-05 12:33:10 UTC (rev 3989) +++ branches/build_with_scons/scipy/special/SConstruct 2008-03-05 12:39:32 UTC (rev 3990) @@ -0,0 +1,61 @@ +# Last Change: Wed Mar 05 09:00 PM 2008 J +# vim:syntax=python +from os.path import join as pjoin, basename as pbasename +import sys + +from distutils.sysconfig import get_python_inc + +from numpy.distutils.misc_util import get_numpy_include_dirs +from numscons import GetNumpyEnvironment +from numscons import CheckF77Clib + +env = GetNumpyEnvironment(ARGUMENTS) + +env.AppendUnique(CPPPATH = [get_python_inc(), get_numpy_include_dirs()]) +env.AppendUnique(CPPPATH = env['F2PYINCLUDEDIR']) + +if sys.platform=='win32': +# define_macros.append(('NOINFINITIES',None)) +# define_macros.append(('NONANS',None)) + env.AppendUnique(CPPDEFINES = '_USE_MATH_DEFINES') + +config = env.NumpyConfigure(custom_tests = {'CheckF77Clib' : CheckF77Clib}) +if not config.CheckF77Clib(): + raise RuntimeError("Could not get C/F77 runtime information") +config.Finish() + +def build_lib(name, ext, libname = None): + """ext should be .f or .c""" + if not libname: + libname = name + src = env.NumpyGlob(pjoin(name, '*%s' % ext)) + env.NumpyStaticExtLibrary(libname, source = src) + +# C libraries +build_lib('c_misc', '.c') +build_lib('cephes', '.c') + +# F libraries +# XXX: handle no opt flags for mach +build_lib('mach', '.f') +build_lib('toms', '.f') +build_lib('amos', '.f') +build_lib('cdflib', '.f', 'cdf') +build_lib('specfun', '.f') + +env.AppendUnique(LIBPATH = env['build_dir']) + +# Cephes extension +src = ['_cephesmodule.c', 'amos_wrappers.c', 'specfun_wrappers.c', \ + 'toms_wrappers.c','cdf_wrappers.c','ufunc_extras.c'] + +env.NumpyPythonExtension('_cephes', + source = src, + LIBS = ['amos', 'toms', 'c_misc', 'cephes', 'mach',\ + 'cdf', 'specfun'], + LINKFLAGSEND = env['F77_LDFLAGS']) + +# Specfun extension +env.NumpyPythonExtension('specfun', source = 'specfun.pyf', LIBS = 'specfun', \ + F2PYOPTIONS = ["--no-wrap-functions"], + LINKFLAGSEND = env['F77_LDFLAGS']) Copied: branches/build_with_scons/scipy/special/setupscons.py (from rev 3979, branches/build_with_scons/scipy/special/setup.py) =================================================================== --- branches/build_with_scons/scipy/special/setup.py 2008-03-05 08:14:54 UTC (rev 3979) +++ branches/build_with_scons/scipy/special/setupscons.py 2008-03-05 12:39:32 UTC (rev 3990) @@ -0,0 +1,19 @@ +#!/usr/bin/env python + +import os +import sys +from os.path import join +from distutils.sysconfig import get_python_inc + +def configuration(parent_package='',top_path=None): + from numpy.distutils.misc_util import Configuration + config = Configuration('special', parent_package, top_path) + + config.add_sconscript('SConstruct') + config.add_data_dir('tests') + + return config + +if __name__ == '__main__': + from numpy.distutils.core import setup + setup(**configuration(top_path='').todict()) From scipy-svn at scipy.org Wed Mar 5 07:48:20 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Wed, 5 Mar 2008 06:48:20 -0600 (CST) Subject: [Scipy-svn] r3991 - in branches/build_with_scons/scipy: . stats stats/models Message-ID: <20080305124820.A843E39C3F8@new.scipy.org> Author: cdavid Date: 2008-03-05 06:48:09 -0600 (Wed, 05 Mar 2008) New Revision: 3991 Added: branches/build_with_scons/scipy/stats/SConstruct branches/build_with_scons/scipy/stats/models/setupscons.py branches/build_with_scons/scipy/stats/setupscons.py Modified: branches/build_with_scons/scipy/setupscons.py Log: stats now builds with numscons. Modified: branches/build_with_scons/scipy/setupscons.py =================================================================== --- branches/build_with_scons/scipy/setupscons.py 2008-03-05 12:39:32 UTC (rev 3990) +++ branches/build_with_scons/scipy/setupscons.py 2008-03-05 12:48:09 UTC (rev 3991) @@ -16,10 +16,10 @@ config.add_subpackage('optimize') config.add_subpackage('sandbox') config.add_subpackage('signal') - #config.add_subpackage('sparse') - #config.add_subpackage('special') - #config.add_subpackage('splinalg') - #config.add_subpackage('stats') + config.add_subpackage('sparse') + config.add_subpackage('special') + config.add_subpackage('splinalg') + config.add_subpackage('stats') #config.add_subpackage('ndimage') #config.add_subpackage('stsci') #config.add_subpackage('weave') Added: branches/build_with_scons/scipy/stats/SConstruct =================================================================== --- branches/build_with_scons/scipy/stats/SConstruct 2008-03-05 12:39:32 UTC (rev 3990) +++ branches/build_with_scons/scipy/stats/SConstruct 2008-03-05 12:48:09 UTC (rev 3991) @@ -0,0 +1,38 @@ +# Last Change: Wed Mar 05 09:00 PM 2008 J +# vim:syntax=python +from os.path import join as pjoin + +from numpy.distutils.misc_util import get_numpy_include_dirs +from numscons import GetNumpyEnvironment, CheckF77Clib + +env = GetNumpyEnvironment(ARGUMENTS) + +env.AppendUnique(CPPPATH = [get_numpy_include_dirs()]) +env.AppendUnique(CPPPATH = env['F2PYINCLUDEDIR']) + +config = env.NumpyConfigure(custom_tests = {'CheckF77Clib' : CheckF77Clib}) +if not config.CheckF77Clib(): + raise RuntimeError("Could not get C/F77 runtime information") +config.Finish() + +# Statlib library +src = env.NumpyGlob(pjoin('statlib', '*.f' )) +env.NumpyStaticExtLibrary('statlib', source = src) + +env.AppendUnique(LIBPATH = env['build_dir']) + +# Statlib extension +env.NumpyPythonExtension('statlib', source = 'statlib.pyf', + F2PYOPTIONS = ["--no-wrap-functions"], + LIBS = 'statlib', + LINKFLAGSEND = env['F77_LDFLAGS']) + +# futil extension +futil_src = env.F2py(pjoin(env['build_dir'], 'futilmodule.c'), + pjoin(env['build_dir'], 'futil.f')) +env.NumpyPythonExtension('futil', source = futil_src + ['futil.f'], + LINKFLAGSEND = env['F77_LDFLAGS']) + +# mvn extension +env.NumpyPythonExtension('mvn', source = ['mvn.pyf', 'mvndst.f'], + LINKFLAGSEND = env['F77_LDFLAGS']) Copied: branches/build_with_scons/scipy/stats/models/setupscons.py (from rev 3979, branches/build_with_scons/scipy/stats/models/setup.py) Copied: branches/build_with_scons/scipy/stats/setupscons.py (from rev 3979, branches/build_with_scons/scipy/stats/setup.py) =================================================================== --- branches/build_with_scons/scipy/stats/setup.py 2008-03-05 08:14:54 UTC (rev 3979) +++ branches/build_with_scons/scipy/stats/setupscons.py 2008-03-05 12:48:09 UTC (rev 3991) @@ -0,0 +1,17 @@ +#!/usr/bin/env python + +from os.path import join + +def configuration(parent_package='',top_path=None): + from numpy.distutils.misc_util import Configuration + config = Configuration('stats', parent_package, top_path) + + config.add_sconscript('SConstruct') + config.add_subpackage('models') + config.add_data_dir('tests') + + return config + +if __name__ == '__main__': + from numpy.distutils.core import setup + setup(**configuration(top_path='').todict()) From scipy-svn at scipy.org Wed Mar 5 07:53:53 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Wed, 5 Mar 2008 06:53:53 -0600 (CST) Subject: [Scipy-svn] r3992 - branches/build_with_scons/scipy/stsci/convolve Message-ID: <20080305125353.2E81239C3DE@new.scipy.org> Author: cdavid Date: 2008-03-05 06:53:46 -0600 (Wed, 05 Mar 2008) New Revision: 3992 Added: branches/build_with_scons/scipy/stsci/convolve/SConstruct branches/build_with_scons/scipy/stsci/convolve/setupscons.py Log: stsci.convolve now builds with numscons. Added: branches/build_with_scons/scipy/stsci/convolve/SConstruct =================================================================== --- branches/build_with_scons/scipy/stsci/convolve/SConstruct 2008-03-05 12:48:09 UTC (rev 3991) +++ branches/build_with_scons/scipy/stsci/convolve/SConstruct 2008-03-05 12:53:46 UTC (rev 3992) @@ -0,0 +1,13 @@ +# Last Change: Wed Mar 05 09:00 PM 2008 J +from numpy.distutils.misc_util import get_numpy_include_dirs +from numpy import get_numarray_include +from numscons import GetNumpyEnvironment + +env = GetNumpyEnvironment(ARGUMENTS) + +env.AppendUnique(CPPPATH = [get_numpy_include_dirs(), get_numarray_include()]) +env.AppendUnique(CPPDEFINES = {'NUMPY': '1'}) + +# _correlate extension +env.NumpyPythonExtension('_correlate', source = 'src/_correlatemodule.c') +env.NumpyPythonExtension('_lineshape', source = 'src/_lineshapemodule.c') Copied: branches/build_with_scons/scipy/stsci/convolve/setupscons.py (from rev 3979, branches/build_with_scons/scipy/stsci/convolve/setup.py) =================================================================== --- branches/build_with_scons/scipy/stsci/convolve/setup.py 2008-03-05 08:14:54 UTC (rev 3979) +++ branches/build_with_scons/scipy/stsci/convolve/setupscons.py 2008-03-05 12:53:46 UTC (rev 3992) @@ -0,0 +1,20 @@ +#!/usr/bin/env python +import numpy + +def configuration(parent_package='',top_path=None): + from numpy.distutils.misc_util import Configuration + config = Configuration('convolve',parent_package,top_path, + package_path='lib') + + config.add_sconscript('SConstruct') + + return config + +if __name__ == "__main__": + from numpy.distutils.core import setup + config = configuration(top_path='').todict() + setup(author='Todd Miller', + author_email = 'help at stsci.edu', + description = 'image array convolution functions', + version = '2.0', + **config) From scipy-svn at scipy.org Wed Mar 5 07:56:19 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Wed, 5 Mar 2008 06:56:19 -0600 (CST) Subject: [Scipy-svn] r3993 - branches/build_with_scons/scipy/stsci/image Message-ID: <20080305125619.AFF0839C39E@new.scipy.org> Author: cdavid Date: 2008-03-05 06:55:50 -0600 (Wed, 05 Mar 2008) New Revision: 3993 Added: branches/build_with_scons/scipy/stsci/image/SConstruct branches/build_with_scons/scipy/stsci/image/setupscons.py Log: stsci.image now builds with numscons. Added: branches/build_with_scons/scipy/stsci/image/SConstruct =================================================================== --- branches/build_with_scons/scipy/stsci/image/SConstruct 2008-03-05 12:53:46 UTC (rev 3992) +++ branches/build_with_scons/scipy/stsci/image/SConstruct 2008-03-05 12:55:50 UTC (rev 3993) @@ -0,0 +1,11 @@ +# Last Change: Wed Mar 05 09:00 PM 2008 J +from numpy.distutils.misc_util import get_numpy_include_dirs +from numpy import get_numarray_include +from numscons import GetNumpyEnvironment + +env = GetNumpyEnvironment(ARGUMENTS) + +env.AppendUnique(CPPPATH = [get_numpy_include_dirs(), get_numarray_include()]) +env.AppendUnique(CPPDEFINES = {'NUMPY': '1'}) + +env.NumpyPythonExtension('_combine', source = 'src/_combinemodule.c') Copied: branches/build_with_scons/scipy/stsci/image/setupscons.py (from rev 3979, branches/build_with_scons/scipy/stsci/image/setup.py) =================================================================== --- branches/build_with_scons/scipy/stsci/image/setup.py 2008-03-05 08:14:54 UTC (rev 3979) +++ branches/build_with_scons/scipy/stsci/image/setupscons.py 2008-03-05 12:55:50 UTC (rev 3993) @@ -0,0 +1,18 @@ +#!/usr/bin/env python +def configuration(parent_package='',top_path=None): + from numpy.distutils.misc_util import Configuration + config = Configuration('image',parent_package,top_path, + package_path='lib') + + config.add_sconscript('SConstruct') + + return config + +if __name__ == "__main__": + from numpy.distutils.core import setup + config = configuration(top_path='').todict() + setup(author='Todd Miller', + author_email = 'help at stsci.edu', + description = 'image array manipulation functions', + version = '2.0', + **config) From scipy-svn at scipy.org Wed Mar 5 07:58:15 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Wed, 5 Mar 2008 06:58:15 -0600 (CST) Subject: [Scipy-svn] r3994 - in branches/build_with_scons/scipy: . stsci Message-ID: <20080305125815.DFD9239C39E@new.scipy.org> Author: cdavid Date: 2008-03-05 06:58:07 -0600 (Wed, 05 Mar 2008) New Revision: 3994 Added: branches/build_with_scons/scipy/stsci/setupscons.py Modified: branches/build_with_scons/scipy/setupscons.py Log: stsci now builds with numscons. Modified: branches/build_with_scons/scipy/setupscons.py =================================================================== --- branches/build_with_scons/scipy/setupscons.py 2008-03-05 12:55:50 UTC (rev 3993) +++ branches/build_with_scons/scipy/setupscons.py 2008-03-05 12:58:07 UTC (rev 3994) @@ -21,7 +21,7 @@ config.add_subpackage('splinalg') config.add_subpackage('stats') #config.add_subpackage('ndimage') - #config.add_subpackage('stsci') + config.add_subpackage('stsci') #config.add_subpackage('weave') #config.add_subpackage('testing') config.make_svn_version_py() # installs __svn_version__.py Copied: branches/build_with_scons/scipy/stsci/setupscons.py (from rev 3979, branches/build_with_scons/scipy/stsci/setup.py) =================================================================== --- branches/build_with_scons/scipy/stsci/setup.py 2008-03-05 08:14:54 UTC (rev 3979) +++ branches/build_with_scons/scipy/stsci/setupscons.py 2008-03-05 12:58:07 UTC (rev 3994) @@ -0,0 +1,11 @@ + +def configuration(parent_package='',top_path=None): + from numpy.distutils.misc_util import Configuration + config = Configuration('stsci',parent_package,top_path, setup_name = 'setupscons.py') + config.add_subpackage('convolve') + config.add_subpackage('image') + return config + +if __name__ == '__main__': + from numpy.distutils.core import setup + setup(**configuration(top_path='').todict()) From scipy-svn at scipy.org Wed Mar 5 08:03:21 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Wed, 5 Mar 2008 07:03:21 -0600 (CST) Subject: [Scipy-svn] r3995 - in branches/build_with_scons/scipy: . ndimage Message-ID: <20080305130321.7F29D39C07F@new.scipy.org> Author: cdavid Date: 2008-03-05 07:03:09 -0600 (Wed, 05 Mar 2008) New Revision: 3995 Added: branches/build_with_scons/scipy/ndimage/SConstruct branches/build_with_scons/scipy/ndimage/setupscons.py Modified: branches/build_with_scons/scipy/setupscons.py Log: ndimage now builds with numscons. Added: branches/build_with_scons/scipy/ndimage/SConstruct =================================================================== --- branches/build_with_scons/scipy/ndimage/SConstruct 2008-03-05 12:58:07 UTC (rev 3994) +++ branches/build_with_scons/scipy/ndimage/SConstruct 2008-03-05 13:03:09 UTC (rev 3995) @@ -0,0 +1,22 @@ +# Last Change: Wed Mar 05 09:00 PM 2008 J +from os.path import join + +from numpy.distutils.misc_util import get_numpy_include_dirs +from numscons import GetNumpyEnvironment + +env = GetNumpyEnvironment(ARGUMENTS) + +env.AppendUnique(CPPPATH = get_numpy_include_dirs()) +env.AppendUnique(CPPPATH = 'src') + +ndimage_src = ["nd_image.c", "ni_filters.c", "ni_fourier.c", "ni_interpolation.c", + "ni_measure.c", "ni_morphology.c", "ni_support.c"] +env.NumpyPythonExtension('_nd_image', source = [join('src', i) for i in ndimage_src]) + +segment_src = ['Segmenter_EXT.c', 'Segmenter_IMPL.c'] +env.NumpyPythonExtension('_segment', source = [join('src', 'segment', i) + for i in segment_src]) + +register_src = ['Register_EXT.c', 'Register_IMPL.c'] +env.NumpyPythonExtension('_register', source = [join('src', 'register', i) + for i in register_src]) Copied: branches/build_with_scons/scipy/ndimage/setupscons.py (from rev 3979, branches/build_with_scons/scipy/ndimage/setup.py) =================================================================== --- branches/build_with_scons/scipy/ndimage/setup.py 2008-03-05 08:14:54 UTC (rev 3979) +++ branches/build_with_scons/scipy/ndimage/setupscons.py 2008-03-05 13:03:09 UTC (rev 3995) @@ -0,0 +1,15 @@ +from numpy.distutils.core import setup +from numpy.distutils.misc_util import Configuration +from numpy import get_include + +def configuration(parent_package='', top_path=None): + + config = Configuration('ndimage', parent_package, top_path) + + config.add_sconscript("SConstruct") + config.add_data_dir('tests') + + return config + +if __name__ == '__main__': + setup(**configuration(top_path='').todict()) Modified: branches/build_with_scons/scipy/setupscons.py =================================================================== --- branches/build_with_scons/scipy/setupscons.py 2008-03-05 12:58:07 UTC (rev 3994) +++ branches/build_with_scons/scipy/setupscons.py 2008-03-05 13:03:09 UTC (rev 3995) @@ -20,7 +20,7 @@ config.add_subpackage('special') config.add_subpackage('splinalg') config.add_subpackage('stats') - #config.add_subpackage('ndimage') + config.add_subpackage('ndimage') config.add_subpackage('stsci') #config.add_subpackage('weave') #config.add_subpackage('testing') From scipy-svn at scipy.org Wed Mar 5 08:04:24 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Wed, 5 Mar 2008 07:04:24 -0600 (CST) Subject: [Scipy-svn] r3996 - in branches/build_with_scons/scipy: . testing weave Message-ID: <20080305130424.E705D39C07F@new.scipy.org> Author: cdavid Date: 2008-03-05 07:04:15 -0600 (Wed, 05 Mar 2008) New Revision: 3996 Added: branches/build_with_scons/scipy/testing/setupscons.py branches/build_with_scons/scipy/weave/setupscons.py Modified: branches/build_with_scons/scipy/setupscons.py Log: All scipy builds with numscons, yeah. Modified: branches/build_with_scons/scipy/setupscons.py =================================================================== --- branches/build_with_scons/scipy/setupscons.py 2008-03-05 13:03:09 UTC (rev 3995) +++ branches/build_with_scons/scipy/setupscons.py 2008-03-05 13:04:15 UTC (rev 3996) @@ -22,8 +22,8 @@ config.add_subpackage('stats') config.add_subpackage('ndimage') config.add_subpackage('stsci') - #config.add_subpackage('weave') - #config.add_subpackage('testing') + config.add_subpackage('weave') + config.add_subpackage('testing') config.make_svn_version_py() # installs __svn_version__.py config.scons_make_config_py() # installs __config__.py return config Copied: branches/build_with_scons/scipy/testing/setupscons.py (from rev 3979, branches/build_with_scons/scipy/testing/setup.py) Copied: branches/build_with_scons/scipy/weave/setupscons.py (from rev 3979, branches/build_with_scons/scipy/weave/setup.py) From scipy-svn at scipy.org Wed Mar 5 09:07:56 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Wed, 5 Mar 2008 08:07:56 -0600 (CST) Subject: [Scipy-svn] r3997 - branches/build_with_scons/scipy/sparse/linalg/eigen/arpack Message-ID: <20080305140756.A8D9839C406@new.scipy.org> Author: cdavid Date: 2008-03-05 08:07:46 -0600 (Wed, 05 Mar 2008) New Revision: 3997 Modified: branches/build_with_scons/scipy/sparse/linalg/eigen/arpack/SConstruct Log: Fix sources for arpack module, generated by f2py. Modified: branches/build_with_scons/scipy/sparse/linalg/eigen/arpack/SConstruct =================================================================== --- branches/build_with_scons/scipy/sparse/linalg/eigen/arpack/SConstruct 2008-03-05 13:04:15 UTC (rev 3996) +++ branches/build_with_scons/scipy/sparse/linalg/eigen/arpack/SConstruct 2008-03-05 14:07:46 UTC (rev 3997) @@ -41,4 +41,4 @@ env.NumpyFromFTemplate('arpack.pyf', 'arpack.pyf.src') wsrc = env.F2py(pjoin(env['build_dir'], '_arpackmodule.c'), pjoin(env['build_dir'], 'arpack.pyf')) -env.NumpyPythonExtension('_arpack', source = '_arpackmodule.c', LIBS = arpack_lib) +env.NumpyPythonExtension('_arpack', source = wsrc, LIBS = arpack_lib) From scipy-svn at scipy.org Wed Mar 5 09:38:41 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Wed, 5 Mar 2008 08:38:41 -0600 (CST) Subject: [Scipy-svn] r3998 - branches/build_with_scons/scipy/optimize Message-ID: <20080305143841.A35D839C3DA@new.scipy.org> Author: cdavid Date: 2008-03-05 08:38:29 -0600 (Wed, 05 Mar 2008) New Revision: 3998 Modified: branches/build_with_scons/scipy/optimize/SConstruct Log: Add slsqp extension to scipy.optimize. Modified: branches/build_with_scons/scipy/optimize/SConstruct =================================================================== --- branches/build_with_scons/scipy/optimize/SConstruct 2008-03-05 14:07:46 UTC (rev 3997) +++ branches/build_with_scons/scipy/optimize/SConstruct 2008-03-05 14:38:29 UTC (rev 3998) @@ -1,4 +1,4 @@ -# Last Change: Wed Mar 05 05:00 PM 2008 J +# Last Change: Wed Mar 05 11:00 PM 2008 J # vim:syntax=python import os @@ -89,3 +89,11 @@ env.NumpyPythonExtension('moduleTNC', source = [pjoin('tnc', i) for i in \ ['moduleTNC.c', 'tnc.c']]) + +# _slsqp pyextension +src = pjoin('slsqp', 'slsqp_optmz.f') +slsqp_src = env.F2py(pjoin(env['build_dir'], '_slsqpmodule.c'), + pjoin(env['build_dir'], 'slsqp', 'slsqp.pyf')) +env.NumpyPythonExtension('_slsqp', source = [src] + slsqp_src, + LINKFLAGSEND = env['F77_LDFLAGS']) + From scipy-svn at scipy.org Thu Mar 6 19:34:16 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Thu, 6 Mar 2008 18:34:16 -0600 (CST) Subject: [Scipy-svn] r3999 - trunk/scipy/sparse Message-ID: <20080307003416.372BC39C0B0@new.scipy.org> Author: wnbell Date: 2008-03-06 18:33:56 -0600 (Thu, 06 Mar 2008) New Revision: 3999 Modified: trunk/scipy/sparse/bsr.py trunk/scipy/sparse/construct.py trunk/scipy/sparse/coo.py trunk/scipy/sparse/csc.py trunk/scipy/sparse/csr.py trunk/scipy/sparse/dia.py trunk/scipy/sparse/dok.py trunk/scipy/sparse/info.py trunk/scipy/sparse/lil.py trunk/scipy/sparse/sputils.py Log: updated sparse docstrings Modified: trunk/scipy/sparse/bsr.py =================================================================== --- trunk/scipy/sparse/bsr.py 2008-03-05 14:38:29 UTC (rev 3998) +++ trunk/scipy/sparse/bsr.py 2008-03-07 00:33:56 UTC (rev 3999) @@ -1,5 +1,7 @@ """Compressed Block Sparse Row matrix format""" +__docformat__ = "restructuredtext en" + __all__ = ['bsr_matrix', 'isspmatrix_bsr'] from warnings import warn @@ -20,46 +22,49 @@ """Block Sparse Row matrix This can be instantiated in several ways: - - bsr_matrix(D, [blocksize=(R,C)]) - - with a dense matrix or rank-2 ndarray D + bsr_matrix(D, [blocksize=(R,C)]) + with a dense matrix or rank-2 ndarray D - - bsr_matrix(S, [blocksize=(R,C)]) - - with another sparse matrix S (equivalent to S.tobsr()) + bsr_matrix(S, [blocksize=(R,C)]) + with another sparse matrix S (equivalent to S.tobsr()) - - bsr_matrix((M, N), [blocksize=(R,C), dtype]) - - to construct an empty matrix with shape (M, N) - - dtype is optional, defaulting to dtype='d'. + bsr_matrix((M, N), [blocksize=(R,C), dtype]) + to construct an empty matrix with shape (M, N) + dtype is optional, defaulting to dtype='d'. - - bsr_matrix((data, ij), [blocksize=(R,C), shape=(M, N)]) - - where data, ij satisfy: - - a[ij[0, k], ij[1, k]] = data[k] + bsr_matrix((data, ij), [blocksize=(R,C), shape=(M, N)]) + where ``data`` and ``ij`` satisfy ``a[ij[0, k], ij[1, k]] = data[k]`` - - bsr_matrix((data, indices, indptr), [shape=(M, N)]) - - is the standard BSR representation where: - the block column indices for row i are stored in - - indices[ indptr[i]: indices[i+1] ] - and their corresponding block values are stored in - - data[ indptr[i]: indptr[i+1] ] - - if the shape parameter is not supplied, the matrix dimensions - are inferred from the index arrays. + bsr_matrix((data, indices, indptr), [shape=(M, N)]) + is the standard BSR representation where the block column + indices for row i are stored in ``indices[indptr[i]:indices[i+1]]`` + and their corresponding block values are stored in + ``data[ indptr[i]: indptr[i+1] ]``. If the shape parameter is not + supplied, the matrix dimensions are inferred from the index arrays. + Notes + ----- - Notes - ===== - - - The blocksize (R,C) must evenly divide the shape of - the matrix (M,N). That is, R and C must satisfy the - relationship M % R = 0 and N % C = 0. - + Summary - The Block Compressed Row (BSR) format is very similar to the Compressed Sparse Row (CSR) format. BSR is appropriate for sparse matrices with dense sub matrices like the last example - below. Such matrices often arise, for instance, in vector-valued - finite element discretizations. + below. Block matrices often arise in vector-valued finite + element discretizations. In such cases, BSR is considerably + more efficient than CSR and CSC for many sparse arithmetic + operations. + Blocksize + - The blocksize (R,C) must evenly divide the shape of + the matrix (M,N). That is, R and C must satisfy the + relationship M % R = 0 and N % C = 0. + - If no blocksize is specified, a simple heuristic is applied + to determine an appropriate blocksize. + + Examples - ======== + -------- >>> from scipy.sparse import * >>> from scipy import * Modified: trunk/scipy/sparse/construct.py =================================================================== --- trunk/scipy/sparse/construct.py 2008-03-05 14:38:29 UTC (rev 3998) +++ trunk/scipy/sparse/construct.py 2008-03-07 00:33:56 UTC (rev 3999) @@ -1,6 +1,8 @@ """Functions to construct sparse matrices """ +__docformat__ = "restructuredtext en" + __all__ = [ 'spdiags', 'eye', 'identity', 'kron', 'kronsum', 'hstack', 'vstack', 'bmat' ] @@ -27,10 +29,8 @@ def spdiags(data, diags, m, n, format=None): """Return a sparse matrix given its diagonals. - B = spdiags(diags, offsets, m, n) - Parameters - ========== + ---------- - data : matrix whose rows contain the diagonal values - diags : diagonals to set - k = 0 - the main diagonal @@ -42,11 +42,12 @@ format is returned. This choice is subject to change. See Also - ======== + -------- The dia_matrix class which implements the DIAgonal format. Example - ======= + ------- + >>> data = array([[1,2,3,4]]).repeat(3,axis=0) >>> diags = array([0,-1,2]) >>> spdiags(data,diags,4,4).todense() @@ -85,18 +86,17 @@ """kronecker product of sparse matrices A and B Parameters - ========== - A,B : dense or sparse matrices - format : format of the result (e.g. "csr") - - By default (format=None) an appropriate sparse matrix - format is returned. This choice is subject to change. + ---------- + A,B : dense or sparse matrices + format : format of the result (e.g. "csr") Returns - ======= - kronecker product in a sparse matrix format + ------- + kronecker product in a sparse matrix format + Examples - ======== + -------- >>> A = csr_matrix(array([[0,2],[5,0]])) >>> B = csr_matrix(array([[1,2],[3,4]])) @@ -168,11 +168,9 @@ of shape (m,m) and (n,n) respectively. Parameters - ========== - A,B : squared dense or sparse matrices - format : format of the result (e.g. "csr") - - By default (format=None) an appropriate sparse matrix - format is returned. This choice is subject to change. + ---------- + A,B : square dense or sparse matrices + format : format of the result (e.g. "csr") Returns ======= @@ -204,15 +202,16 @@ """Stack sparse matrices horizontally (column wise) Parameters - ========== + ---------- - blocks -- sequence of sparse matrices with compatible shapes - format -- sparse format of the result (e.g. "csr") - - by default an appropriate sparse matrix format is returned. - This choice is subject to change. + blocks + sequence of sparse matrices with compatible shapes + format : sparse format of the result (e.g. "csr") + by default an appropriate sparse matrix format is returned. + This choice is subject to change. Example - ======= + ------- >>> from scipy.sparse import coo_matrix, vstack >>> A = coo_matrix([[1,2],[3,4]]) @@ -229,15 +228,16 @@ """Stack sparse matrices vertically (row wise) Parameters - ========== + ---------- - blocks -- sequence of sparse matrices with compatible shapes - format -- sparse format of the result (e.g. "csr") - - by default an appropriate sparse matrix format is returned. - This choice is subject to change. + blocks + sequence of sparse matrices with compatible shapes + format : sparse format of the result (e.g. "csr") + by default an appropriate sparse matrix format is returned. + This choice is subject to change. Example - ======= + ------- >>> from scipy.sparse import coo_matrix, vstack >>> A = coo_matrix([[1,2],[3,4]]) @@ -255,17 +255,17 @@ """Build a sparse matrix from sparse sub-blocks Parameters - ========== + ---------- - blocks -- grid of sparse matrices with compatible shapes - - an entry of None implies an all-zero matrix - format -- sparse format of the result (e.g. "csr") - - by default an appropriate sparse matrix format is returned. - This choice is subject to change. - + blocks + grid of sparse matrices with compatible shapes + an entry of None implies an all-zero matrix + format : sparse format of the result (e.g. "csr") + by default an appropriate sparse matrix format is returned. + This choice is subject to change. Example - ======= + ------- >>> from scipy.sparse import coo_matrix, bmat >>> A = coo_matrix([[1,2],[3,4]]) @@ -370,14 +370,15 @@ diagonal set to 1. Parameters - ========== - - r,c : int - - row and column-dimensions of the output. - - k : int - - diagonal offset. In the output matrix, - - out[m,m+k] == 1 for all m. - - dtype : dtype - - data-type of the output array. + ---------- + + r,c : int + row and column-dimensions of the output. + k : int + - diagonal offset. In the output matrix, + - out[m,m+k] == 1 for all m. + dtype : dtype + data-type of the output array. """ warn("lil_eye is deprecated." \ @@ -392,19 +393,19 @@ """Generate a lil_matrix with the given diagonals. Parameters - ========== - - diags : list of list of values e.g. [[1,2,3],[4,5]] - - values to be placed on each indicated diagonal. - - offsets : list of ints - - diagonal offsets. This indicates the diagonal on which - the given values should be placed. - - (r,c) : tuple of ints - - row and column dimensions of the output. - - dtype : dtype - - output data-type. + ---------- + diags : list of list of values e.g. [[1,2,3],[4,5]] + values to be placed on each indicated diagonal. + offsets : list of ints + diagonal offsets. This indicates the diagonal on which + the given values should be placed. + (r,c) : tuple of ints + row and column dimensions of the output. + dtype : dtype + output data-type. Example - ======= + ------- >>> lil_diags([[1,2,3],[4,5],[6]],[0,1,2],(3,3)).todense() matrix([[ 1., 4., 6.], Modified: trunk/scipy/sparse/coo.py =================================================================== --- trunk/scipy/sparse/coo.py 2008-03-05 14:38:29 UTC (rev 3998) +++ trunk/scipy/sparse/coo.py 2008-03-07 00:33:56 UTC (rev 3999) @@ -1,5 +1,7 @@ """ A sparse matrix in COOrdinate or 'triplet' format""" +__docformat__ = "restructuredtext en" + __all__ = ['coo_matrix', 'isspmatrix_coo'] from itertools import izip @@ -17,56 +19,58 @@ class coo_matrix(_data_matrix): """A sparse matrix in COOrdinate format. + Also known as the 'ijv' or 'triplet' format. This can be instantiated in several ways: - - coo_matrix(D) - - with a dense matrix D + coo_matrix(D) + with a dense matrix D - - coo_matrix(S) - - with another sparse matrix S (equivalent to S.tocoo()) + coo_matrix(S) + with another sparse matrix S (equivalent to S.tocoo()) - - coo_matrix((M, N), [dtype]) - - to construct an empty matrix with shape (M, N) - dtype is optional, defaulting to dtype='d'. + coo_matrix((M, N), [dtype]) + to construct an empty matrix with shape (M, N) + dtype is optional, defaulting to dtype='d'. - - coo_matrix((data, ij), [shape=(M, N)]) - - When shape is not specified, it is inferred from the index arrays: - - ij[0][:] and ij[1][:] + coo_matrix((data, ij), [shape=(M, N)]) + The arguments 'data' and 'ij' represent three arrays: + 1. data[:] the entries of the matrix, in any order + 2. ij[0][:] the row indices of the matrix entries + 3. ij[1][:] the column indices of the matrix entries - - The arguments 'data' and 'ij' represent three arrays: - 1. data[:] the entries of the matrix, in any order - 2. ij[0][:] the row indices of the matrix entries - 3. ij[1][:] the column indices of the matrix entries - So the following holds: - - A[ij[0][k], ij[1][k] = data[k] + Where ``A[ij[0][k], ij[1][k] = data[k]``. When shape is + not specified, it is inferred from the index arrays + Notes - ===== - Advantages of the COO format - ---------------------------- - - facilitates fast conversion among sparse formats - - permits duplicate entries (see example) - - faster conversion to CSR/CSC than LIL - - Disadvantages of the COO format - ------------------------------- - - does not currently support (forces COO->CSR conversion) - - arithmetic operations - - slicing - - matrix vector products - - Usage - ----- - - COO is a fast format for constructing sparse matrices - - once a matrix has been constructed, convert to CSR or - CSC format for fast arithmetic and matrix vector operations - - By default when converting to CSR or CSC format, duplicate (i,j) - entries will be summed together. This facilitates efficient - construction of finite element matrices and the like. (see example) + ----- + Advantages of the COO format + - facilitates fast conversion among sparse formats + - permits duplicate entries (see example) + - very fast conversion to and from CSR/CSC formats + + Disadvantages of the COO format + - does not directly support: + + arithmetic operations + + slicing + + matrix vector products + + + Intended Usage + -------------- + + - COO is a fast format for constructing sparse matrices + - Once a matrix has been constructed, convert to CSR or + CSC format for fast arithmetic and matrix vector operations + - By default when converting to CSR or CSC format, duplicate (i,j) + entries will be summed together. This facilitates efficient + construction of finite element matrices and the like. (see example) + + Examples - ======== + -------- >>> from scipy.sparse import * >>> from scipy import * Modified: trunk/scipy/sparse/csc.py =================================================================== --- trunk/scipy/sparse/csc.py 2008-03-05 14:38:29 UTC (rev 3998) +++ trunk/scipy/sparse/csc.py 2008-03-07 00:33:56 UTC (rev 3999) @@ -1,5 +1,7 @@ """Compressed Sparse Column matrix format""" +__docformat__ = "restructuredtext en" + __all__ = ['csc_matrix', 'isspmatrix_csc'] from warnings import warn @@ -21,41 +23,37 @@ """Compressed Sparse Column matrix This can be instantiated in several ways: - - csc_matrix(D) - - with a dense matrix or rank-2 ndarray D + csc_matrix(D) + with a dense matrix or rank-2 ndarray D - - csc_matrix(S) - - with another sparse matrix S (equivalent to S.tocsc()) + csc_matrix(S) + with another sparse matrix S (equivalent to S.tocsc()) - - csc_matrix((M, N), [dtype]) - - to construct an empty matrix with shape (M, N) - - dtype is optional, defaulting to dtype='d'. + csc_matrix((M, N), [dtype]) + to construct an empty matrix with shape (M, N) + dtype is optional, defaulting to dtype='d'. - - csc_matrix((data, ij), [shape=(M, N)]) - - where data, ij satisfy: - - a[ij[0, k], ij[1, k]] = data[k] + csc_matrix((data, ij), [shape=(M, N)]) + where ``data`` and ``ij`` satisfy ``a[ij[0, k], ij[1, k]] = data[k]`` - - csc_matrix((data, indices, indptr), [shape=(M, N)]) - - is the standard CSC representation where - the row indices for column i are stored in - - indices[ indptr[i]: indices[i+1] ] - and their corresponding values are stored in - - data[ indptr[i]: indptr[i+1] ] - - If the shape parameter is not supplied, the matrix dimensions - are inferred from the index arrays. + csc_matrix((data, indices, indptr), [shape=(M, N)]) + is the standard CSC representation where the row indices for + column i are stored in ``indices[indptr[i]:indices[i+1]]`` and their + corresponding values are stored in ``data[indptr[i]:indptr[i+1]]``. + If the shape parameter is not supplied, the matrix dimensions + are inferred from the index arrays. Notes - ===== - Advantages of the CSC format - ---------------------------- - - efficient arithmetic operations CSC + CSC, CSC * CSC, etc. - - efficient column slicing - - fast matrix vector products (CSR,BSR may be faster) - - Disadvantages of the CSC format - ------------------------------- - - slow row slicing operations (prefer CSR) - - changes to the sparsity structure are expensive (prefer LIL, DOK) + ----- + Advantages of the CSC format + - efficient arithmetic operations CSC + CSC, CSC * CSC, etc. + - efficient column slicing + - fast matrix vector products (CSR, BSR may be faster) + + Disadvantages of the CSC format + ------------------------------- + - slow row slicing operations (consider CSR) + - changes to the sparsity structure are expensive (consider LIL or DOK) Examples Modified: trunk/scipy/sparse/csr.py =================================================================== --- trunk/scipy/sparse/csr.py 2008-03-05 14:38:29 UTC (rev 3998) +++ trunk/scipy/sparse/csr.py 2008-03-07 00:33:56 UTC (rev 3999) @@ -1,5 +1,7 @@ """Compressed Sparse Row matrix format""" +__docformat__ = "restructuredtext en" + __all__ = ['csr_matrix', 'isspmatrix_csr'] @@ -23,47 +25,39 @@ """Compressed Sparse Row matrix This can be instantiated in several ways: - - csr_matrix(D) - - with a dense matrix or rank-2 ndarray D + csr_matrix(D) + with a dense matrix or rank-2 ndarray D - - csr_matrix(S) - - with another sparse matrix S (equivalent to S.tocsr()) + csr_matrix(S) + with another sparse matrix S (equivalent to S.tocsr()) - - csr_matrix((M, N), [dtype]) - - to construct an empty matrix with shape (M, N) - - dtype is optional, defaulting to dtype='d'. + csr_matrix((M, N), [dtype]) + to construct an empty matrix with shape (M, N) + dtype is optional, defaulting to dtype='d'. - - csr_matrix((data, ij), [shape=(M, N)]) - - where data, ij satisfy: - - a[ij[0, k], ij[1, k]] = data[k] + csr_matrix((data, ij), [shape=(M, N)]) + where ``data`` and ``ij`` satisfy ``a[ij[0, k], ij[1, k]] = data[k]`` - - csr_matrix((data, indices, indptr), [shape=(M, N)]) - - is the standard CSR representation where - the column indices for row i are stored in - - indices[ indptr[i]: indices[i+1] ] - and their corresponding values are stored in - - data[ indptr[i]: indptr[i+1] ] - - If the shape parameter is not supplied, the matrix dimensions - are inferred from the index arrays. + csr_matrix((data, indices, indptr), [shape=(M, N)]) + is the standard CSR representation where the column indices for + row i are stored in ``indices[indptr[i]:indices[i+1]]`` and their + corresponding values are stored in ``data[indptr[i]:indptr[i+1]]``. + If the shape parameter is not supplied, the matrix dimensions + are inferred from the index arrays. - Notes - ===== - Advantages of the CSR format - ---------------------------- - - efficient arithmetic operations CSR + CSR, CSR * CSR, etc. - - efficient row slicing - - fast matrix vector products - - Disadvantages of the CSR format - ------------------------------- - - slow column slicing operations (prefer CSC) - - changes to the sparsity structure are expensive (prefer LIL, DOK) + ----- + Advantages of the CSR format + - efficient arithmetic operations CSR + CSR, CSR * CSR, etc. + - efficient row slicing + - fast matrix vector products + + Disadvantages of the CSR format + - slow column slicing operations (consider CSC) + - changes to the sparsity structure are expensive (consider LIL or DOK) - - Examples - ======== + -------- >>> from scipy.sparse import * >>> from scipy import * Modified: trunk/scipy/sparse/dia.py =================================================================== --- trunk/scipy/sparse/dia.py 2008-03-05 14:38:29 UTC (rev 3998) +++ trunk/scipy/sparse/dia.py 2008-03-07 00:33:56 UTC (rev 3999) @@ -1,5 +1,7 @@ """Sparse DIAgonal format""" +__docformat__ = "restructuredtext en" + __all__ = ['dia_matrix','isspmatrix_dia'] from numpy import asarray, asmatrix, matrix, zeros, arange, array, \ @@ -14,23 +16,23 @@ """Sparse matrix with DIAgonal storage This can be instantiated in several ways: - - dia_matrix(D) - - with a dense matrix + dia_matrix(D) + with a dense matrix - - dia_matrix(S) - - with another sparse matrix S (equivalent to S.todia()) + dia_matrix(S) + with another sparse matrix S (equivalent to S.todia()) - - dia_matrix((M, N), [dtype]) - - to construct an empty matrix with shape (M, N) - dtype is optional, defaulting to dtype='d'. + dia_matrix((M, N), [dtype]) + to construct an empty matrix with shape (M, N), + dtype is optional, defaulting to dtype='d'. - - dia_matrix((data, diags), shape=(M, N)) - - where the data[k,:] stores the diagonal entries for - diagonal diag[k] (See example below) + dia_matrix((data, diags), shape=(M, N)) + where the ``data[k,:]`` stores the diagonal entries for + diagonal ``diag[k]`` (See example below) Examples - ======== + -------- >>> from scipy.sparse import * >>> from scipy import * Modified: trunk/scipy/sparse/dok.py =================================================================== --- trunk/scipy/sparse/dok.py 2008-03-05 14:38:29 UTC (rev 3998) +++ trunk/scipy/sparse/dok.py 2008-03-07 00:33:56 UTC (rev 3999) @@ -1,5 +1,7 @@ """Dictionary Of Keys based matrix""" +__docformat__ = "restructuredtext en" + __all__ = ['dok_matrix', 'isspmatrix_dok'] import operator Modified: trunk/scipy/sparse/info.py =================================================================== --- trunk/scipy/sparse/info.py 2008-03-05 14:38:29 UTC (rev 3998) +++ trunk/scipy/sparse/info.py 2008-03-07 00:33:56 UTC (rev 3999) @@ -1,6 +1,6 @@ """ -Sparse matrix -============= +Sparse Matrices +--------------- Scipy 2D sparse matrix module. @@ -14,7 +14,7 @@ 4. lil_matrix: List of Lists format 5. dok_matrix: Dictionary of Keys format 6. coo_matrix: COOrdinate format (aka IJV, triplet format) - 7. dig_matrix: DIAgonal format + 7. dia_matrix: DIAgonal format To construct a matrix efficiently, use either lil_matrix (recommended) or dok_matrix. The lil_matrix class supports basic slicing and fancy @@ -29,67 +29,70 @@ All conversions among the CSR, CSC, and COO formats are efficient, linear-time operations. -Example -======= - Construct a 1000x1000 lil_matrix and add some values to it: +Example 1 +--------- +Construct a 1000x1000 lil_matrix and add some values to it: - >>> from scipy import sparse, linsolve - >>> from numpy import linalg - >>> from numpy.random import rand - >>> A = sparse.lil_matrix((1000, 1000)) - >>> A[0, :100] = rand(100) - >>> A[1, 100:200] = A[0, :100] - >>> A.setdiag(rand(1000)) +>>> from scipy import sparse, linsolve +>>> from numpy import linalg +>>> from numpy.random import rand +>>> A = sparse.lil_matrix((1000, 1000)) +>>> A[0, :100] = rand(100) +>>> A[1, 100:200] = A[0, :100] +>>> A.setdiag(rand(1000)) - Now convert it to CSR format and solve A x = b for x: +Now convert it to CSR format and solve A x = b for x: - >>> A = A.tocsr() - >>> b = rand(1000) - >>> x = linsolve.spsolve(A, b) +>>> A = A.tocsr() +>>> b = rand(1000) +>>> x = linsolve.spsolve(A, b) - Convert it to a dense matrix and solve, and check that the result - is the same: +Convert it to a dense matrix and solve, and check that the result +is the same: - >>> x_ = linalg.solve(A.todense(), b) +>>> x_ = linalg.solve(A.todense(), b) - Now we can compute norm of the error with: +Now we can compute norm of the error with: - >>> err = linalg.norm(x-x_) - >>> err < 1e-10 - True +>>> err = linalg.norm(x-x_) +>>> err < 1e-10 +True - It should be small :) +It should be small :) -Example -======= - Construct a matrix in COO format: - >>> from scipy import sparse - >>> from numpy import array - >>> I = array([0,3,1,0]) - >>> J = array([0,3,1,2]) - >>> V = array([4,5,7,9]) - >>> A = sparse.coo_matrix((V,(I,J)),shape=(4,4)) +Example 2 +--------- - Notice that the indices do not need to be sorted. +Construct a matrix in COO format: - Duplicate (i,j) entries are summed when converting to CSR or CSC. +>>> from scipy import sparse +>>> from numpy import array +>>> I = array([0,3,1,0]) +>>> J = array([0,3,1,2]) +>>> V = array([4,5,7,9]) +>>> A = sparse.coo_matrix((V,(I,J)),shape=(4,4)) - >>> I = array([0,0,1,3,1,0,0]) - >>> J = array([0,2,1,3,1,0,0]) - >>> V = array([1,1,1,1,1,1,1]) - >>> B = sparse.coo_matrix((V,(I,J)),shape=(4,4)).tocsr() +Notice that the indices do not need to be sorted. - This is useful for constructing finite-element stiffness and - mass matrices. +Duplicate (i,j) entries are summed when converting to CSR or CSC. +>>> I = array([0,0,1,3,1,0,0]) +>>> J = array([0,2,1,3,1,0,0]) +>>> V = array([1,1,1,1,1,1,1]) +>>> B = sparse.coo_matrix((V,(I,J)),shape=(4,4)).tocsr() + +This is useful for constructing finite-element stiffness and mass matrices. + Further Details -=============== +--------------- - CSR column indices are not necessarily sorted. Likewise for CSC row - indices. Use the .sorted_indices() and .sort_indices() methods when - sorted indices are required (e.g. when passing data to other libraries). +CSR column indices are not necessarily sorted. Likewise for CSC row +indices. Use the .sorted_indices() and .sort_indices() methods when +sorted indices are required (e.g. when passing data to other libraries). """ +__docformat__ = "restructuredtext en" + postpone_import = 1 Modified: trunk/scipy/sparse/lil.py =================================================================== --- trunk/scipy/sparse/lil.py 2008-03-05 14:38:29 UTC (rev 3998) +++ trunk/scipy/sparse/lil.py 2008-03-07 00:33:56 UTC (rev 3999) @@ -1,8 +1,8 @@ """LInked List sparse matrix class - -Original code by Ed Schofield. """ +__docformat__ = "restructuredtext en" + __all__ = ['lil_matrix','isspmatrix_lil'] import copy @@ -16,32 +16,48 @@ from sputils import getdtype,isshape,issequence,isscalarlike class lil_matrix(spmatrix): - """Row-based linked list matrix, + """Row-based linked list matrix - This contains a list (self.rows) of rows, each of which is a sorted - list of column indices of non-zero elements. It also contains a list - (self.data) of lists of these elements. + + This can be instantiated in several ways: + csc_matrix(D) + with a dense matrix or rank-2 ndarray D + csc_matrix(S) + with another sparse matrix S (equivalent to S.tocsc()) + + csc_matrix((M, N), [dtype]) + to construct an empty matrix with shape (M, N) + dtype is optional, defaulting to dtype='d'. + + csc_matrix((data, ij), [shape=(M, N)]) + where ``data`` and ``ij`` satisfy ``a[ij[0, k], ij[1, k]] = data[k]`` + Notes - ===== - Advantages of the LIL format - ---------------------------- - - supports flexible slicing - - changes to the matrix sparsity structure are efficient + ----- + + Advantages of the LIL format + - supports flexible slicing + - changes to the matrix sparsity structure are efficient - Disadvantages of the LIL format - ------------------------------- - - arithmetic operations LIL + LIL are slower than CSR/CSC - - slow column slicing - - matrix vector products are slower than CSR/CSC + Disadvantages of the LIL format + - arithmetic operations LIL + LIL are slow (consider CSR or CSC) + - slow column slicing (consider CSC) + - matrix vector products are slower than CSR/CSC - Usage - ----- - - LIL is a convenient format for constructing sparse matrices - - once a matrix has been constructed, convert to CSR or - CSC format for fast arithmetic and matrix vector operations - - consider using the COO format when constructing large matrices - + Intended Usage + - LIL is a convenient format for constructing sparse matrices + - once a matrix has been constructed, convert to CSR or + CSC format for fast arithmetic and matrix vector operations + - consider using the COO format when constructing large matrices + + Data Structure + - An array (``self.rows``) of rows, each of which is a sorted + list of column indices of non-zero elements. + - The corresponding nonzero values are stored in similar + fashion in ``self.data``. + + """ def __init__(self, A=None, shape=None, dtype=None, copy=False): Modified: trunk/scipy/sparse/sputils.py =================================================================== --- trunk/scipy/sparse/sputils.py 2008-03-05 14:38:29 UTC (rev 3998) +++ trunk/scipy/sparse/sputils.py 2008-03-07 00:33:56 UTC (rev 3999) @@ -21,8 +21,8 @@ upcast(t0, t1, ..., tn) -> T where T is a supported dtype - Example - ======= + Examples + -------- >>> upcast('int32') From scipy-svn at scipy.org Thu Mar 6 19:50:48 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Thu, 6 Mar 2008 18:50:48 -0600 (CST) Subject: [Scipy-svn] r4000 - in trunk/scipy/sparse: . tests Message-ID: <20080307005048.9371939C036@new.scipy.org> Author: wnbell Date: 2008-03-06 18:50:27 -0600 (Thu, 06 Mar 2008) New Revision: 4000 Added: trunk/scipy/sparse/tests/bench_sparse.py Removed: trunk/scipy/sparse/benchmarks/ Log: moved benchmark to tests Copied: trunk/scipy/sparse/tests/bench_sparse.py (from rev 3967, trunk/scipy/sparse/benchmarks/bench_sparse.py) From scipy-svn at scipy.org Fri Mar 7 07:39:52 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Fri, 7 Mar 2008 06:39:52 -0600 (CST) Subject: [Scipy-svn] r4001 - branches/build_with_scons/scipy/sparse/linalg/eigen/arpack Message-ID: <20080307123952.381EE39C07B@new.scipy.org> Author: cdavid Date: 2008-03-07 06:39:46 -0600 (Fri, 07 Mar 2008) New Revision: 4001 Modified: branches/build_with_scons/scipy/sparse/linalg/eigen/arpack/SConstruct Log: Prepend arpack lib for arpack module, because appending causes various crashes.... Modified: branches/build_with_scons/scipy/sparse/linalg/eigen/arpack/SConstruct =================================================================== --- branches/build_with_scons/scipy/sparse/linalg/eigen/arpack/SConstruct 2008-03-07 00:50:27 UTC (rev 4000) +++ branches/build_with_scons/scipy/sparse/linalg/eigen/arpack/SConstruct 2008-03-07 12:39:46 UTC (rev 4001) @@ -17,7 +17,8 @@ #----------------- # Checking Lapack #----------------- -st = config.CheckLAPACK() +st = config.CheckF77Clib() +st = config.CheckLAPACK(autoadd = 1) if not st: raise RuntimeError("no lapack found, necessary for arpack module") @@ -32,6 +33,7 @@ src = [str(s) for s in arpack_src] env.AppendUnique(CPPPATH = pjoin('ARPACK', 'SRC')) +env.AppendUnique(LIBPATH = env['build_dir']) arpack_lib = env.NumpyStaticExtLibrary('arpack', source = src) # Build _arpack extension @@ -41,4 +43,5 @@ env.NumpyFromFTemplate('arpack.pyf', 'arpack.pyf.src') wsrc = env.F2py(pjoin(env['build_dir'], '_arpackmodule.c'), pjoin(env['build_dir'], 'arpack.pyf')) -env.NumpyPythonExtension('_arpack', source = wsrc, LIBS = arpack_lib) +env.Prepend(LIBS = 'arpack') +env.NumpyPythonExtension('_arpack', source = wsrc) From scipy-svn at scipy.org Fri Mar 7 08:49:35 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Fri, 7 Mar 2008 07:49:35 -0600 (CST) Subject: [Scipy-svn] r4002 - branches/build_with_scons/scipy/fftpack Message-ID: <20080307134935.5309D39C0F3@new.scipy.org> Author: cdavid Date: 2008-03-07 07:48:58 -0600 (Fri, 07 Mar 2008) New Revision: 4002 Modified: branches/build_with_scons/scipy/fftpack/SConstruct Log: Prepend dfftpack lib when building fftpack extension. Modified: branches/build_with_scons/scipy/fftpack/SConstruct =================================================================== --- branches/build_with_scons/scipy/fftpack/SConstruct 2008-03-07 12:39:46 UTC (rev 4001) +++ branches/build_with_scons/scipy/fftpack/SConstruct 2008-03-07 13:48:58 UTC (rev 4002) @@ -1,4 +1,4 @@ -# Last Change: Wed Mar 05 02:00 PM 2008 J +# Last Change: Fri Mar 07 09:00 PM 2008 J # vim:syntax=python from os.path import join as pjoin @@ -31,8 +31,8 @@ # Build dfftpack src = env.NumpyGlob(pjoin('dfftpack', '*.f')) dfftpack = env.NumpyStaticExtLibrary('dfftpack', source = [str(s) for s in src]) -env.AppendUnique(LIBS = ['dfftpack']) -env.AppendUnique(LIBPATH = env['build_dir']) +env.PrependUnique(LIBS = ['dfftpack']) +env.PrependUnique(LIBPATH = env['build_dir']) # Build _fftpack src = ['src/zfft.c','src/drfft.c','src/zrfft.c', 'src/zfftnd.c'] From scipy-svn at scipy.org Fri Mar 7 08:50:56 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Fri, 7 Mar 2008 07:50:56 -0600 (CST) Subject: [Scipy-svn] r4003 - branches/build_with_scons/scipy/linalg Message-ID: <20080307135056.5B6DB39C099@new.scipy.org> Author: cdavid Date: 2008-03-07 07:50:21 -0600 (Fri, 07 Mar 2008) New Revision: 4003 Modified: branches/build_with_scons/scipy/linalg/SConstruct Log: Split Fortran and C compilation scons environments. Modified: branches/build_with_scons/scipy/linalg/SConstruct =================================================================== --- branches/build_with_scons/scipy/linalg/SConstruct 2008-03-07 13:48:58 UTC (rev 4002) +++ branches/build_with_scons/scipy/linalg/SConstruct 2008-03-07 13:50:21 UTC (rev 4003) @@ -1,4 +1,4 @@ -# Last Change: Wed Mar 05 03:00 PM 2008 J +# Last Change: Fri Mar 07 07:00 PM 2008 J # vim:syntax=python import os @@ -20,45 +20,44 @@ env = GetNumpyEnvironment(ARGUMENTS) env.Append(CPPPATH = [get_python_inc(), get_numpy_include_dirs()]) + +# XXX: handle cblas wrapper for complex (check in numpy.scons or here ?) +env.AppendUnique(CPPPATH = env['F2PYINCLUDEDIR']) +env.AppendUnique(F2PYOPTIONS = '--quiet') + +env['BUILDERS']['haha'] = Builder(action = do_generate_interface, + emitter = generate_interface_emitter) + +env['BUILDERS']['hihi'] = Builder(action = do_generate_fake_interface, + emitter = generate_interface_emitter) + #if os.name == 'nt': # # NT needs the pythonlib to run any code importing Python.h, including # # simple code using only typedef and so on, so we need it for configuration # # checks # env.AppendUnique(LIBPATH = [get_pythonlib_dir()]) +fenv = env.Copy() + #======================= # Starting Configuration #======================= -config = env.NumpyConfigure(custom_tests = {'CheckCBLAS' : CheckCBLAS, - 'CheckBLAS' : CheckF77BLAS, - 'CheckCLAPACK' : CheckCLAPACK, - 'CheckLAPACK' : CheckF77LAPACK, - 'CheckF77Clib' : CheckF77Clib}) +config = env.Configure(custom_tests = {'CheckCBLAS' : CheckCBLAS, + 'CheckCLAPACK' : CheckCLAPACK}) -#-------------- -# Checking Blas -#-------------- -if not config.CheckF77Clib(): - raise RuntimeError("Could not check F/C runtime library for %s/%s, " \ - "contact the maintainer" % (env['CC'], env['F77'])) - -st = config.CheckBLAS(check_version = 1) -if not st: - raise RuntimeError("no blas found, necessary for linalg module") -if IsATLAS(env, 'blas'): - version = GetATLASVersion(env) - env.Append(CPPDEFINES = [('ATLAS_INFO', '"\\"%s"\\"' % version)]) -else: - env.Append(CPPDEFINES = [('NO_ATLAS_INFO', 1)]) - -st = config.CheckLAPACK() -if not st: - raise RuntimeError("no lapack found, necessary for linalg module") - +#------------------------- +# Checking cblas/clapack +#------------------------- if config.CheckCBLAS(): has_cblas = 1 else: has_cblas = 0 +if has_cblas: + if IsATLAS(env, 'cblas'): + version = GetATLASVersion(env) + env.Append(CPPDEFINES = [('ATLAS_INFO', '"\\"%s"\\"' % version)]) + else: + env.Append(CPPDEFINES = [('NO_ATLAS_INFO', 1)]) if config.CheckCLAPACK(): has_clapack = 1 @@ -68,30 +67,46 @@ config.Finish() write_info(env) -#========== -# Build -#========== +#--------------------------- +# Checking F77 blas/lapack +#--------------------------- +fconfig = fenv.Configure(custom_tests = {'CheckBLAS' : CheckF77BLAS, + 'CheckLAPACK' : CheckF77LAPACK, + 'CheckF77Clib' : CheckF77Clib}) -# XXX: handle cblas wrapper for complex (check in numpy.scons or here ?) -env.AppendUnique(CPPPATH = env['F2PYINCLUDEDIR']) -env.AppendUnique(F2PYOPTIONS = '--quiet') +if not fconfig.CheckF77Clib(): + raise RuntimeError("Could not check F/C runtime library for %s/%s, " \ + "contact the maintainer" % (fenv['CC'], fenv['F77'])) -env['BUILDERS']['haha'] = Builder(action = do_generate_interface, - emitter = generate_interface_emitter) +st = fconfig.CheckBLAS(check_version = 1) +if not st: + raise RuntimeError("no blas found, necessary for linalg module") +if IsATLAS(fenv, 'blas'): + version = GetATLASVersion(fenv) + env.Append(CPPDEFINES = [('ATLAS_INFO', '"\\"%s"\\"' % version)]) +else: + env.Append(CPPDEFINES = [('NO_ATLAS_INFO', 1)]) -env['BUILDERS']['hihi'] = Builder(action = do_generate_fake_interface, - emitter = generate_interface_emitter) +st = fconfig.CheckLAPACK() +if not st: + raise RuntimeError("no lapack found, necessary for linalg module") +fconfig.Finish() +write_info(fenv) + +#========== +# Build +#========== #------------ # fblas #------------ -env.haha('fblas', 'generic_fblas.pyf') +fenv.haha('fblas', 'generic_fblas.pyf') source = ['fblas.pyf'] -if IsVeclib(env, 'blas') or IsAccelerate(env, 'blas'): +if IsVeclib(fenv, 'blas') or IsAccelerate(fenv, 'blas'): source.append(pjoin('src', 'fblaswrap_veclib_c.c')) else: source.append(pjoin('src', 'fblaswrap.f')) -env.NumpyPythonExtension('fblas', source) +fenv.NumpyPythonExtension('fblas', source) #------------ # cblas @@ -105,10 +120,10 @@ #------------ # flapack #------------ -yop = env.haha('flapack', 'generic_flapack.pyf') +yop = fenv.haha('flapack', 'generic_flapack.pyf') # XXX: automatically scan dependency on flapack_user_routines.pyf ? -env.Depends(yop, pjoin(env['build_dir'], 'flapack_user_routines.pyf')) -env.NumpyPythonExtension('flapack', source = ['flapack.pyf']) +fenv.Depends(yop, pjoin(env['build_dir'], 'flapack_user_routines.pyf')) +fenv.NumpyPythonExtension('flapack', source = ['flapack.pyf']) #------------ # clapack @@ -123,11 +138,11 @@ # _flinalg #---------------- _flinalg_fsrc = ['det.f', 'lu.f'] -_flinalg_src = env.F2py( - pjoin(env['build_dir'], 'src', '_flinalgmodule.c'), - source = [pjoin(env['build_dir'], 'src', i) for i in _flinalg_fsrc]) +_flinalg_src = fenv.F2py( + pjoin(fenv['build_dir'], 'src', '_flinalgmodule.c'), + source = [pjoin(fenv['build_dir'], 'src', i) for i in _flinalg_fsrc]) -env.NumpyPythonExtension( +fenv.NumpyPythonExtension( '_flinalg', source = _flinalg_src + [pjoin('src', i) for i in _flinalg_fsrc]) #---------------- @@ -135,14 +150,13 @@ #---------------- calc_src = env.F2py(pjoin(env['build_dir'], 'src', 'calc_lworkmodule.c'), source = pjoin(env['build_dir'], 'src', 'calc_lwork.f')) -env.NumpyPythonExtension('calc_lwork', - source = calc_src + [pjoin('src', 'calc_lwork.f')], - LINKFLAGSEND = env['F77_LDFLAGS']) +fenv.NumpyPythonExtension('calc_lwork', + source = calc_src + [pjoin('src', 'calc_lwork.f')]) #-------------- # Atlas version #-------------- atlas_env = env.Copy() -if not IsATLAS(env, 'blas'): +if not IsATLAS(env, 'cblas'): atlas_env.AppendUnique(CPPDEFINES = "NO_ATLAS_INFO") atlas_env.NumpyPythonExtension('atlas_version', 'atlas_version.c') From scipy-svn at scipy.org Fri Mar 7 19:07:00 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Fri, 7 Mar 2008 18:07:00 -0600 (CST) Subject: [Scipy-svn] r4004 - trunk/scipy/ndimage Message-ID: <20080308000700.70B6439C0C7@new.scipy.org> Author: tom.waite Date: 2008-03-07 18:06:51 -0600 (Fri, 07 Mar 2008) New Revision: 4004 Modified: trunk/scipy/ndimage/_registration.py Log: added docstrings Modified: trunk/scipy/ndimage/_registration.py =================================================================== --- trunk/scipy/ndimage/_registration.py 2008-03-07 13:50:21 UTC (rev 4003) +++ trunk/scipy/ndimage/_registration.py 2008-03-08 00:06:51 UTC (rev 4004) @@ -25,18 +25,47 @@ # """) -# anatomical MRI to test with -inputname = 'ANAT1_V0001.img' -filename = os.path.join(os.path.split(__file__)[0], inputname) - # # ---- co-registration and IO ---- # def resize_image(imageG, imageF_mat): - # - # Fractional resample imageG to imageF size. - # + """ + zoom_image = resize_image(source_image, reference_image[mat]) + + Fractional resample source_image to reference_imagesize. The + resample is implemented with 3D cubic spline. The reference + image [mat] is the 4x4 voxel-to-physical conversion matrix. + + Parameters + .......... + + imageG : {dictionary} + imageG is the source image to be resized. it is a dictionary with + the data as an ndarray in the ['data'] component. + + reference_image[mat] : {ndarray} + refernce_image is the image whose sampling dimensions the source + image is to be remapped to. [mat] refers to the component + of the image dictionary, reference_image['mat'] that is the + sampling dimensions. + + Returns + ....... + zoom_image : {dictionary} + + Examples + ........ + + >>> import _registration as reg + >>> measures, imageF_anat, fmri_series = reg.demo_MRI_coregistration() + + >>> resampled_fmri = reg.resize_image(fmri_series[10], imageF_anat['mat']) + + image 10 in the fmri_series is resampled to imageF_anat coordinates + + """ + Z = N.zeros(3, dtype=N.float64); # get the zoom Z[0] = imageG['mat'][0][0] / imageF_mat[0][0] @@ -65,6 +94,39 @@ return zoom_image def remap_image(image, parm_vector, resample='linear'): + """ + remaped_image = remap_image(image, parm_vector, resample='linear') + + rotates and translates image using the 3 angles and 3 translations in the 6-dim + parm_vector. The mapping is stored in the 4x4 M_inverse matrix from the get_inverse_mapping + method. + + Parameters + .......... + image : {dictionary} + image is the source image to be remapped. it is a dictionary with + the data as an ndarray in the ['data'] component. + + parm_vector : {ndarray} + parm_vector is the 6-dimensional vector (3 angles, 3 translations) + generated from the registration. + + resample : {'linear', 'cubic'}, optional + + + Returns + ....... + remaped_image : {dictionary} + + Examples + ........ + image = fmri_series[i] + x[0:6] = measures[i]['align_rotate'][0:6] + # overwrite the fMRI volume with the aligned volume + fmri_series[i] = remap_image(image, x, resample='cubic') + + """ + # # remap imageG to coordinates of imageF (creates imageG') # use the 6 dim parm_vector (3 angles, 3 translations) to remap @@ -87,6 +149,36 @@ return remaped_image def get_inverse_mappings(parm_vector): + """ + M_inverse = get_inverse_mappings(parm_vector) + + takes the 6-dimensional rotation/translation vector and builds the inverse + 4x4 mapping matrix M_inverse that will map imageG to imageF orientation + + Parameters + .......... + parm_vector : {nd_array} + + Returns + ....... + M_inverse : {nd_array} + + Examples + ........ + + >>> import numpy as N + >>> import _registration as reg + >>> array = N.zeros(6, dtype=float) + >>> M = reg.get_inverse_mappings(array) + >>> M + + array([ + [ 1., 0., 0., 0.], + [ 0., 1., 0., 0.], + [ 0., 0., 1., 0.], + [ 0., 0., 0., 1.]]) + + """ # get the inverse mapping to rotate the G matrix to F space following registration imdata = build_structs() # inverse angles and translations @@ -101,8 +193,63 @@ def python_coreg(image1, image2, imdata, ftype=1, smimage=0, lite=0, smhist=0, method='nmi', opt_method='powell'): - # image1 is imageF and image2 is imageG in SPM lingo - # get these from get_test_images for the debug work + """ + parm_vector = python_coreg(image1, image2, imdata, ftype=1, smimage=0, lite=0, + smhist=0, method='nmi', opt_method='powell'): + + takes two images and the image data descriptor (imdata) and determines the optimal + alignment of the two images (measured by mutual information or cross correlation) + using optimization search of 3 angle and 3 translation parameters. The optimization + uses either the Powell or Conjugate Gradient methods in the scipy optimization + package. The optimal parameter is returned. + + Parameters + .......... + image1 : {dictionary} + image1 is the source image to be remapped during the registration. + it is a dictionary with the data as an ndarray in the ['data'] component. + image2 : {dictionary} + image2 is the reference image that image1 gets mapped to. + imdata : {dictionary} + image sampling and optimization information. + ftype : {0, 1}, optional + flag for type of low pass filter. 0 is Gauss-Spline + 1 is pure Gauss. Sigma determined from volume sampling info. + smimage : {0, 1}, optional + flag for volume 3D low pass filtering of image 2. + 0 for no filter, 1 for do filter. + lite : {0, 1}, optional + lite of 1 is to jitter both images during resampling. 0 + is to not jitter. jittering is for non-aliased volumes. + smhist: {0, 1}, optional + flag for joint histogram low pass filtering. 0 for no filter, + 1 for do filter. + method: {'nmi', 'mi', 'ncc', 'ecc'}, optional + flag for type of registration metric. nmi is normalized mutual + information; mi is mutual information; ecc is entropy cross + correlation; ncc is normalized cross correlation. + opt_method: {'powell', 'hybrid'}, optional + registration is two pass. Pass 1 is low res to get close to alignment + and pass 2 starts at the pass 1 optimal alignment. In powell pass 1 and + 2 are powell, in hybrid pass 2 is conjugate gradient. + + + Returns + ....... + parm_vector : {nd_array} + this is the optimal alignment (6-dim) array with 3 angles and + 3 translations. + + Examples + ........ + + >>> import numpy as N + >>> import _registration as reg + + >>> image1, image2, imdata = reg.demo_MRI_volume_align() + >>> parm_vector = python_coreg(image1, image2, imdata) + + """ start = time.time() # smooth of the images if smimage: @@ -114,6 +261,53 @@ return parm_vector def multires_registration(image1, image2, imdata, lite, smhist, method, opt_method): + """ + x = multires_registration(image1, image2, imdata, lite, smhist, method, opt_method) + + to be called by python_coreg() which optionally does 3D image filtering and + provies timing for registration. + + Parameters + .......... + + image1 : {dictionary} + image1 is the source image to be remapped during the registration. + it is a dictionary with the data as an ndarray in the ['data'] component. + image2 : {dictionary} + image2 is the reference image that image1 gets mapped to. + imdata : {dictionary} + image sampling and optimization information. + lite : {integer} + lite of 1 is to jitter both images during resampling. 0 + is to not jitter. jittering is for non-aliased volumes. + smhist: {integer} + flag for joint histogram low pass filtering. 0 for no filter, + 1 for do filter. + method: {'nmi', 'mi', 'ncc', 'ecc'} + flag for type of registration metric. nmi is normalized mutual + information; mi is mutual information; ecc is entropy cross + correlation; ncc is normalized cross correlation. + opt_method: {'powell', 'hybrid'} + registration is two pass. Pass 1 is low res to get close to alignment + and pass 2 starts at the pass 1 optimal alignment. In powell pass 1 and + 2 are powell, in hybrid pass 2 is conjugate gradient. + + Returns + ....... + x : {nd_array} + this is the optimal alignment (6-dim) array with 3 angles and + 3 translations. + + Examples + ........ + + (calling this from python_coreg which optionally filters image2) + >>> import numpy as N + >>> import _registration as reg + >>> image1, image2, imdata = reg.demo_MRI_volume_align() + >>> parm_vector = python_coreg(image1, image2, imdata) + + """ ret_histo=0 # zero out the start parameter; but this may be set to large values # if the head is out of range and well off the optimal alignment skirt @@ -158,16 +352,62 @@ def callback_powell(x): + """ + called by optimize.powell only. prints current parameter vector. + """ print 'Parameter Vector from Powell: - ' print x return def callback_cg(x): + """ + called by optimize.cg only. prints current parameter vector. + """ print 'Parameter Vector from Conjugate Gradient: - ' print x return def smooth_kernel(fwhm, x, ktype=1): + """ + kernel = smooth_kernel(fwhm, x, ktype=1) + + smooth_kernel creates filter kernel based on image sampling parameters. + provide domain of kernel and sampling parameters. + + Parameters + .......... + fwhm : {int} + used for kernel width + x : {nd_array} + domain of kernel + ktype: {1, 2}, optional + kernel type. 1 is Gauss convoled with spline, 2 is Gauss + + + Returns + ....... + kernel : {nd_array} + + Examples + ........ + + >>> import numpy as N + >>> import _registration as reg + >>> fwhm = 3 + >>> ftype = 2 + >>> p = N.ceil(2*fwhm).astype(int) + >>> x = N.array(range(-p, p+1)) + >>> kernel = reg.smooth_kernel(fwhm, x, ktype=ftype) + >>> kernel + + array([ + 4.77853772e-06, 1.41575516e-04, 2.26516955e-03, + 1.95718875e-02, 9.13238336e-02, 2.30120330e-01, + 3.13144850e-01, 2.30120330e-01, 9.13238336e-02, + 1.95718875e-02, 2.26516955e-03, 1.41575516e-04, + 4.77853772e-06]) + + """ eps = 0.00001 s = N.square((fwhm/math.sqrt(8.0*math.log(2.0)))) + eps if ktype==1: @@ -187,6 +427,34 @@ return kernel def filter_image_3D(imageRaw, fwhm, ftype=2): + """ + image_F_xyz = filter_image_3D(imageRaw, fwhm, ftype=2): + does 3D separable digital filtering using scipy.ndimage.correlate1d + + Parameters + .......... + imageRaw : {nd_array} + the unfiltered 3D volume image + fwhm : {int} + used for kernel width + ktype: {1, 2}, optional + kernel type. 1 is Gauss convoled with spline, 2 is Gauss + + Returns + ....... + image_F_xyz : {nd_array} + 3D filtered volume image + + Examples + ........ + + >>> import _registration as reg + >>> image1, image2, imdata = reg.demo_MRI_volume_align() + >>> ftype = 1 + >>> image_Filter_xyz = filter_image_3D(image1['data'], image1['fwhm'], ftype) + >>> image1['data'] = image_Filter_xyz + """ + p = N.ceil(2*fwhm[0]).astype(int) x = N.array(range(-p, p+1)) kernel_x = smooth_kernel(fwhm[0], x, ktype=ftype) @@ -206,38 +474,38 @@ image_F_xyz = NDI.correlate1d(image_F_xy, kernel_z, axis, output) return image_F_xyz +def build_fwhm(M, S): + """ + fwhm = build_fwhm(M, S) -def resample_image(smimage=0, ftype=2, alpha=0.0, beta=0.0, gamma=0.0, - Tx=0.0, Ty=0.0, Tz=0.0): - - # takes an image and 3D rotate using trilinear interpolation - anat_desc = load_anatMRI_desc() - image1 = load_volume(anat_desc, imagename='ANAT1_V0001.img') - image2 = load_volume(anat_desc, imagename=None) - imdata = build_structs() - imdata['parms'][0] = alpha - imdata['parms'][1] = beta - imdata['parms'][2] = gamma - imdata['parms'][3] = Tx - imdata['parms'][4] = Ty - imdata['parms'][5] = Tz - image1['fwhm'] = build_fwhm(image1['mat'], imdata['step']) - image2['fwhm'] = build_fwhm(image2['mat'], imdata['step']) - M = build_rotate_matrix(imdata['parms']) - if smimage: - image_F_xyz1 = filter_image_3D(image1['data'], image1['fwhm'], ftype) - image1['data'] = image_F_xyz1 - image_F_xyz2 = filter_image_3D(image2['data'], image2['fwhm'], ftype) - image2['data'] = image_F_xyz2 + builds the low pass filter kernel sigma value from the image pixel sampling - # this is now a rotated and low pass filtered version of the volume - R.register_linear_resample(image1['data'], image2['data'], M, imdata['step']) + Parameters + .......... + M : {nd_array} + input 4x4 voxel to physical map matrix (called 'MAT') - return image2 + S : {nd_array} + 1x3 sample increment array. should be = (1, 1, 1) + Returns + ....... + fwhm : {nd_array} + the 3D Gaussian kernel width -def build_fwhm(M, S): + Examples + ........ + + >>> import numpy as N + >>> import _registration as reg + >>> anat_desc = reg.load_anatMRI_desc() + >>> image1 = reg.load_volume(anat_desc, imagename='ANAT1_V0001.img') + >>> imdata = reg.build_structs() + >>> image1['fwhm'] = reg.build_fwhm(image1['mat'], imdata['step']) + + """ view_3x3 = N.square(M[0:3, 0:3]) + # sum the elements inn the first row vxg = N.sqrt(view_3x3.sum(axis=0)) # assumes that sampling is the same for xyz size = N.array([1,1,1])*S[0] @@ -251,6 +519,88 @@ return fwhm def optimize_function(x, optfunc_args): + """ + cost = optimize_function(x, optfunc_args) --- OR --- + cost, joint_histogram = optimize_function(x, optfunc_args) + + computes the alignment between 2 volumes using cross correlation or mutual + information metrics. In both the 8 bit joint histogram of the 2 images is + computed. The 8 bit scaling is done using an integrated histogram method and + is called prior to this. + + Parameters + ....... + x : {nd_array} + this is the current (6-dim) array with 3 angles and 3 translations. + + optfunc_args : {tuple} + this is a tuple of 8 elements that is formed in the scipy.optimize powell + and cg (conjugate gradient) functions. this is why the elements need to be + a tuple. The elements of optfunc_args are: + + image_F : {dictionary} + image_F is the source image to be remapped during the registration. + it is a dictionary with the data as an ndarray in the ['data'] component. + image_G : {dictionary} + image_G is the reference image that image_F gets mapped to. + sample_vector : {nd_array} + sample in x,y,x. should be (1,1,1) + fwhm : {nd_array} + Gaussian sigma + do_lite : {0, 1} + lite of 1 is to jitter both images during resampling. + 0 is to not jitter. jittering is for non-aliased volumes. + smooth : {0, 1} + flag for joint histogram low pass filtering. 0 for no filter, + 1 for do filter. + method : {'nmi', 'mi', 'ncc', 'ecc'} + flag for type of registration metric. nmi is normalized mutual + information; mi is mutual information; ecc is entropy cross + correlation; ncc is normalized cross correlation. + ret_histo : {0, 1} + if 0 return is: cost + if 0 return is: cost, joint_histogram + + Returns + ....... + cost : {float} + the negative of one of the mutual information metrics + or negative cross correlation. use negative as the optimization + is minimization. + + --- OR --- (if ret_histo = 1) + + cost : {float} + the negative of one of the mutual information metrics + or negative cross correlation. use negative as the optimization + is minimization. + + joint_histogram : {nd_array} + the 2D (256x256) joint histogram of the two volumes + + + Examples + ........ + + >>> import numpy as N + >>> import _registration as reg + >>> anat_desc = reg.load_anatMRI_desc() + >>> image1 = reg.load_volume(anat_desc, imagename='ANAT1_V0001.img') + >>> image2 = reg.load_volume(anat_desc, imagename='ANAT1_V0001.img') + >>> imdata = reg.build_structs() + >>> image1['fwhm'] = reg.build_fwhm(image1['mat'], imdata['step']) + >>> image2['fwhm'] = reg.build_fwhm(image2['mat'], imdata['step']) + >>> method = 'ncc' + >>> lite = 1 + >>> smhist = 0 + >>> ret_histo = 1 + >>> optfunc_args = (image1, image2, imdata['step'], imdata['fwhm'], lite, smhist, method, ret_histo) + >>> x = N.zeros(6, dtype=N.float64) + >>> return cost, joint_histogram = reg.optimize_function(x, optfunc_args) + + + """ + image_F = optfunc_args[0] image_G = optfunc_args[1] sample_vector = optfunc_args[2] @@ -272,7 +622,7 @@ composite = N.dot(F_inv, image_G['mat']) composite = N.dot(composite, rot_matrix) - # allocate memory from Python as memory leaks when created in C-ext + # allocate memory for 2D histogram joint_histogram = N.zeros([256, 256], dtype=N.float64); if do_lite: @@ -351,6 +701,31 @@ def build_structs(step=1): + """ + img_data = build_structs(step=1) + + builds the image data (imdata) dictionary for later use as parameter + storage in the co-registration. + + Parameters + ....... + step : {int} : optional + default is 1 and is the sample increment in voxels. This sets the sample + for x,y,z and is the same value in all 3 axes. only change the default for debug. + + Returns + ....... + img_data : {dictionary} + + Examples + ........ + + >>> import numpy as N + >>> import _registration as reg + >>> imdata = reg.build_structs() + + """ + # build image data structures here P = N.zeros(6, dtype=N.float64); T = N.zeros(6, dtype=N.float64); @@ -360,7 +735,7 @@ S[0] = step S[1] = step S[2] = step - # histogram smoothing + # image/histogram smoothing F[0] = 3 F[1] = 3 # subsample for multiresolution registration @@ -384,6 +759,38 @@ def build_rotate_matrix(img_data_parms): + """ + rot_matrix = reg.build_rotate_matrix(img_data_parms) + + takes the 6 element vector (3 angles, 3 translations) and build the 4x4 mapping matrix + + Parameters + ....... + img_data_parms : {nd_array} + this is the current (6-dim) array with 3 angles and 3 translations. + + Returns + ....... + rot_matrix: {nd_array} + the 4x4 mapping matrix + + Examples + ........ + + >>> import numpy as N + >>> import _registration as reg + >>> imdata = reg.build_structs() + >>> x = N.zeros(6, dtype=N.float64) + >>> M = reg.build_rotate_matrix(x) + >>> M + array([[ 1., 0., 0., 0.], + [ 0., 1., 0., 0.], + [ 0., 0., 1., 0.], + [ 0., 0., 0., 1.]]) + + + """ + R1 = N.zeros([4,4], dtype=N.float64); R2 = N.zeros([4,4], dtype=N.float64); R3 = N.zeros([4,4], dtype=N.float64); @@ -430,15 +837,78 @@ def load_volume(imagedesc, imagename=None, threshold=0.999, debug=0): + + """ + image = load_volume(imagedesc, imagename=None, threshold=0.999, debug=0) --- OR --- + image, h, ih, index = load_volume(imagedesc, imagename=None, threshold=0.999, debug=0) + + gets an image descriptor and optional filename and returns a scaled 8 bit volume. The + scaling is designed to make full use of the 8 bits (ignoring high amplitude outliers). + The current method uses numpy fromfile and will be replaced by neuroimage nifti load. + + Parameters + ....... + imagedesc : {dictionary} + imagedesc is the descriptor of the image to be read. + + imagename : {string} : optional + name of image file. No name creates a blank image that is used for creating + a rotated test image or image rescaling. + + threshold : {float} : optional + this is the threshold for upper cutoff in the 8 bit scaling. The volume histogram + and integrated histogram is computed and the upper amplitude cutoff is where the + integrated histogram crosses the value set in the threshold. setting threshold to + 1.0 means the scaling is done over the min to max amplitude range. + + debug : {0, 1} : optional + when debug=1 the method returns the volume histogram, integrated histogram and the + amplitude index where the provided threshold occured. + + Returns + ....... + image : {dictionary} + the volume data assoicated with the filename or a blank volume of the same + dimensions as specified in imagedesc. + + --- OR --- (if debug = 1) + + image : {dictionary} + the volume data assoicated with the filename or a blank volume of the same + dimensions as specified in imagedesc. + + h : {nd_array} + the volume 1D amplitude histogram + + ih : {nd_array} + the volume 1D amplitude integrated histogram + + index : {int} + the amplitude (histogram index) where the integrated histogram + crosses the 'threshold' provided. + + Examples + ........ + + >>> import numpy as N + >>> import _registration as reg + >>> anat_desc = reg.load_anatMRI_desc() + >>> image_anat, h, ih, index = reg.load_volume(anat_desc, imagename='ANAT1_V0001.img', debug=1) + >>> index + 210 + + + """ + # load MRI or fMRI volume and return an autoscaled 8 bit image. # autoscale is using integrated histogram to deal with outlier high amplitude voxels if imagename == None: # imagename of none means to create a blank image ImageVolume = N.zeros(imagedesc['layers']*imagedesc['rows']*imagedesc['cols'], - dtype=N.uint16).reshape(imagedesc['layers'], imagedesc['rows'], imagedesc['cols']) + dtype=N.uint16).reshape(imagedesc['layers'], imagedesc['rows'], imagedesc['cols']) else: ImageVolume = N.fromfile(imagename, - dtype=N.uint16).reshape(imagedesc['layers'], imagedesc['rows'], imagedesc['cols']); + dtype=N.uint16).reshape(imagedesc['layers'], imagedesc['rows'], imagedesc['cols']); # the mat (voxel to physical) matrix M = N.eye(4, dtype=N.float64); @@ -482,6 +952,12 @@ else: return image + + +# +# ---- demo/debug routines ---- +# + def load_anatMRI_desc(): # this is for demo on the test MRI and fMRI volumes rows = 256 @@ -534,11 +1010,6 @@ cost = optimize_function(imdata['parms'], optfunc_args) return cost - -# -# ---- demo/debug routines ---- -# - def build_scale_image(image, scale): # # rescale the 'mat' (voxel to physical mapping matrix) From scipy-svn at scipy.org Mon Mar 10 23:34:37 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Mon, 10 Mar 2008 22:34:37 -0500 (CDT) Subject: [Scipy-svn] r4005 - branches Message-ID: <20080311033437.02F3E39C013@new.scipy.org> Author: cdavid Date: 2008-03-10 22:34:32 -0500 (Mon, 10 Mar 2008) New Revision: 4005 Added: branches/sparse_build_reduce_mem/ Log: Create a new branch to reduce memory usage when compiling sparsetools_wrap.cxx Copied: branches/sparse_build_reduce_mem (from rev 4004, trunk) From scipy-svn at scipy.org Mon Mar 10 23:35:38 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Mon, 10 Mar 2008 22:35:38 -0500 (CDT) Subject: [Scipy-svn] r4006 - trunk Message-ID: <20080311033538.7935539C013@new.scipy.org> Author: cdavid Date: 2008-03-10 22:35:35 -0500 (Mon, 10 Mar 2008) New Revision: 4006 Modified: trunk/ Log: Initialized merge tracking via "svnmerge" with revisions "1-4005" from http://svn.scipy.org/svn/scipy/branches/sparse_build_reduce_mem Property changes on: trunk ___________________________________________________________________ Name: svnmerge-integrated - /branches/build_with_scons:1-3868 /branches/scipy.scons:1-3533 /branches/testing_cleanup:1-3662 + /branches/build_with_scons:1-3868 /branches/scipy.scons:1-3533 /branches/sparse_build_reduce_mem:1-4005 /branches/testing_cleanup:1-3662 From scipy-svn at scipy.org Mon Mar 10 23:36:22 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Mon, 10 Mar 2008 22:36:22 -0500 (CDT) Subject: [Scipy-svn] r4007 - branches/sparse_build_reduce_mem Message-ID: <20080311033622.F3CBF39C013@new.scipy.org> Author: cdavid Date: 2008-03-10 22:36:19 -0500 (Mon, 10 Mar 2008) New Revision: 4007 Modified: branches/sparse_build_reduce_mem/ Log: Initialized merge tracking via "svnmerge" with revisions "1-4006" from http://svn.scipy.org/svn/scipy/trunk Property changes on: branches/sparse_build_reduce_mem ___________________________________________________________________ Name: svnmerge-integrated - /branches/build_with_scons:1-3868 /branches/scipy.scons:1-3533 /branches/testing_cleanup:1-3662 + /branches/build_with_scons:1-3868 /branches/scipy.scons:1-3533 /branches/testing_cleanup:1-3662 /trunk:1-4006 From scipy-svn at scipy.org Tue Mar 11 03:36:32 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Tue, 11 Mar 2008 02:36:32 -0500 (CDT) Subject: [Scipy-svn] r4008 - branches/build_with_scons/scipy/integrate Message-ID: <20080311073632.0E72C39C0E3@new.scipy.org> Author: cdavid Date: 2008-03-11 02:36:28 -0500 (Tue, 11 Mar 2008) New Revision: 4008 Modified: branches/build_with_scons/scipy/integrate/SConstruct Log: Fix link order for integrate extension. Modified: branches/build_with_scons/scipy/integrate/SConstruct =================================================================== --- branches/build_with_scons/scipy/integrate/SConstruct 2008-03-11 03:36:19 UTC (rev 4007) +++ branches/build_with_scons/scipy/integrate/SConstruct 2008-03-11 07:36:28 UTC (rev 4008) @@ -1,4 +1,4 @@ -# Last Change: Wed Mar 05 03:00 PM 2008 J +# Last Change: Tue Mar 11 04:00 PM 2008 J # vim:syntax=python from os.path import join as pjoin import warnings @@ -41,20 +41,20 @@ src = [str(s) for s in env.NumpyGlob(pjoin('odepack', '*.f'))] odepack = env.NumpyStaticExtLibrary('odepack', source = src) -#env.AppendUnique(LIBS = ['linpack_lite', 'quadpack', 'odepack', 'mach']) env.AppendUnique(LIBPATH = env['build_dir']) +env.AppendUnique(LINKFLAGSEND = env['F77_LDFLAGS']) +quadenv = env.Copy() +quadenv.Prepend(LIBS = ['quadpack', 'linpack_lite', 'mach']) + +odenv = env.Copy() +odenv.Prepend(LIBS = ['odepack', 'linpack_lite', 'mach']) + # Build _quadpack -env.NumpyPythonExtension('_quadpack', source = '_quadpackmodule.c', - LIBS = ['quadpack', 'linpack_lite', 'mach'], - LINKFLAGSEND = env['F77_LDFLAGS']) +quadenv.NumpyPythonExtension('_quadpack', source = '_quadpackmodule.c') # Build _odepack -env.NumpyPythonExtension('_odepack', source = '_odepackmodule.c', - LIBS = ['odepack', 'linpack_lite', 'mach'], - LINKFLAGSEND = env['F77_LDFLAGS']) +odenv.NumpyPythonExtension('_odepack', source = '_odepackmodule.c') # Build vode -env.NumpyPythonExtension('vode', source = 'vode.pyf', - LIBS = ['odepack', 'linpack_lite', 'mach'], - LINKFLAGSEND = env['F77_LDFLAGS']) +odenv.NumpyPythonExtension('vode', source = 'vode.pyf') From scipy-svn at scipy.org Tue Mar 11 09:52:06 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Tue, 11 Mar 2008 08:52:06 -0500 (CDT) Subject: [Scipy-svn] r4009 - branches/build_with_scons/scipy/odr Message-ID: <20080311135206.D1F4C39C1DF@new.scipy.org> Author: cdavid Date: 2008-03-11 08:51:52 -0500 (Tue, 11 Mar 2008) New Revision: 4009 Modified: branches/build_with_scons/scipy/odr/SConstruct Log: Fix link order for odr. Modified: branches/build_with_scons/scipy/odr/SConstruct =================================================================== --- branches/build_with_scons/scipy/odr/SConstruct 2008-03-11 07:36:28 UTC (rev 4008) +++ branches/build_with_scons/scipy/odr/SConstruct 2008-03-11 13:51:52 UTC (rev 4009) @@ -53,9 +53,10 @@ libodr_src.append(pjoin('odrpack', 'd_lpkbls.f')) env.NumpyStaticExtLibrary('odrpack', source = libodr_src) -env.AppendUnique(LIBS = 'odrpack') -env.AppendUnique(LIBPATH = env['build_dir']) +env.PrependUnique(LIBS = 'odrpack') +env.PrependUnique(LIBPATH = env['build_dir']) + # odr pyextension env.NumpyPythonExtension('__odrpack', '__odrpack.c', LINKFLAGSEND = env['F77_LDFLAGS']) From scipy-svn at scipy.org Tue Mar 11 09:52:39 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Tue, 11 Mar 2008 08:52:39 -0500 (CDT) Subject: [Scipy-svn] r4010 - branches/build_with_scons/scipy/interpolate Message-ID: <20080311135239.D234F39C1DF@new.scipy.org> Author: cdavid Date: 2008-03-11 08:52:31 -0500 (Tue, 11 Mar 2008) New Revision: 4010 Modified: branches/build_with_scons/scipy/interpolate/SConstruct Log: Fix link order for interpolate Modified: branches/build_with_scons/scipy/interpolate/SConstruct =================================================================== --- branches/build_with_scons/scipy/interpolate/SConstruct 2008-03-11 13:51:52 UTC (rev 4009) +++ branches/build_with_scons/scipy/interpolate/SConstruct 2008-03-11 13:52:31 UTC (rev 4010) @@ -12,16 +12,16 @@ raise Exception("Could not check F77 runtime, needed for interpolate") config.Finish() -env.AppendUnique(CPPPATH = get_numpy_include_dirs()) -env.AppendUnique(CPPPATH = env['F2PYINCLUDEDIR']) -env.AppendUnique(LINKFLAGS = env['F77_LDFLAGS']) +env.PrependUnique(CPPPATH = get_numpy_include_dirs()) +env.PrependUnique(CPPPATH = env['F2PYINCLUDEDIR']) +env.AppendUnique(LINKFLAGSEND = env['F77_LDFLAGS']) # Build fitpack src = [str(s) for s in env.NumpyGlob(pjoin('fitpack', '*.f'))] fitpack = env.NumpyStaticExtLibrary('fitpack', source = src) -env.AppendUnique(LIBS = ['fitpack']) -env.AppendUnique(LIBPATH = env['build_dir']) +env.PrependUnique(LIBS = ['fitpack']) +env.PrependUnique(LIBPATH = [env['build_dir']]) # Build _fitpack env.NumpyPythonExtension('_fitpack', source = '_fitpackmodule.c') From scipy-svn at scipy.org Tue Mar 11 22:45:48 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Tue, 11 Mar 2008 21:45:48 -0500 (CDT) Subject: [Scipy-svn] r4011 - trunk/scipy/ndimage/src/segment Message-ID: <20080312024548.9A96639C121@new.scipy.org> Author: tom.waite Date: 2008-03-11 21:45:06 -0500 (Tue, 11 Mar 2008) New Revision: 4011 Modified: trunk/scipy/ndimage/src/segment/ndImage_Segmenter_structs.h Log: part 1 re-write of segmenter Modified: trunk/scipy/ndimage/src/segment/ndImage_Segmenter_structs.h =================================================================== --- trunk/scipy/ndimage/src/segment/ndImage_Segmenter_structs.h 2008-03-11 13:52:31 UTC (rev 4010) +++ trunk/scipy/ndimage/src/segment/ndImage_Segmenter_structs.h 2008-03-12 02:45:06 UTC (rev 4011) @@ -92,64 +92,5 @@ // // prototypes // -int NI_RegionGrow(int, int, int, int, int, int, int, double *, unsigned short *, int *); -int NI_TextureMeasures(int, int, int, int, double *, unsigned short *, objStruct objectMetrics[]); -int NI_VoxelMeasures(int, int, int, int, double *, unsigned short *, objStruct objectMetrics[]); -int NI_BuildBoundary(int, int, int, int, unsigned short *, objStruct objectMetrics[]); -int NI_GetObjectStats(int, int, int, unsigned short *, objStruct objectMetrics[]); -int NI_ThinFilter(int, int, int, int, unsigned short *, objStruct objectMetrics[]); -int NI_SobelEdges(int, int, int, double, int, int, int, double, int, double *, unsigned short *, int *); -int NI_ShenCastanEdges(int, int, int, double, double, int, int, int, double *, unsigned short *, int *); -int NI_CannyEdges(int, int, int, double, double, double, int, int, int, double, int, - double *, unsigned short *, int *); -void computeLaws(LawsFilter7, tTEM LawsFeatures[], RECT, int, int, int, int, unsigned char *, float *, - unsigned short *, float *, double *); -float lawsConvolution(float *, float *, float *, int); -void initLaws(LawsFilter7*); -void getVoxelMeasures(objStruct objectMetrics[], double *, unsigned short *, int, int, int); -void getLawsTexture(LawsFilter7, tTEM LawsFeatures[], objStruct objectMetrics[], double *, unsigned short *, int, int, int); - -void morphoFilterBinaryImage(int, int, unsigned short *, int, int); -void buildBinaryImage(int, int, double *, unsigned short *, int, int); -void doRegionGrow(int, int, int, double *, unsigned short *, int, int, int, int); -void buildBoundary(objStruct objectMetrics[], int, unsigned short *, int, int, int); -void getBoundary(unsigned short *, unsigned char *, blobBoundary *, blobBoundary *, - boundaryIndex *, RECT, int, int, int, int, int, int); -void doMorphology(unsigned char *, unsigned char *, unsigned char *, unsigned char *, int olapValuesC[], - int olapValuesO[], unsigned short *, unsigned short *, - RECT, int, int, int, int); -void getCompactness(unsigned char *, RECT, int, int, float *, float); -void OpenCloseFilter(int olapValues[], int, int, int, int, unsigned char *, - unsigned char *, unsigned short *); -void trackBoundary(unsigned char *, blobBoundary lBoundary[], int, int, blobBoundary, int); -void getBoundaryMetrics(bPOINT *, float *, float *, float *, float *, float, float, int); -void generateMask(unsigned char *, bPOINT *, int, int, int); -void ThinningFilter(int, int, int, int *, int *, unsigned char *, - unsigned char *, unsigned char *, unsigned char *, unsigned char *, unsigned char *); -void initThinFilter(int *, int *); -void Shen_Castan(double, double, int, int, int, int, int, double *, unsigned short *); -void computeISEF(float *, float *, int, int, double); -void ISEF_Horizontal(float *, float *, float *, float *, int, int, double); -void ISEF_Vertical(float *, float *, float *, float *, int, int, double); -void thresholdImage(float *, float *, int, int, int, int); -void computeBandedLaplacian(float *, float *, float *, int, int); -void getZeroCrossings(float *, float *, float *, int, int, int); -float adaptiveGradient(float *, float *, int, int, int, int); -void thresholdEdges(float *, unsigned short *, double, int, int); -void estimateThreshold(float *, float *, float, int, int, float *); -void doSobel(int, int, int, double, int, double *, unsigned short *); -void DGFilters(int, int, int, double, int, float *, float *, double *, double *, float *, float *); -void nonMaxSupress(int, int, float, float, double *, double *, int, float *, float *, float *); -void edgeHysteresis(int, int, double, double, float *, float *); -void edgeThreshold(int, int, double, float *, float *); -int traceEdge(int, int, int, int, double, float *, float *); -float magnitude(float, float); -int ConnectedEdgePoints(int, int, unsigned short *); -void doPreProcess(int, int, int, double *, double, int, int, int); -void filter2D(int, int, int, int, int, float *, double *); -void buildKernel(double, int, int, float *); - - - #endif From scipy-svn at scipy.org Tue Mar 11 22:46:51 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Tue, 11 Mar 2008 21:46:51 -0500 (CDT) Subject: [Scipy-svn] r4012 - trunk/scipy/ndimage/src/segment Message-ID: <20080312024651.DB40539C218@new.scipy.org> Author: tom.waite Date: 2008-03-11 21:46:14 -0500 (Tue, 11 Mar 2008) New Revision: 4012 Modified: trunk/scipy/ndimage/src/segment/Segmenter_EXT.c Log: part 1 of segmenter rewrite Modified: trunk/scipy/ndimage/src/segment/Segmenter_EXT.c =================================================================== --- trunk/scipy/ndimage/src/segment/Segmenter_EXT.c 2008-03-12 02:45:06 UTC (rev 4011) +++ trunk/scipy/ndimage/src/segment/Segmenter_EXT.c 2008-03-12 02:46:14 UTC (rev 4012) @@ -2,84 +2,71 @@ #include "Python.h" #include "numpy/arrayobject.h" -static PyObject *Segmenter_CannyEdges(PyObject *self, PyObject *args) +static PyObject *Segmenter_EdgePreFilter(PyObject *self, PyObject *args) { - double sigma; - double cannyLow; - double cannyHigh; - double BPHigh; int lowThreshold; int highThreshold; - int apearture; int num; int nd; int type; - int itype; - int mode; - int groups; + int aperature; + int half_taps; npy_intp *dims; - double *fP1; - unsigned short *fP2; + unsigned short *fP1; + double *fP2; + double *pKernel; PyObject *iArray = NULL; PyObject *eArray = NULL; + PyObject *kernel = NULL; - /* pass in 2D LPF coefficients */ - if(!PyArg_ParseTuple(args, "dddiiidiO", &sigma, &cannyLow, &cannyHigh, - &mode, &lowThreshold, &highThreshold, - &BPHigh, &apearture, &iArray)) + // + // pass in 2D LPF coefficients + if(!PyArg_ParseTuple(args, "iiiOOO", &lowThreshold, &highThreshold, + &half_taps, &kernel, &iArray, &eArray)) goto exit; - fP1 = (double *)PyArray_DATA(iArray); + fP1 = (unsigned short *)PyArray_DATA(iArray); nd = PyArray_NDIM(iArray); dims = PyArray_DIMS(iArray); type = PyArray_TYPE(iArray); num = PyArray_SIZE(iArray); + fP2 = (double *)PyArray_DATA(eArray); + pKernel = (double *)PyArray_DATA(kernel); + aperature = PyArray_SIZE(kernel); - //itype = 4; - itype = NPY_USHORT; - eArray = (PyObject*)PyArray_SimpleNew(nd, dims, itype); - fP2 = (unsigned short *)PyArray_DATA(eArray); - if(!PyArray_ISCONTIGUOUS(iArray) || !PyArray_ISCONTIGUOUS(eArray)) goto exit; - if(!NI_CannyEdges(num, (int)dims[0], (int)dims[1], sigma, cannyLow, - cannyHigh, mode, lowThreshold, - highThreshold, BPHigh, apearture, fP1, fP2, &groups)) + + if(!NI_EdgePreFilter(num, (int)dims[0], (int)dims[1], lowThreshold, + highThreshold, aperature, half_taps, fP1, fP2, pKernel)) + goto exit; exit: - return PyErr_Occurred() ? NULL : (PyObject*)Py_BuildValue("Oi", eArray, - groups); + return PyErr_Occurred() ? NULL : (PyObject*)Py_BuildValue(""); } -static PyObject *Segmenter_SobelEdges(PyObject *self, PyObject *args) + +static PyObject *Segmenter_SobelImage(PyObject *self, PyObject *args) { - double sobelLow; - double BPHigh; - int lowThreshold; - int highThreshold; - int apearture; int num; int nd; int type; - int itype; - int groups; - int mode; npy_intp *dims; double *fP1; - unsigned short *fP2; + double *fP2; + double pAve; + int minValue; + int maxValue; PyObject *iArray = NULL; PyObject *eArray = NULL; - // - // pass in 2D LPF coefficients - if(!PyArg_ParseTuple(args, "diiidiO", &sobelLow, &mode, &lowThreshold, - &highThreshold, &BPHigh, &apearture, &iArray)) + if(!PyArg_ParseTuple(args, "OO", &iArray, &eArray)) goto exit; fP1 = (double *)PyArray_DATA(iArray); @@ -87,51 +74,42 @@ dims = PyArray_DIMS(iArray); type = PyArray_TYPE(iArray); num = PyArray_SIZE(iArray); + fP2 = (double *)PyArray_DATA(eArray); - // this is int type and hard-wirred. pass this in from Python code - //itype = 4; // unsigned short - itype = NPY_USHORT; - eArray = (PyObject*)PyArray_SimpleNew(nd, dims, itype); - fP2 = (unsigned short *)PyArray_DATA(eArray); - if(!PyArray_ISCONTIGUOUS(iArray) || !PyArray_ISCONTIGUOUS(eArray)) goto exit; - if(!NI_SobelEdges(num, (int)dims[0], (int)dims[1], sobelLow, mode, - lowThreshold, highThreshold, BPHigh, apearture, - fP1, fP2, &groups)) + if(!NI_SobelImage(num, (int)dims[0], (int)dims[1], fP1, fP2, &pAve, &minValue, &maxValue)) + goto exit; exit: - return PyErr_Occurred() ? NULL : (PyObject*)Py_BuildValue("Oi", eArray, - groups-1); + return PyErr_Occurred() ? NULL : (PyObject*)Py_BuildValue("dii", pAve, minValue, maxValue); } - -static PyObject *Segmenter_ShenCastanEdges(PyObject *self, PyObject *args) +static PyObject *Segmenter_SobelEdges(PyObject *self, PyObject *args) { - int window; - int lowThreshold; - int highThreshold; - double ShenCastanLow; - double b; + int num; int nd; int type; - int itype; npy_intp *dims; double *fP1; unsigned short *fP2; - int groups; + double pAve; + int minValue; + int maxValue; + int mode; + double sobelLow; PyObject *iArray = NULL; PyObject *eArray = NULL; - if(!PyArg_ParseTuple(args, "ddiiiO", &ShenCastanLow, &b, &window, - &lowThreshold, &highThreshold, &iArray)) + if(!PyArg_ParseTuple(args, "OOdiiid", &iArray, &eArray, &pAve, &minValue, &maxValue, &mode, + &sobelLow)) goto exit; fP1 = (double *)PyArray_DATA(iArray); @@ -139,77 +117,63 @@ dims = PyArray_DIMS(iArray); type = PyArray_TYPE(iArray); num = PyArray_SIZE(iArray); + fP2 = (unsigned short *)PyArray_DATA(eArray); - // this is int type and hard-wirred. pass this in from Python code - //itype = 4; // unsigned short - itype = NPY_USHORT; - eArray = (PyObject*)PyArray_SimpleNew(nd, dims, itype); - fP2 = (unsigned short *)PyArray_DATA(eArray); - if(!PyArray_ISCONTIGUOUS(iArray) || !PyArray_ISCONTIGUOUS(eArray)) goto exit; - if(!NI_ShenCastanEdges(num, (int)dims[0], (int)dims[1], b, ShenCastanLow, - window, lowThreshold, highThreshold, - fP1, fP2, &groups)) + + if(!NI_SobelEdge(num, (int)dims[0], (int)dims[1], fP1, fP2, mode, pAve, minValue, maxValue, sobelLow)) goto exit; exit: - return PyErr_Occurred() ? NULL : (PyObject*)Py_BuildValue("Oi", eArray, - groups-1); + return PyErr_Occurred() ? NULL : (PyObject*)Py_BuildValue(""); } -static PyObject *Segmenter_GetObjectStats(PyObject *self, PyObject *args) -{ +static PyObject *Segmenter_GetBlobs(PyObject *self, PyObject *args) +{ + int num; int nd; int type; npy_intp *dims; - npy_intp *objNumber; unsigned short *fP1; - PyObject *iArray = NULL; - PyObject *nArray = NULL; - objStruct *myData; + unsigned short *fP2; + int groups; + PyObject *iArray = NULL; + PyObject *eArray = NULL; - if(!PyArg_ParseTuple(args, "OO", &iArray, &nArray)) + if(!PyArg_ParseTuple(args, "OO", &iArray, &eArray)) goto exit; - if(!PyArray_ISCONTIGUOUS(iArray) || !PyArray_ISCONTIGUOUS(nArray)) - goto exit; - - // - // PyArray_ContiguousFromObject or PyArray_ContiguousFromAny to be explored - // for non-contiguous - // - - - // pointer to the edge-labeled image + fP1 = (unsigned short *)PyArray_DATA(iArray); nd = PyArray_NDIM(iArray); dims = PyArray_DIMS(iArray); type = PyArray_TYPE(iArray); num = PyArray_SIZE(iArray); - fP1 = (unsigned short *)PyArray_DATA(iArray); + fP2 = (unsigned short *)PyArray_DATA(eArray); - // the object descriptor array that was allocated from numpy - objNumber = PyArray_DIMS(nArray); // this is the number of labels in the edge image - myData = (objStruct*)PyArray_DATA(nArray); + if(!PyArray_ISCONTIGUOUS(iArray) || !PyArray_ISCONTIGUOUS(eArray)) + goto exit; - if(!NI_GetObjectStats((int)dims[0], (int)dims[1], (int)objNumber[0], fP1, myData)) + + if(!NI_GetBlobs(num, (int)dims[0], (int)dims[1], fP1, fP2, &groups)) goto exit; exit: - return PyErr_Occurred() ? NULL : (PyObject*)Py_BuildValue(""); + return PyErr_Occurred() ? NULL : (PyObject*)Py_BuildValue("i", groups); } -static PyObject *Segmenter_MorphoThinFilt(PyObject *self, PyObject *args) +static PyObject *Segmenter_GetBlobRegions(PyObject *self, PyObject *args) { + int num; int nd; int type; @@ -218,68 +182,85 @@ unsigned short *fP1; PyObject *iArray = NULL; PyObject *nArray = NULL; - objStruct *ROIList; + objStruct *myData; if(!PyArg_ParseTuple(args, "OO", &iArray, &nArray)) goto exit; - fP1 = (unsigned short *)PyArray_DATA(iArray); + if(!PyArray_ISCONTIGUOUS(iArray) || !PyArray_ISCONTIGUOUS(nArray)) + goto exit; + + // + // PyArray_ContiguousFromObject or PyArray_ContiguousFromAny to be explored + // for non-contiguous + // + + + // pointer to the edge-labeled image nd = PyArray_NDIM(iArray); dims = PyArray_DIMS(iArray); type = PyArray_TYPE(iArray); num = PyArray_SIZE(iArray); + fP1 = (unsigned short *)PyArray_DATA(iArray); + // the object descriptor array that was allocated from numpy objNumber = PyArray_DIMS(nArray); // this is the number of labels in the edge image - ROIList = (objStruct*)PyArray_DATA(nArray); + myData = (objStruct*)PyArray_DATA(nArray); - if(!PyArray_ISCONTIGUOUS(iArray)) + if(!NI_GetBlobRegions((int)dims[0], (int)dims[1], (int)objNumber[0], fP1, myData)) goto exit; - if(!NI_ThinFilter(num, (int)dims[0], (int)dims[1], (int)objNumber[0], fP1, ROIList)) - goto exit; - exit: return PyErr_Occurred() ? NULL : (PyObject*)Py_BuildValue(""); } -static PyObject *Segmenter_BuildBoundary(PyObject *self, PyObject *args) + +static PyObject *Segmenter_ThinFilter(PyObject *self, PyObject *args) { - int num; - int nd; - int type; - npy_intp *dims; - npy_intp *objNumber; - unsigned short *fP1; + int number_masks; + int roi_rows; + int roi_cols; + int cols; + unsigned char *input; + unsigned char *cinput; + unsigned char *erosion; + unsigned char *dialation; + unsigned char *hmt; + unsigned char *copy; + unsigned short *j_mask; + unsigned short *k_mask; + PyObject *jArray = NULL; + PyObject *kArray = NULL; PyObject *iArray = NULL; - PyObject *nArray = NULL; - objStruct *ROIList; + PyObject *cArray = NULL; + PyObject *eArray = NULL; + PyObject *dArray = NULL; + PyObject *hArray = NULL; + PyObject *pArray = NULL; - if(!PyArg_ParseTuple(args, "OO", &iArray, &nArray)) + if(!PyArg_ParseTuple(args, "OOiiiiOOOOOO", &jArray, &kArray, &number_masks, &roi_rows, + &roi_cols, &cols, &iArray, &cArray, &eArray, &dArray, &hArray, &pArray)) goto exit; - fP1 = (unsigned short *)PyArray_DATA(iArray); - nd = PyArray_NDIM(iArray); - dims = PyArray_DIMS(iArray); - type = PyArray_TYPE(iArray); - num = PyArray_SIZE(iArray); - // - // this is int type and hard-wirred. pass this in from Python code - objNumber = PyArray_DIMS(nArray); // this is the number of labels in the edge image - ROIList = (objStruct*)PyArray_DATA(nArray); + j_mask = (unsigned short *)PyArray_DATA(jArray); + k_mask = (unsigned short *)PyArray_DATA(kArray); + input = (unsigned char *)PyArray_DATA(iArray); + cinput = (unsigned char *)PyArray_DATA(cArray); + erosion = (unsigned char *)PyArray_DATA(eArray); + dialation = (unsigned char *)PyArray_DATA(dArray); + hmt = (unsigned char *)PyArray_DATA(hArray); + copy = (unsigned char *)PyArray_DATA(pArray); + if(!PyArray_ISCONTIGUOUS(iArray)) goto exit; - // - // pass in ROI list and labeled edges - // return an augmented ROI list - // replace the edgeImage with maskImage - // - if(!NI_BuildBoundary(num, (int)dims[0], (int)dims[1], (int)objNumber[0], fP1, ROIList)) + if(!NI_ThinMorphoFilter(roi_rows, roi_cols, cols, number_masks, j_mask, k_mask, + input, cinput, erosion, dialation, hmt, copy)) goto exit; exit: @@ -289,22 +270,26 @@ } -static PyObject *Segmenter_VoxelMeasures(PyObject *self, PyObject *args) +static PyObject *Segmenter_CannyFilter(PyObject *self, PyObject *args) { int num; int nd; int type; + int aperature; npy_intp *dims; - npy_intp *objNumber; double *fP1; - unsigned short *fP2; + double *h_DG_image; + double *v_DG_image; + double *pKernel; + float aveXValue; + float aveYValue; PyObject *iArray = NULL; - PyObject *nArray = NULL; - PyObject *eArray = NULL; - objStruct *ROIList; + PyObject *hArray = NULL; + PyObject *vArray = NULL; + PyObject *kernel = NULL; - if(!PyArg_ParseTuple(args, "OOO", &iArray, &eArray, &nArray)) + if(!PyArg_ParseTuple(args, "OOOOi", &iArray, &hArray, &vArray, &kernel, &aperature)) goto exit; fP1 = (double *)PyArray_DATA(iArray); @@ -313,142 +298,130 @@ type = PyArray_TYPE(iArray); num = PyArray_SIZE(iArray); - // eArray and iArray are same dims - fP2 = (unsigned short *)PyArray_DATA(eArray); + h_DG_image = (double *)PyArray_DATA(hArray); + v_DG_image = (double *)PyArray_DATA(vArray); + pKernel = (double *)PyArray_DATA(kernel); - objNumber = PyArray_DIMS(nArray); // this is the number of labels in the edge image - ROIList = (objStruct*)PyArray_DATA(nArray); - if(!PyArray_ISCONTIGUOUS(iArray)) goto exit; - // - // pass in ROI list and labeled edges - // return an augmented ROI list - // replace the edgeImage with maskImage - // - - if(!NI_VoxelMeasures(num, (int)dims[0], (int)dims[1], (int)objNumber[0], fP1, - fP2, ROIList)) + if(!NI_CannyFilter(num, (int)dims[0], (int)dims[1], fP1, h_DG_image, + v_DG_image, pKernel, aperature, &aveXValue, &aveYValue)) goto exit; exit: - return PyErr_Occurred() ? NULL : (PyObject*)Py_BuildValue(""); + return PyErr_Occurred() ? NULL : (PyObject*)Py_BuildValue("dd", aveXValue, aveYValue); } -static PyObject *Segmenter_TextureMeasures(PyObject *self, PyObject *args) + + + +static PyObject *Segmenter_CannyNonMaxSupress(PyObject *self, PyObject *args) { int num; int nd; int type; + int aperature; + int mode; npy_intp *dims; - npy_intp *objNumber; - double *fP1; - unsigned short *fP2; - PyObject *iArray = NULL; - PyObject *nArray = NULL; - PyObject *eArray = NULL; - objStruct *ROIList; + double *h_DG_image; + double *v_DG_image; + double *magnitude; + double aveXValue; + double aveYValue; + double aveMagnitude; + double canny_low; + double canny_high; + double canny_l; + double canny_h; + PyObject *mArray = NULL; + PyObject *hArray = NULL; + PyObject *vArray = NULL; - if(!PyArg_ParseTuple(args, "OOO", &iArray, &eArray, &nArray)) + if(!PyArg_ParseTuple(args, "OOOidddd", &hArray, &vArray, &mArray, &mode, &aveXValue, + &aveYValue, &canny_l, &canny_h)) goto exit; - fP1 = (double *)PyArray_DATA(iArray); - nd = PyArray_NDIM(iArray); - dims = PyArray_DIMS(iArray); - type = PyArray_TYPE(iArray); - num = PyArray_SIZE(iArray); + magnitude = (double *)PyArray_DATA(mArray); + nd = PyArray_NDIM(mArray); + dims = PyArray_DIMS(mArray); + type = PyArray_TYPE(mArray); + num = PyArray_SIZE(mArray); - // eArray and iArray are same dims - fP2 = (unsigned short *)PyArray_DATA(eArray); + h_DG_image = (double *)PyArray_DATA(hArray); + v_DG_image = (double *)PyArray_DATA(vArray); - objNumber = PyArray_DIMS(nArray); // this is the number of labels in the edge image - ROIList = (objStruct*)PyArray_DATA(nArray); - - if(!PyArray_ISCONTIGUOUS(iArray)) + if(!PyArray_ISCONTIGUOUS(mArray)) goto exit; - // - // pass in ROI list and labeled edges - // return an augmented ROI list - // replace the edgeImage with maskImage - // - - if(!NI_TextureMeasures(num, (int)dims[0], (int)dims[1], (int)objNumber[0], fP1, - fP2, ROIList)) + if(!NI_CannyNonMaxSupress(num, (int)dims[0], (int)dims[1], magnitude, h_DG_image, + v_DG_image, mode, aveXValue, aveYValue, &aveMagnitude, + &canny_low, &canny_high, canny_l, canny_h)) goto exit; exit: - return PyErr_Occurred() ? NULL : (PyObject*)Py_BuildValue(""); + return PyErr_Occurred() ? NULL : (PyObject*)Py_BuildValue("ddd", aveMagnitude, canny_low, canny_high); } -static PyObject *Segmenter_RegionGrow(PyObject *self, PyObject *args) + + +static PyObject *Segmenter_CannyHysteresis(PyObject *self, PyObject *args) { - int lowThreshold; - int highThreshold; - int closeWindow; - int openWindow; int num; int nd; int type; - int itype; - int groups; + int aperature; + int mode; npy_intp *dims; - double *fP1; - unsigned short *fP2; - PyObject *iArray = NULL; - PyObject *eArray = NULL; + double *magnitude; + unsigned short *hys_image; + double canny_low; + double canny_high; + PyObject *mArray = NULL; + PyObject *hArray = NULL; - // - // pass in 2D LPF coefficients - if(!PyArg_ParseTuple(args, "iiiiO", &lowThreshold, &highThreshold, &closeWindow, - &openWindow, &iArray)) + if(!PyArg_ParseTuple(args, "OOdd", &mArray, &hArray, &canny_low, &canny_high)) goto exit; - fP1 = (double *)PyArray_DATA(iArray); - nd = PyArray_NDIM(iArray); - dims = PyArray_DIMS(iArray); - type = PyArray_TYPE(iArray); - num = PyArray_SIZE(iArray); + magnitude = (double *)PyArray_DATA(mArray); + nd = PyArray_NDIM(mArray); + dims = PyArray_DIMS(mArray); + type = PyArray_TYPE(mArray); + num = PyArray_SIZE(mArray); - // this is int type and hard-wirred. pass this in from Python code - //itype = 4; // unsigned short - itype = NPY_USHORT; - eArray = (PyObject*)PyArray_SimpleNew(nd, dims, itype); - fP2 = (unsigned short *)PyArray_DATA(eArray); + hys_image = (unsigned short *)PyArray_DATA(hArray); - if(!PyArray_ISCONTIGUOUS(iArray) || !PyArray_ISCONTIGUOUS(eArray)) + if(!PyArray_ISCONTIGUOUS(mArray)) goto exit; - - if(!NI_RegionGrow(num, (int)dims[0], (int)dims[1], lowThreshold, highThreshold, - closeWindow, openWindow, fP1, fP2, &groups)) - + if(!NI_CannyHysteresis(num, (int)dims[0], (int)dims[1], magnitude, hys_image, + canny_low, canny_high)) goto exit; exit: - return PyErr_Occurred() ? NULL : (PyObject*)Py_BuildValue("Oi", eArray, groups-1); + return PyErr_Occurred() ? NULL : (PyObject*)Py_BuildValue(""); } + static PyMethodDef SegmenterMethods[] = { - { "canny_edges", Segmenter_CannyEdges, METH_VARARGS, NULL }, - { "shen_castan_edges", Segmenter_ShenCastanEdges, METH_VARARGS, NULL }, - { "sobel_edges", Segmenter_SobelEdges, METH_VARARGS, NULL }, - { "get_object_stats", Segmenter_GetObjectStats, METH_VARARGS, NULL }, - { "morpho_thin_filt", Segmenter_MorphoThinFilt, METH_VARARGS, NULL }, - { "build_boundary", Segmenter_BuildBoundary, METH_VARARGS, NULL }, - { "voxel_measures", Segmenter_VoxelMeasures, METH_VARARGS, NULL }, - { "texture_measures", Segmenter_TextureMeasures, METH_VARARGS, NULL }, - { "region_grow", Segmenter_RegionGrow, METH_VARARGS, NULL }, + { "canny_hysteresis", Segmenter_CannyHysteresis, METH_VARARGS, NULL }, + { "canny_nonmax_supress", Segmenter_CannyNonMaxSupress, METH_VARARGS, NULL }, + { "canny_filter", Segmenter_CannyFilter, METH_VARARGS, NULL }, + { "sobel_edges", Segmenter_SobelEdges, METH_VARARGS, NULL }, + { "sobel_image", Segmenter_SobelImage, METH_VARARGS, NULL }, + { "edge_prefilter", Segmenter_EdgePreFilter, METH_VARARGS, NULL }, + { "get_blobs", Segmenter_GetBlobs, METH_VARARGS, NULL }, + { "get_blob_regions", Segmenter_GetBlobRegions, METH_VARARGS, NULL }, + { "thin_filter", Segmenter_ThinFilter, METH_VARARGS, NULL }, { NULL, NULL, 0, NULL}, }; @@ -458,3 +431,7 @@ import_array(); } + + + + From scipy-svn at scipy.org Tue Mar 11 22:47:20 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Tue, 11 Mar 2008 21:47:20 -0500 (CDT) Subject: [Scipy-svn] r4013 - trunk/scipy/ndimage/src/segment Message-ID: <20080312024720.DC92439C218@new.scipy.org> Author: tom.waite Date: 2008-03-11 21:47:17 -0500 (Tue, 11 Mar 2008) New Revision: 4013 Modified: trunk/scipy/ndimage/src/segment/Segmenter_IMPL.c Log: phase 1 of segmenter rewrite Modified: trunk/scipy/ndimage/src/segment/Segmenter_IMPL.c =================================================================== --- trunk/scipy/ndimage/src/segment/Segmenter_IMPL.c 2008-03-12 02:46:14 UTC (rev 4012) +++ trunk/scipy/ndimage/src/segment/Segmenter_IMPL.c 2008-03-12 02:47:17 UTC (rev 4013) @@ -10,123 +10,25 @@ #define FALSE 0 #define TRUE 1 -int NI_GetObjectStats(int rows, int cols, int numberObjects, unsigned short *labeledEdges, - objStruct objectMetrics[]){ - int i, j, k, m; - int offset; - int count; - int LowX; - int LowY; - int HighX; - int HighY; - int status; - float centerX; - float centerY; +int NI_EdgePreFilter(int num, int rows, int cols, int lowThreshold, int highThreshold, + int aperature, int HalfFilterTaps, unsigned short *sImage, double *dImage, double *kernel){ - for(k = 1; k < numberObjects; ++k){ - offset = cols; - LowX = 32767; - LowY = 32767; - HighX = 0; - HighY = 0; - count = 0; - centerX = (float)0.0; - centerY = (float)0.0; - for(i = 1; i < (rows-1); ++i){ - for(j = 1; j < (cols-1); ++j){ - m = labeledEdges[offset+j]; - if(k == m){ - if(i < LowY) LowY = i; - if(j < LowX) LowX = j; - if(i > HighY) HighY = i; - if(j > HighX) HighX = j; - centerX += (float)j; - centerY += (float)i; - ++count; - } - } - offset += cols; - } - /* the bounding box for the 2D blob */ - objectMetrics[k-1].L = LowX; - objectMetrics[k-1].R = HighX; - objectMetrics[k-1].B = LowY; - objectMetrics[k-1].T = HighY; - objectMetrics[k-1].Area = count; - objectMetrics[k-1].cX = centerX/(float)count; - objectMetrics[k-1].cY = centerY/(float)count; - objectMetrics[k-1].Label = k; - } - - status = numberObjects; - return status; - -} - - -void buildKernel(double BPHigh, int HalfFilterTaps, int apearture, float *kernel){ - - int i, j; - float r, t1, t2, t3, t4; - float LC, HC, tLOW, tHIGH; - float pi = (float)3.14159, rad = (float)0.01745; - - LC = (float)0.0; - HC = BPHigh * rad; - t2 = (float)2.0*pi; - t1 = (float)2.0*HalfFilterTaps + (float)1.0; - /* - // build the Filter Kernel - // the kernel starts at 1 only because it is linked to the internal filter2D routine - // the code is not a Fortran code - */ - j = 1; - for(i = -HalfFilterTaps; i <= HalfFilterTaps; ++i){ - r = (float)i; - if(r == (float)0.0){ - tLOW = LC; - tHIGH = HC; - } - else{ - tLOW = (float)(sin(r*LC))/r; - tHIGH = (float)(sin(r*HC))/r; - } - t3 = (float)0.54 + (float)0.46*((float)cos(r*t2/t1)); - t4 = t3*(tHIGH-tLOW); - kernel[j++] = t4; - } - - /* normalize the kernel so unity gain (as is LP filter this is easy) */ - t1 = (float)0.0; - for(j = 1; j <= apearture; ++j){ - t1 += kernel[j]; - } - for(j = 1; j <= apearture; ++j){ - kernel[j] /= t1; - } - - t1 = (float)0.0; - for(j = 1; j <= apearture; ++j){ - t1 += kernel[j]; - } - return; -} - -void filter2D(int HalfFilterTaps, int rows, int cols, int lowThreshold, int highThreshold, - float *kernel, double *Image){ - int i, j, k, n, num1; int offset; - float sum, value; - float buffer[1024]; + double sum, value; + double *buffer; + int max_buffer = MAX(rows, cols); + int status; - num1 = HalfFilterTaps + 1; + buffer = calloc(max_buffer+aperature+16, sizeof(double)); + + num1 = HalfFilterTaps; offset = 0; for(i = 0; i < rows; ++i){ /* copy image row to local buffer */ for(j = 0; j < cols; ++j){ - buffer[num1+j] = Image[offset+j]; + buffer[num1+j] = sImage[offset+j]; } /* constant pad the ends of the buffer */ for(j = 0; j < num1; ++j){ @@ -142,7 +44,7 @@ for(k = 1; k < num1; ++k){ sum += kernel[num1-k] * (buffer[j+k] + buffer[j-k]); } - Image[offset+n] = sum; + dImage[offset+n] = sum; } offset += cols; } @@ -152,7 +54,7 @@ /* copy image column to local buffer */ offset = 0; for(j = 0; j < rows; ++j){ - buffer[num1+j] = Image[offset+i]; + buffer[num1+j] = dImage[offset+i]; offset += cols; } /* constant pad the ends of the buffer */ @@ -170,7 +72,7 @@ for(k = 1; k < num1; ++k){ sum += kernel[num1-k] * (buffer[j+k] + buffer[j-k]); } - Image[offset+i] = sum; + dImage[offset+i] = sum; offset += cols; } } @@ -179,46 +81,130 @@ offset = 0; for(i = 0; i < rows; ++i){ for(j = 0; j < cols; ++j){ - value = Image[offset+j]; + value = dImage[offset+j]; if(value < (float)lowThreshold) value = (float)0.0; if(value > (float)highThreshold) value = (float)0.0; - Image[offset+j] = value; + dImage[offset+j] = value; } offset += cols; } - return; + free(buffer); + status = 1; + + return(status); + } -void doPreProcess(int samples, int rows, int cols, double *rawImage, double BPHigh, - int apearture, int lowThreshold, int highThreshold){ +int NI_SobelImage(int samples, int rows, int cols, double *rawImage, double *edgeImage, double *pAve, + int *minValue, int *maxValue){ + + int i, j; + int p, m, n; + int offset; + int offsetM1; + int offsetP1; + int status; + int count = 0; /* - // 2D low pass filter using bisinc and threshold - // this specific example is on cardiac CT and focuses on segmenting the - // aorta and blood-filled chambers. for MRI the threshold will be different + // Sobel */ + offset = cols; + *pAve = 0.0; + *minValue = 10000; + *maxValue = -10000; + for(i = 1; i < rows-1; ++i){ + offsetM1 = offset - cols; + offsetP1 = offset + cols; + for(j = 1; j < cols-1; ++j){ + n = 2*rawImage[offsetM1+j] + rawImage[offsetM1+j-1] + rawImage[offsetM1+j+1] - + 2*rawImage[offsetP1+j] - rawImage[offsetP1+j-1] - rawImage[offsetP1+j+1]; + m = 2*rawImage[offset+j-1] + rawImage[offsetM1+j-1] + rawImage[offsetP1+j-1] - + 2*rawImage[offset+j+1] - rawImage[offsetM1+j+1] - rawImage[offsetP1+j+1]; + p = (int)sqrt((float)(m*m) + (float)(n*n)); + if(p > 0){ + *pAve += p; + if(p > *maxValue) *maxValue = p; + if(p < *minValue) *minValue = p; + ++count; + } + edgeImage[offset+j] = p; + } + offset += cols; + } + /* threshold based on ave */ + *pAve /= count; - float *kernel; - int HalfFilterTaps = (apearture-1)/2; - kernel = calloc(apearture+16, sizeof(float)); + status = 1; - buildKernel(BPHigh, HalfFilterTaps, apearture, kernel); - filter2D(HalfFilterTaps, rows, cols, lowThreshold, highThreshold, kernel, rawImage); + return(status); - free(kernel); +} - return; -} +int NI_SobelEdge(int samples, int rows, int cols, double *edgeImage, unsigned short *edges, + int mode, double pAve, int minValue, int maxValue, double sobelLow){ + int i, j; + int offset; + int value; + int maxIndex; + int status; + int histogram[256]; + float pThreshold; + double scale; + double step; -int ConnectedEdgePoints(int rows, int cols, unsigned short *connectedEdges){ + scale = 1.0 / maxValue; + step = 255.0/(maxValue-minValue); + for(i = 0; i < 256; ++i){ + histogram[i] = 0; + } + offset = 0; + for(i = 0; i < rows; ++i){ + for(j = 0; j < cols; ++j){ + value = (int)(step*(edgeImage[offset+j]-minValue)); + ++histogram[value]; + } + offset += cols; + } + + if(mode == 1){ + /* based on the mean value of edge energy */ + pThreshold = (int)(sobelLow * (float)pAve); + } + else{ + /* based on the mode value of edge energy */ + pThreshold = (sobelLow * (minValue + ((float)maxIndex/step))); + } + + offset = 0; + for(i = 0; i < rows; ++i){ + for(j = 0; j < cols; ++j){ + if(edgeImage[offset+j] > pThreshold){ + edges[offset+j] = 1; + } + else{ + edges[offset+j] = 0; + } + } + offset += cols; + } + + status = 1; + return(status); + +} + +int NI_GetBlobs(int samples, int rows, int cols, unsigned short *edges, unsigned short *connectedEdges, int *groups){ + int i, j, k, l, m; int offset; int Label; + int status; int Classes[4096]; bool NewLabel; bool Change; @@ -231,7 +217,8 @@ offset = 0; for(i = 0; i < rows; ++i){ for(j = 0; j < cols; ++j){ - if(connectedEdges[offset+j] == 1){ + connectedEdges[offset+j] = 0; + if(edges[offset+j] == 1){ connectedEdges[offset+j] = Label++; } } @@ -344,1277 +331,86 @@ offset += cols; } - return Label; -} + *groups = Label; -float magnitude(float X, float Y){ - - return (float)sqrt(X*X + Y*Y); -} - -int traceEdge(int i, int j, int rows, int cols, double cannyLow, float *magImage, - float *HYSImage){ - - int n, m; - int ptr; - int flag; - - ptr = i * cols; - if(HYSImage[ptr+j] == (float)0.0){ - /* - // this point is above high threshold - */ - HYSImage[ptr+j] = (float)1.0; - flag = 0; - for(n = -1; n <= 1; ++n){ - for(m = -1; m <= 1; ++m){ - if(n == 0 && m == 0) continue; - if(((i+n) > 0) && ((j+m) > 0) && ((i+n) < rows) && ((j+m) < cols)){ - ptr = (i+n) * cols; - if(magImage[ptr+j+m] > cannyLow){ - /* - // this point is above low threshold - */ - if(traceEdge(i+n, j+m, rows, cols, cannyLow, magImage, HYSImage)){ - flag = 1; - break; - } - } - } - } - if(flag) break; - } - return(1); - } - - return(0); - -} - - -void edgeThreshold(int rows, int cols, double cannyLow, float *magImage, - float *HYSImage){ - - int i, j; - int ptr; - - for(i = 0; i < rows; ++i){ - ptr = i * cols; - for(j = 0; j < cols; ++j){ - if(magImage[ptr+j] > cannyLow){ - HYSImage[ptr+j] = (float)1.0; - } - } - } - - return; - -} - -void edgeHysteresis(int rows, int cols, double cannyLow, double cannyHigh, - float *magImage, float *HYSImage){ - - int i, j; - int ptr; - - for(i = 0; i < rows; ++i){ - ptr = i * cols; - for(j = 0; j < cols; ++j){ - if(magImage[ptr+j] > cannyHigh){ - traceEdge(i, j, rows, cols, cannyLow, magImage, HYSImage); - } - } - } - - return; - -} - -void nonMaxSupress(int rows, int cols, float aveXValue, float aveYValue, - double *cannyLow, double *cannyHigh, int mode, - float *hDGImage, float *vDGImage, float *magImage){ - - int i, j; - int ptr, ptr_m1, ptr_p1; - float xSlope, ySlope, G1, G2, G3, G4, G, xC, yC; - float scale; - float maxValue = (float)0.0; - float minValue = (float)-1.0; - int histogram[256]; - int value; - int mValue; - int mIndex; - int count; - double step; - double tAve; - - for(i = 1; i < rows-1; ++i){ - ptr = i * cols; - ptr_m1 = ptr - cols; - ptr_p1 = ptr + cols; - for(j = 1; j < cols; ++j){ - magImage[ptr+j] = (float)0.0; - xC = hDGImage[ptr+j]; - yC = vDGImage[ptr+j]; - if((fabs(xC) < aveXValue) && (fabs(yC) < aveYValue)) continue; - G = magnitude(xC, yC); - if(fabs(yC) > fabs(xC)){ - /* vertical gradient */ - xSlope = (float)(fabs(xC) / fabs(yC)); - ySlope = (float)1.0; - G2 = magnitude(hDGImage[ptr_m1+j], vDGImage[ptr_m1+j]); - G4 = magnitude(hDGImage[ptr_p1+j], vDGImage[ptr_p1+j]); - if((xC*yC) > (float)0.0){ - G1 = magnitude(hDGImage[ptr_m1+j-1], vDGImage[ptr_m1+j-1]); - G3 = magnitude(hDGImage[ptr_p1+j+1], vDGImage[ptr_p1+j+1]); - } - else{ - G1 = magnitude(hDGImage[ptr_m1+j+1], vDGImage[ptr_m1+j+1]); - G3 = magnitude(hDGImage[ptr_p1+j-1], vDGImage[ptr_p1+j-1]); - } - } - else{ - /* horizontal gradient */ - xSlope = (float)(fabs(yC) / fabs(xC)); - ySlope = (float)1.0; - G2 = magnitude(hDGImage[ptr+j+1], vDGImage[ptr+j+1]); - G4 = magnitude(hDGImage[ptr+j-1], vDGImage[ptr+j-1]); - if((xC*yC) > (float)0.0){ - G1 = magnitude(hDGImage[ptr_p1+j+1], vDGImage[ptr_p1+j+1]); - G3 = magnitude(hDGImage[ptr_m1+j-1], vDGImage[ptr_m1+j-1]); - } - else{ - G1 = magnitude(hDGImage[ptr_m1+j+1], vDGImage[ptr_m1+j+1]); - G3 = magnitude(hDGImage[ptr_p1+j-1], vDGImage[ptr_p1+j-1]); - } - } - if((G > (xSlope*G1+(ySlope-xSlope)*G2))&&(G > (xSlope*G3+(ySlope-xSlope)*G4))){ - magImage[ptr+j] = G; - } - if(magImage[ptr+j] > maxValue) maxValue = magImage[ptr+j]; - if(magImage[ptr+j] < minValue) minValue = magImage[ptr+j]; - } - } - - scale = (float)1.0 / (maxValue-minValue); - ptr = 0; - count = 0; - tAve = 0.0; - for(i = 0; i < rows; ++i){ - for(j = 0; j < cols; ++j){ - magImage[ptr] = scale * (magImage[ptr]-minValue); - if(magImage[ptr] > 0.0){ - tAve += magImage[ptr]; - ++count; - } - ++ptr; - } - } - tAve /= (float)count; - - step = 255.0; - for(i = 0; i < 256; ++i){ - histogram[i] = 0; - } - ptr = 0; - for(i = 0; i < rows; ++i){ - for(j = 0; j < cols; ++j){ - value = (int)(step*(magImage[ptr])); - ++histogram[value]; - ++ptr; - } - } /* - // now get the max after skipping the low values - */ - mValue = -1; - mIndex = 0; - for(i = 10; i < 256; ++i){ - if(histogram[i] > mValue){ - mValue = histogram[i]; - mIndex = i; - } - } - - if(mode == 1){ - /* based on the mean value of edge energy */ - *cannyLow = ((*cannyLow) * tAve); - *cannyHigh = ((*cannyHigh) * tAve); - } - else{ - /* based on the mode value of edge energy */ - *cannyLow = ((*cannyLow) * ((float)mIndex/step)); - *cannyHigh = ((*cannyHigh) * ((float)mIndex/step)); - } - - return; - -} - -void DGFilters(int samples, int rows, int cols, double cannySigma, int gWidth, - float *aveXValue, float *aveYValue, double *rawImage, - double *dgKernel, float *hDGImage, float *vDGImage){ - - /* - // implements the derivative of Gaussian filter. kernel set by CannyEdges - */ - int i, j, k; - int ptr; - int mLength; - int count; - float *tBuffer = NULL; - double sum; - - *aveXValue = (float)0.0; - *aveYValue = (float)0.0; - - mLength = MAX(rows, cols) + 64; - tBuffer = calloc(mLength, sizeof(float)); - - /* - // filter X - */ - count = 0; - for(i = 0; i < rows; ++i){ - ptr = i * cols; - for(j = gWidth; j < cols-gWidth; ++j){ - sum = dgKernel[0] * rawImage[ptr+j]; - for(k = 1; k < gWidth; ++k){ - sum += dgKernel[k] * (-rawImage[ptr+j+k] + rawImage[ptr+j-k]); - } - hDGImage[ptr+j] = (float)sum; - if(sum != (float)0.0){ - ++count; - *aveXValue += (float)fabs(sum); - } - } - } - if(count){ - *aveXValue /= (float)count; - *aveXValue = (float)0.5 * (*aveXValue); - /* this is 50% of the max, hardwirred for now, and is part of the threshold */ - } - /* - // filter Y - */ - count = 0; - for(i = 0; i < cols; ++i){ - for(j = 0; j < rows; ++j){ - ptr = j * cols; - tBuffer[j] = rawImage[ptr+i]; - } - for(j = gWidth; j < rows-gWidth; ++j){ - ptr = j * cols; - sum = dgKernel[0] * tBuffer[j]; - for(k = 1; k < gWidth; ++k){ - sum += dgKernel[k] * (-tBuffer[j+k] + tBuffer[j-k]); - } - vDGImage[ptr+i] = sum; - if(sum != (float)0.0){ - ++count; - *aveYValue += (float)fabs(sum); - } - } - } - if(count){ - *aveYValue /= (float)count; - *aveYValue = (float)0.5 * (*aveYValue); - /* this is 50% of the max, hardwirred for now, and is part of the threshold */ - } - - free(tBuffer); - - return; - -} - - -int NI_CannyEdges(int samples, int rows, int cols, double cannySigma, - double cannyLow, double cannyHigh, int mode, - int lowThreshold, int highThreshold, double BPHigh, - int apearture, double *rawImage, - unsigned short *edgeImage, int *groups){ - - int i, j; - int offset; - int doHysteresis = 0; - int gWidth; - int mLength; - int status; - float aveXValue; - float aveYValue; - double t; - double dgKernel[20]; - float *HYSImage = NULL; - float *hDGImage = NULL; - float *vDGImage = NULL; - float *magImage = NULL; - float *tBuffer = NULL; - - /* filter */ - doPreProcess(samples, rows, cols, rawImage, BPHigh, apearture, lowThreshold, highThreshold); - - /* - // memory for magnitude, horizontal and vertical derivative of Gaussian filter - */ - mLength = MAX(rows, cols) + 64; - HYSImage = calloc(samples, sizeof(float)); - hDGImage = calloc(samples, sizeof(float)); - vDGImage = calloc(samples, sizeof(float)); - magImage = calloc(samples, sizeof(float)); - tBuffer = calloc(mLength, sizeof(float)); - - /* - // build derivative of Gaussian filter kernel - // kernel is anti-symmetric so convolution is k[j]*(v[i+j] - v[i-j]) - */ - gWidth = 20; - for(i = 0; i < gWidth; ++i){ - t = (float)i; - dgKernel[i] = (float)exp((double)((-t*t)/((float)2.0 * cannySigma * cannySigma))); - dgKernel[i] *= -(t / (cannySigma * cannySigma)); - } - for(i = 0; i < samples; ++i){ - HYSImage[i] = (float)0.0; - } - - DGFilters(samples, rows, cols, cannySigma, gWidth, &aveXValue, &aveYValue, - rawImage, dgKernel, hDGImage, vDGImage); - nonMaxSupress(rows, cols, aveXValue, aveYValue, &cannyLow, &cannyHigh, - mode, hDGImage, vDGImage, magImage); - if(doHysteresis){ - edgeHysteresis(rows, cols, cannyLow, cannyHigh, magImage, HYSImage); - } - else{ - edgeThreshold(rows, cols, cannyLow, magImage, HYSImage); - } - - /* - // edge image - */ - for(i = 0; i < samples; ++i){ - edgeImage[i] = (unsigned short)HYSImage[i]; - } - *groups = ConnectedEdgePoints(rows, cols, edgeImage); - - /* // prune the isolated pixels */ offset = 0; for(i = 0; i < rows; ++i){ for(j = 0; j < cols; ++j){ - if(edgeImage[offset+j] > (*groups)){ - edgeImage[offset+j] = 0; + if(connectedEdges[offset+j] > (*groups)){ + connectedEdges[offset+j] = 0; } } offset += cols; } + status = 1; + return(status); - free(tBuffer); - free(hDGImage); - free(vDGImage); - free(magImage); - free(HYSImage); - - status = *groups; - return status; - } -void doSobel(int samples, int rows, int cols, double sobelLow, int mode, - double *rawImage, unsigned short *edgeImage){ +int NI_GetBlobRegions(int rows, int cols, int numberObjects, unsigned short *labeledEdges, + objStruct objectMetrics[]){ - int i, j; - int p, m, n; + int i, j, k, m; int offset; - int offsetM1; - int offsetP1; - int minValue, maxValue; - int pAve = 0; - int count = 0; - int histogram[256]; - int value; - int maxIndex; - float pThreshold; - double scale; - double step; - float *filteredImage = NULL; + int count; + int LowX; + int LowY; + int HighX; + int HighY; + int status; + float centerX; + float centerY; - filteredImage = calloc(samples, sizeof(float)); - - minValue = 10000; - maxValue = -10000; - - offset = 0; - for(i = 0; i < rows; ++i){ - for(j = 0; j < cols; ++j){ - filteredImage[offset+j] = 0; - edgeImage[offset+j] = 0; - } - offset += cols; - } - - /* - // Sobel - */ - offset = cols; - for(i = 1; i < rows-1; ++i){ - offsetM1 = offset - cols; - offsetP1 = offset + cols; - for(j = 1; j < cols-1; ++j){ - n = 2*rawImage[offsetM1+j] + rawImage[offsetM1+j-1] + rawImage[offsetM1+j+1] - - 2*rawImage[offsetP1+j] - rawImage[offsetP1+j-1] - rawImage[offsetP1+j+1]; - m = 2*rawImage[offset+j-1] + rawImage[offsetM1+j-1] + rawImage[offsetP1+j-1] - - 2*rawImage[offset+j+1] - rawImage[offsetM1+j+1] - rawImage[offsetP1+j+1]; - p = (int)sqrt((float)(m*m) + (float)(n*n)); - if(p > 0){ - pAve += p; - ++count; - if(p > maxValue) maxValue = p; - if(p < minValue) minValue = p; + for(k = 1; k < numberObjects; ++k){ + offset = cols; + LowX = 32767; + LowY = 32767; + HighX = 0; + HighY = 0; + count = 0; + centerX = (float)0.0; + centerY = (float)0.0; + for(i = 1; i < (rows-1); ++i){ + for(j = 1; j < (cols-1); ++j){ + m = labeledEdges[offset+j]; + if(k == m){ + if(i < LowY) LowY = i; + if(j < LowX) LowX = j; + if(i > HighY) HighY = i; + if(j > HighX) HighX = j; + centerX += (float)j; + centerY += (float)i; + ++count; + } } - filteredImage[offset+j] = p; + offset += cols; } - offset += cols; + /* the bounding box for the 2D blob */ + objectMetrics[k-1].L = LowX; + objectMetrics[k-1].R = HighX; + objectMetrics[k-1].B = LowY; + objectMetrics[k-1].T = HighY; + objectMetrics[k-1].Area = count; + objectMetrics[k-1].cX = centerX/(float)count; + objectMetrics[k-1].cY = centerY/(float)count; + objectMetrics[k-1].Label = k; } - /* threshold based on ave */ - pAve /= count; - scale = 1.0 / maxValue; - - step = 255.0/(maxValue-minValue); - for(i = 0; i < 256; ++i){ - histogram[i] = 0; - } - offset = 0; - for(i = 0; i < rows; ++i){ - for(j = 0; j < cols; ++j){ - value = (int)(step*(filteredImage[offset+j]-minValue)); - ++histogram[value]; - } - offset += cols; - } - /* - // now get the max after skipping the low values - */ - maxValue = -1; - maxIndex = 0; - for(i = 10; i < 256; ++i){ - if(histogram[i] > maxValue){ - maxValue = histogram[i]; - maxIndex = i; - } - } - - if(mode == 1){ - /* based on the mean value of edge energy */ - pThreshold = (int)(sobelLow * (float)pAve); - } - else{ - /* based on the mode value of edge energy */ - pThreshold = (sobelLow * (minValue + ((float)maxIndex/step))); - } - - offset = 0; - for(i = 0; i < rows; ++i){ - for(j = 0; j < cols; ++j){ - if(filteredImage[offset+j] > pThreshold){ - edgeImage[offset+j] = 1; - } - else{ - edgeImage[offset+j] = 0; - } - filteredImage[offset+j] *= scale; - } - offset += cols; - } - - free(filteredImage); - - return; - - -} - -void estimateThreshold(float *lowThreshold, float *highThreshold, float ShenCastanLow, - int rows, int cols, float *SourceImage){ - - int i, j; - int offset; - int value; - int mIndex; - int histogram[256]; - float low, high; - float scale; - - low = (float)1000.0; - high = (float)-1000.0; - - offset = 0; - for(i = 0; i < rows; ++i){ - for(j = 0; j < cols; ++j){ - if(fabs(SourceImage[offset+j]) > high) high = fabs(SourceImage[offset+j]); - if(fabs(SourceImage[offset+j]) < low) low = fabs(SourceImage[offset+j]); - } - offset += cols; - } - - scale = (float)255.0 / (high-low); - for(i = 0; i < 256; ++i){ - histogram[i] = 0; - } - offset = 0; - for(i = 0; i < rows; ++i){ - for(j = 0; j < cols; ++j){ - value = (int)(scale*(fabs(SourceImage[offset+j]) - low)); - ++histogram[value]; - } - offset += cols; - } - - /* - // now get the edge energy mode - */ - value = 0; - mIndex = 10; - for(i = 10; i < 256; ++i){ - if(histogram[i] > value){ - value = histogram[i]; - mIndex = i; - } - } - - *highThreshold = ((float)mIndex / scale) + low; - *lowThreshold = ((float)mIndex / scale) + low; - - *highThreshold *= ShenCastanLow; - *lowThreshold *= ShenCastanLow; - - return; - -} - -void thresholdEdges(float *SourceImage, unsigned short *EdgeImage, double ShenCastanLow, - int rows, int cols){ - - int i, j; - int offset; - float tLow, tHigh; - - /* - // SourceImage contains the adaptive gradient - // get threshold from the mode of the edge energy - */ - estimateThreshold(&tLow, &tHigh, ShenCastanLow, rows, cols, SourceImage); - - offset = 0; - for(i = 0; i < rows; ++i){ - for(j = 0; j < cols; ++j){ - if(SourceImage[offset+j] > tLow){ - EdgeImage[offset+j] = 1; - } - else{ - EdgeImage[offset+j] = 0; - } - } - offset += cols; - } - - return; - -} - -float adaptiveGradient(float *BLImage, float *FilterImage, int nrow, int ncol, - int cols, int window){ - - int i, j; - int offset; - int numOn, numOff; - int hWindow = window/2; - float sumOn, sumOff; - float aveOn, aveOff; - - numOn = 0; - numOff = 0; - - sumOn = (float)0.0; - sumOff = (float)0.0; - - aveOn = (float)0.0; - aveOff = (float)0.0; - - offset = nrow * cols; - for(i = -hWindow; i < hWindow; ++i){ - for(j = -hWindow; j < hWindow; ++j){ - if(BLImage[offset+(i*cols)+(j+ncol)] == 1){ - sumOn += FilterImage[offset+(i*cols)+(j+ncol)]; - ++numOn; - } - else{ - sumOff += FilterImage[offset+(i*cols)+(j+ncol)]; - ++numOff; - } - } - } - - if(numOn){ - aveOn = sumOn / numOn; - } - - if(numOff){ - aveOff = sumOff / numOff; - } - - return (aveOff-aveOn); - -} - -void getZeroCrossings(float *SourceImage, float *FilterImage, float *BLImage, - int rows, int cols, int window){ - - int i, j; - int offset; - bool validEdge; - - offset = 0; - for(i = 0; i < rows; ++i){ - for(j = 0; j < cols; ++j){ - SourceImage[offset+j] = 0.0; - } - offset += cols; - } - - offset = window*cols; - for(i = window; i < rows-window; ++i){ - for(j = window; j < cols-window; ++j){ - validEdge = FALSE; - if((BLImage[offset+j] == 1) && (BLImage[offset+cols+j] == 0)){ - if((FilterImage[offset+cols+j] - FilterImage[offset-cols+j]) > 0.0){ - validEdge = TRUE; - } - } - else if((BLImage[offset+j] == 1) && (BLImage[offset+j+1] == 0)){ - if((FilterImage[offset+j+1] - FilterImage[offset+j-1]) > 0.0){ - validEdge = TRUE; - } - } - else if((BLImage[offset+j] == 1) && (BLImage[offset-cols+j] == 0)){ - if((FilterImage[offset+cols+j] - FilterImage[offset-cols+j]) < 0.0){ - validEdge = TRUE; - } - } - else if((BLImage[offset+j] == 1) && (BLImage[offset+j-1] == 0)){ - if((FilterImage[offset+j+1] - FilterImage[offset+j-1]) < 0.0){ - validEdge = TRUE; - } - } - if(validEdge){ - /* adaptive gradeint is signed */ - SourceImage[offset+j] = (float)fabs(adaptiveGradient(BLImage, FilterImage, i, j, cols, window)); - } - } - offset += cols; - } - - return; - -} - - -void computeBandedLaplacian(float *image1, float *image2, float *BLImage, int rows, int cols){ - - int i, j; - int offset; - float t; - - /* - // like an unsharp mask - */ - offset = 0; - for(i = 0; i < rows; ++i){ - for(j = 0; j < cols; ++j){ - t = image1[offset+j] - image2[offset+j]; - if(t < (float)0.0){ - t = (float)0.0; - } - else{ - t = (float)1.0; - } - BLImage[offset+j] = t; - } - offset += cols; - } - - return; - -} - -void thresholdImage(float *Raw, float *Filtered, int rows, int cols, int tLow, int tHigh){ - - int i, j; - int ptr; - - ptr = 0; - for(i = 0; i < rows; ++i){ - for(j = 0; j < cols; ++j){ - if(Raw[ptr] > tHigh){ - Raw[ptr] = 0.0; - Filtered[ptr] = 0.0; - } - if(Raw[ptr] < tLow){ - Raw[ptr] = 0.0; - Filtered[ptr] = 0.0; - } - ++ptr; - } - } - - return; - -} - -void ISEF_Vertical(float *SourceImage, float *FilterImage, float *A, float *B, - int rows, int cols, double b){ - - - int i, j; - int offset; - float b1, b2; - - b1 = ((float)1.0 - b)/((float)1.0 + b); - b2 = b * b1; - - /* - // set the boundaries - */ - offset = (rows-1)*cols; - for(i = 0; i < cols; ++i){ - /* process row 0 */ - A[i] = b1 * SourceImage[i]; - /* process row N-1 */ - B[offset+i] = b2 * SourceImage[offset+i]; - } - - /* - // causal component of IIR filter - */ - offset = cols; - for(i = 1; i < rows; ++i){ - for(j = 0; j < cols; ++j){ - /* - // IIR ISEF filter applied across rows - */ - A[offset+j] = (b * A[offset-cols+j]) + (b1 * SourceImage[offset+j]); - } - offset += cols; - } - - /* - // anti-causal component of IIR filter - */ - offset = (rows-2)*cols; - for(i = rows-2; i >= 0; --i){ - for(j = 0; j < cols; ++j){ - /* - // IIR ISEF filter applied across rows - */ - B[offset+j] = (b * B[offset+cols+j]) + (b2 * SourceImage[offset+j]); - } - offset -= cols; - } - - offset = (rows-1)*cols; - for(j = 0; j < cols-1; ++j){ - FilterImage[offset+j] = A[offset+j]; - } - - /* - // add causal and anti-causal IIR parts - */ - offset = 0; - for(i = 1; i < rows-2; ++i){ - for(j = 0; j < cols-1; ++j){ - FilterImage[offset+j] = A[offset+j] + B[offset+cols+j]; - } - offset += cols; - } - - return; - -} - -void ISEF_Horizontal(float *SourceImage, float *FilterImage, float *A, float *B, - int rows, int cols, double b){ - - - /* - // source and smooth are the same in this pass of the 2D IIR - */ - - int i, j; - int offset; - float b1, b2; - - b1 = ((float)1.0 - b)/((float)1.0 + b); - b2 = b * b1; - - /* - // columns boundaries - */ - offset = 0; - for(i = 0; i < rows; ++i){ - // col 0 - A[offset] = b1 * SourceImage[offset]; - // col N-1 - B[offset+cols-1] = b2 * SourceImage[offset+cols-1]; - } - - /* - // causal IIR part - */ - offset = 0; - for(j = 1; j < cols; ++j){ - for(i = 0; i < rows; ++i){ - A[offset+j] = (b * A[offset+j-1]) + (b1 * SourceImage[offset+j]); - } - offset += cols; - } - - /* - // anti-causal IIR part - */ - offset = 0; - for(j = cols-2; j > 0; --j){ - for(i = 0; i < rows; ++i){ - B[offset+j] = (b * B[offset+j+1]) + (b2 * SourceImage[offset+j]); - } - offset += cols; - } - - /* - // filtered output. this is 2-pass IIR and pass 1 is vertical - */ - offset = 0; - for(i = 0; i < rows; ++i){ - FilterImage[offset+cols-1] = A[offset+cols-1]; - } - - /* - // add causal and anti-causal IIR parts - */ - for(i = 0; i < rows; ++i){ - for(j = 0; j < cols-1; ++j){ - FilterImage[offset+j] = A[offset+j] + B[offset+j+1]; - } - offset += cols; - } - - return; - -} - - -void computeISEF(float *SourceImage, float *FilterImage, int rows, int cols, double b){ - - int imageSize = rows*cols; - float *A; - float *B; - - A = calloc(imageSize, sizeof(float)); - B = calloc(imageSize, sizeof(float)); - - ISEF_Vertical(SourceImage, FilterImage, A, B, rows, cols, b); - ISEF_Horizontal(FilterImage, FilterImage, A, B, rows, cols, b); - - free(A); - free(B); - - return; - -} - -void Shen_Castan(double b, double ShenCastanLow, int rows, int cols, int window, - int lowThreshold, int highThreshold, - double *RawImage, unsigned short *EdgeImage){ - - int i; - int imageSize = rows*cols; - float *FilterImage; - float *BinaryLaplacianImage; - float *SourceImage; - - FilterImage = calloc(imageSize, sizeof(float)); - BinaryLaplacianImage = calloc(imageSize, sizeof(float)); - SourceImage = calloc(imageSize, sizeof(float)); - - for(i = 0; i < imageSize; ++i){ - SourceImage[i] = RawImage[i]; - } - computeISEF(SourceImage, FilterImage, rows, cols, b); - /* optional thresholding based on low, high */ - thresholdImage(SourceImage, FilterImage, rows, cols, lowThreshold, highThreshold); - computeBandedLaplacian(FilterImage, SourceImage, BinaryLaplacianImage, rows, cols); - /* the new source image is now the adaptive gradient */ - getZeroCrossings(SourceImage, FilterImage, BinaryLaplacianImage, rows, cols, window); - thresholdEdges(SourceImage, EdgeImage, ShenCastanLow, rows, cols); - - free(FilterImage); - free(BinaryLaplacianImage); - free(SourceImage); - - return; - -} - -int NI_ShenCastanEdges(int samples, int rows, int cols, double b, double ShenCastanLow, - int window, int lowThreshold, int highThreshold, - double *rawImage, unsigned short *edgeImage, int *groups){ - - - int i, j; - int offset; - int status = 0; - - Shen_Castan(b, ShenCastanLow, rows, cols, window, lowThreshold, highThreshold, rawImage, edgeImage); - *groups = ConnectedEdgePoints(rows, cols, edgeImage); - - - // - // prune the isolated pixels - // - offset = 0; - for(i = 0; i < rows; ++i){ - for(j = 0; j < cols; ++j){ - if(edgeImage[offset+j] > (*groups)){ - edgeImage[offset+j] = 0; - } - } - offset += cols; - } - - status = *groups; - + status = numberObjects; return status; } -void buildBinaryImage(int rows, int cols, double *rawImage, unsigned short *edgeImage, - int lowThreshold, int highThreshold){ - int i, j; - int offset; - double value; - int maskValue; +void NI_ThinMorphoFilter(int regRows, int regColumns, int spadSize, int masks, unsigned short *J_mask, + unsigned short *K_mask, unsigned char *Input, unsigned char *CInput, + unsigned char *ErosionStage, unsigned char *DialationStage, + unsigned char *HMT, unsigned char *Copy){ - offset = 0; - for(i = 0; i < rows; ++i){ - for(j = 0; j < cols; ++j){ - value = rawImage[offset+j]; - maskValue = 1; - if(value < (double)lowThreshold) maskValue = 0; - if(value > (double)highThreshold) maskValue = 0; - edgeImage[offset+j] = maskValue; - } - offset += cols; - } - - return; - -} - - - -void morphoFilterBinaryImage(int rows, int cols, unsigned short *edgeImage, - int CloseSize, int OpenSize){ - - - int i, j; - int offset, offset2; - unsigned short *cmask; - unsigned short *omask; - int olapValuesC[4]; - int olapValuesO[4]; - int CloseMaskSize = 1; - int OpenMaskSize = 1; - int LowValue1, HighValue1; - int LowValue2, HighValue2; - int spadSize; - int maskSize = 11; - unsigned char *ImageE; - unsigned char *ImageC; - - spadSize = MAX(rows, cols); - - ImageE = calloc(spadSize*spadSize, sizeof(unsigned char)); - ImageC = calloc(spadSize*spadSize, sizeof(unsigned char)); - - cmask = calloc(11*11, sizeof(unsigned short)); - omask = calloc(11*11, sizeof(unsigned short)); - - // - // Close filter - // - if(CloseSize){ - CloseMaskSize = (CloseSize-1)/2; - for(i = 0; i < 2*CloseMaskSize+1; ++i){ - for(j = 0; j < 2*CloseMaskSize+1; ++j){ - cmask[i*maskSize+j] = 1; - } - } - LowValue1 = 0; - HighValue1 = 1; - LowValue2 = 1; - HighValue2 = 0; - olapValuesC[0] = LowValue1; - olapValuesC[1] = HighValue1; - olapValuesC[2] = LowValue2; - olapValuesC[3] = HighValue2; - } - - /* - // Open filter - */ - if(OpenSize){ - OpenMaskSize = (OpenSize-1)/2; - for(i = 0; i < 2*OpenMaskSize+1; ++i){ - for(j = 0; j < 2*OpenMaskSize+1; ++j){ - omask[i*maskSize+j] = 1; - } - } - LowValue1 = 1; - HighValue1 = 0; - LowValue2 = 0; - HighValue2 = 1; - olapValuesO[0] = LowValue1; - olapValuesO[1] = HighValue1; - olapValuesO[2] = LowValue2; - olapValuesO[3] = HighValue2; - } - - offset = 0; - offset2 = 0; - for(i = 0; i < rows; ++i){ - for(j = 0; j < cols; ++j){ - ImageE[offset2+j] = (unsigned char)edgeImage[offset+j]; - } - offset2 += spadSize; - offset += cols; - } - - if(OpenSize){ - OpenCloseFilter(olapValuesO, OpenMaskSize, rows, cols, spadSize, ImageE, ImageC, omask); - } - - if(CloseSize){ - OpenCloseFilter(olapValuesC, CloseMaskSize, rows, cols, spadSize, ImageE, ImageC, cmask); - } - - offset = 0; - offset2 = 0; - for(i = 0; i < rows; ++i){ - for(j = 0; j < cols; ++j){ - if(ImageE[offset2+j] == 1){ - /* this will activate some original off-pixels */ - edgeImage[offset+j] = 1; - } - else{ - /* this will zero some original on-pixels */ - edgeImage[offset+j] = 0; - } - } - offset2 += spadSize; - offset += cols; - } - - free(ImageE); - free(ImageC); - - free(cmask); - free(omask); - - return; - -} - -void doRegionGrow(int samples, int rows, int cols, double *rawImage, - unsigned short *edgeImage, int lowThreshold, - int highThreshold, int closeWindow, int openWindow){ - - buildBinaryImage(rows, cols, rawImage, edgeImage, lowThreshold, highThreshold); - morphoFilterBinaryImage(rows, cols, edgeImage, closeWindow, openWindow); - - return; - -} - -int NI_RegionGrow(int samples, int rows, int cols, int lowThreshold, int highThreshold, - int closeWindow, int openWindow, double *rawImage, - unsigned short *edgeImage, int *groups){ - - int i, j; - int offset; - int status; - - doRegionGrow(samples, rows, cols, rawImage, edgeImage, lowThreshold, - highThreshold, closeWindow, openWindow); - *groups = ConnectedEdgePoints(rows, cols, edgeImage); - - // - // prune the isolated pixels - // - offset = 0; - for(i = 0; i < rows; ++i){ - for(j = 0; j < cols; ++j){ - if(edgeImage[offset+j] > (*groups)){ - edgeImage[offset+j] = 0; - } - } - offset += cols; - } - - status = *groups; - return status; - -} - -int NI_SobelEdges(int samples, int rows, int cols, double sobelLow, int mode, - int lowThreshold, int highThreshold, double BPHigh, - int apearture, double *rawImage, unsigned short *edgeImage, int *groups){ - - - int i, j; - int offset; - int status; - - doPreProcess(samples, rows, cols, rawImage, BPHigh, apearture, lowThreshold, highThreshold); - doSobel(samples, rows, cols, sobelLow, mode, rawImage, edgeImage); - *groups = ConnectedEdgePoints(rows, cols, edgeImage); - - - /* - // prune the isolated pixels - */ - offset = 0; - for(i = 0; i < rows; ++i){ - for(j = 0; j < cols; ++j){ - if(edgeImage[offset+j] > (*groups)){ - edgeImage[offset+j] = 0; - } - } - offset += cols; - } - - status = *groups; - return status; - -} - -void initThinFilter(int *J_mask, int *K_mask){ - - int i, j; - int Column; - int maskCols = 3; - - for(i = 0; i < 3; ++i){ - for(j = 0; j < 30; ++j){ - J_mask[i+j*maskCols] = 0; - K_mask[i+j*maskCols] = 0; - } - } - - Column = 0; - J_mask[0+maskCols*(Column+0)] = 1; - J_mask[0+maskCols*(Column+1)] = 1; - J_mask[0+maskCols*(Column+2)] = 1; - J_mask[1+maskCols*(Column+1)] = 1; - - Column += 3; - J_mask[0+maskCols*(Column+1)] = 1; - J_mask[1+maskCols*(Column+1)] = 1; - J_mask[1+maskCols*(Column+2)] = 1; - - Column += 3; - J_mask[0+maskCols*(Column+0)] = 1; - J_mask[1+maskCols*(Column+0)] = 1; - J_mask[2+maskCols*(Column+0)] = 1; - J_mask[1+maskCols*(Column+1)] = 1; - - Column += 3; - J_mask[0+maskCols*(Column+1)] = 1; - J_mask[1+maskCols*(Column+0)] = 1; - J_mask[1+maskCols*(Column+1)] = 1; - - Column += 3; - J_mask[0+maskCols*(Column+2)] = 1; - J_mask[1+maskCols*(Column+1)] = 1; - J_mask[1+maskCols*(Column+2)] = 1; - J_mask[2+maskCols*(Column+2)] = 1; - - Column += 3; - J_mask[1+maskCols*(Column+0)] = 1; - J_mask[1+maskCols*(Column+1)] = 1; - J_mask[2+maskCols*(Column+1)] = 1; - - Column += 3; - J_mask[1+maskCols*(Column+1)] = 1; - J_mask[2+maskCols*(Column+0)] = 1; - J_mask[2+maskCols*(Column+1)] = 1; - J_mask[2+maskCols*(Column+2)] = 1; - - Column += 3; - J_mask[1+maskCols*(Column+1)] = 1; - J_mask[1+maskCols*(Column+2)] = 1; - J_mask[2+maskCols*(Column+1)] = 1; - - Column = 0; - K_mask[2+maskCols*(Column+0)] = 1; - K_mask[2+maskCols*(Column+1)] = 1; - K_mask[2+maskCols*(Column+2)] = 1; - - Column += 3; - K_mask[1+maskCols*(Column+0)] = 1; - K_mask[2+maskCols*(Column+0)] = 1; - K_mask[2+maskCols*(Column+1)] = 1; - - Column += 3; - K_mask[0+maskCols*(Column+2)] = 1; - K_mask[1+maskCols*(Column+2)] = 1; - K_mask[2+maskCols*(Column+2)] = 1; - - Column += 3; - K_mask[1+maskCols*(Column+2)] = 1; - K_mask[2+maskCols*(Column+1)] = 1; - K_mask[2+maskCols*(Column+2)] = 1; - - Column += 3; - K_mask[0+maskCols*(Column+0)] = 1; - K_mask[1+maskCols*(Column+0)] = 1; - K_mask[2+maskCols*(Column+0)] = 1; - - Column += 3; - K_mask[0+maskCols*(Column+1)] = 1; - K_mask[0+maskCols*(Column+2)] = 1; - K_mask[1+maskCols*(Column+2)] = 1; - - Column += 3; - K_mask[0+maskCols*(Column+0)] = 1; - K_mask[0+maskCols*(Column+1)] = 1; - K_mask[0+maskCols*(Column+2)] = 1; - - Column += 3; - K_mask[0+maskCols*(Column+0)] = 1; - K_mask[0+maskCols*(Column+1)] = 1; - K_mask[1+maskCols*(Column+0)] = 1; - - return; - -} - -void ThinningFilter(int regRows, int regColumns, int spadSize, int *J_mask, int *K_mask, - unsigned char *Input, unsigned char *CInput, unsigned char *ErosionStage, - unsigned char *DialationStage, unsigned char *HMT, unsigned char *Copy){ - int i, j, k, l, m, n, overlap, hit; int LowValue1, HighValue1; int LowValue2, HighValue2; @@ -1624,6 +420,7 @@ int maskCols = 3; int j_mask[3][3]; int k_mask[3][3]; + int status; N = regRows; M = regColumns; @@ -1646,7 +443,7 @@ while(1){ /* erode */ Column = 0; - for(n = 0; n < 8; ++n){ + for(n = 0; n < masks; ++n){ for(i = 0; i < 3; ++i){ for(j = 0; j < 3; ++j){ j_mask[i][j] = J_mask[i+maskCols*(Column+j)]; @@ -1759,1262 +556,279 @@ } - return; + status = 1; + return status; } -int NI_ThinFilter(int samples, int rows, int cols, int numberObjects, - unsigned short *edgeImage, objStruct objectMetrics[]){ +int NI_CannyFilter(int samples, int rows, int cols, double *rawImage, + double *hDGImage, double *vDGImage, double *dgKernel, + int gWidth, float *aveXValue, float *aveYValue){ + - int i, j; - int loop; - int label; - int left, right, top, bottom; - int roiRows, roiCols; - int srcOffset; - int dstOffset; - int status; - int inflate = 1; - int *J_mask; - int *K_mask; - - unsigned char *Input; - unsigned char *CInput; - unsigned char *ErosionStage; - unsigned char *DialationStage; - unsigned char *HMT; - unsigned char *Copy; - unsigned short *thinEdgeImage; - /* - // scratch pad (spad) memory + // implements the derivative of Gaussian filter. kernel set by CannyEdges */ - Input = calloc(samples, sizeof(unsigned char)); - CInput = calloc(samples, sizeof(unsigned char)); - ErosionStage = calloc(samples, sizeof(unsigned char)); - DialationStage = calloc(samples, sizeof(unsigned char)); - HMT = calloc(samples, sizeof(unsigned char)); - Copy = calloc(samples, sizeof(unsigned char)); - thinEdgeImage = calloc(samples, sizeof(unsigned short)); - J_mask = calloc(3*30, sizeof(int)); - K_mask = calloc(3*30, sizeof(int)); + int i, j, k; + int ptr; + int mLength; + int count; + int status; + float *tBuffer = NULL; + double sum; - initThinFilter(J_mask, K_mask); - for(loop = 0; loop < numberObjects; ++loop){ - label = objectMetrics[loop].Label; - left = objectMetrics[loop].L; - right = objectMetrics[loop].R; - top = objectMetrics[loop].T; - bottom = objectMetrics[loop].B; - roiRows = top-bottom+2*inflate; - roiCols = right-left+2*inflate; + *aveXValue = (float)0.0; + *aveYValue = (float)0.0; - /* - // clear the scratch pad - */ - srcOffset = 0; - for(i = 0; i < roiRows; ++i){ - for(j = 0; j < roiCols; ++j){ - Input[srcOffset+j] = 0; - } - srcOffset += cols; - } + mLength = MAX(rows, cols) + 64; + tBuffer = calloc(mLength, sizeof(float)); - /* - // copy the ROI for MAT (medial axis transformation) filter - */ - dstOffset = inflate*rows; - for(i = bottom; i < top; ++i){ - srcOffset = i*cols; - for(j = left; j < right; ++j){ - if(edgeImage[srcOffset+j] == label){ - Input[dstOffset+j-left+inflate] = 1; - } - } - dstOffset += cols; - } - ThinningFilter(roiRows, roiCols, cols, J_mask, K_mask, Input, CInput, - ErosionStage, DialationStage, HMT, Copy); - - /* - // copy the MAT roi to the new edgeImage (clip the inflate border) - */ - dstOffset = inflate*rows; - for(i = bottom; i < top; ++i){ - srcOffset = i*cols; - for(j = left; j < right; ++j){ - if(Input[dstOffset+j-left+inflate]){ - thinEdgeImage[srcOffset+j] = label; - } - } - dstOffset += cols; - } - } - /* - // copy the MAT edges and return the thinned edges - // this will prune the isolated edge points from the edgeImage source + // filter X */ - for(i = 0; i < rows*cols; ++i){ - edgeImage[i] = thinEdgeImage[i]; - } - - free(Input); - free(CInput); - free(ErosionStage); - free(DialationStage); - free(HMT); - free(Copy); - free(thinEdgeImage); - free(J_mask); - free(K_mask); - - status = 1; - - return status; - -} - - -void generateMask(unsigned char *ImageH, bPOINT *boundary, int newSamples, int label, int cols){ - - /* - // get the boundary point pairs (left, right) for each line - // if there is no pair, then the boundary is open - // then fill the image in with the current label - */ - - int i, j, k, m; - int list[2048]; - int distance; - int neighbor = 4; - int index; - int offset; - int maxDistance = 1024; - int x, y; - int low, high; - - for(i = 0; i < newSamples; ++i){ - boundary[i].haveLink = FALSE; - boundary[i].linkIndex = -1; - } - - for(i = 0; i < newSamples; ++i){ - if(!boundary[i].haveLink){ - boundary[i].haveLink = TRUE; - x = boundary[i].x; - y = boundary[i].y; - for(k = 0, j = 0; j < newSamples; ++j){ - if((j != i)){ - if(boundary[j].y == y){ - list[k] = j; - ++k; - } - } + count = 0; + for(i = 0; i < rows; ++i){ + ptr = i * cols; + for(j = gWidth; j < cols-gWidth; ++j){ + sum = dgKernel[0] * rawImage[ptr+j]; + for(k = 1; k < gWidth; ++k){ + sum += dgKernel[k] * (-rawImage[ptr+j+k] + rawImage[ptr+j-k]); } - /* now get the closest boundary */ - if(k){ - distance = maxDistance; - index = -1; - for(j = 0; j < k; ++j){ - m = abs(x - boundary[list[j]].x); - if((m < distance) && (m > neighbor)){ - distance = m; - index = list[j]; - } - else if(m <= neighbor){ - boundary[list[j]].haveLink = TRUE; - } - } - if(index != -1){ - boundary[i].linkIndex = index; - boundary[index].linkIndex = i; - boundary[index].haveLink = TRUE; - if(boundary[i].x < boundary[index].x){ - low = boundary[i].x; - high = boundary[index].x; - } - else{ - low = boundary[index].x; - high = boundary[i].x; - } - /* - // do the fill - */ - offset = y * cols; - for(j = low; j <= high; ++j){ - ImageH[offset+j] = label; - } - } + hDGImage[ptr+j] = (float)sum; + if(sum != (float)0.0){ + ++count; + *aveXValue += (float)fabs(sum); } - else{ - /* boundary point is isolated */ - boundary[i].linkIndex = i; - } } } - - return; - -} - -void getBoundaryMetrics(bPOINT *boundary, float *length, float *minRadius, - float *maxRadius, float *aveRadius, - float Xcenter, float Ycenter, int newSamples){ - - int j; - float dX, dY; - float distance; - - if(newSamples < 2){ - *length = (float)0.0; - *minRadius = (float)0.0; - *maxRadius = (float)0.0; - *aveRadius = (float)0.0; - return; + if(count){ + *aveXValue /= (float)count; } - - *length = (float)0.0; - for(j = 1; j < newSamples; ++j){ - dX = (float)(boundary[j].x - boundary[j-1].x); - dY = (float)(boundary[j].y - boundary[j-1].y); - distance = (float)sqrt(dX*dX + dY*dY); - *length += distance; - } - - *minRadius = (float)10000.0; - *maxRadius = (float)-10000.0; - *aveRadius = (float)0.0; - for(j = 0; j < newSamples; ++j){ - dX = (float)(boundary[j].x - Xcenter); - dY = (float)(boundary[j].y - Ycenter); - distance = (float)sqrt(dX*dX + dY*dY); - *aveRadius += distance; - if(distance < *minRadius) *minRadius = distance; - if(distance > *maxRadius) *maxRadius = distance; - } - - if(newSamples){ - *aveRadius /= (float)newSamples; - } - - return; - -} - -void trackBoundary(unsigned char *Input, blobBoundary lBoundary[], int mcount, int spadSize, - blobBoundary seedValue, int searchWindow){ - - - int i, j, k, m, p; - int offset; - int CurI; - int CurJ; - int StrI; - int StrJ; - int NewI; - int NewJ; - int MinD; - int inflate = searchWindow; - - CurI = seedValue.xy.x; - CurJ = seedValue.xy.y; - StrI = CurI; - StrJ = CurJ; - - p = 0; - lBoundary[p].xy.x = StrI; - lBoundary[p].xy.y = StrJ; - offset = StrI * spadSize; - - p = 1; - while(p < mcount){ - offset = (CurI-inflate)*spadSize; - MinD = 1024; - NewI = -1; - NewJ = -1; - for(i = CurI-inflate; i < CurI+inflate; ++i){ - for(j = CurJ-inflate; j < CurJ+inflate; ++j){ - m = Input[offset+j]; - if(m == 1){ - /* city block distance */ - k = abs(i-CurI) + abs(j-CurJ); - if(k < MinD){ - MinD = k; - NewI = i; - NewJ = j; - } - } - } - offset += spadSize; - } - if(NewI != -1) CurI = NewI; - if(NewJ != -1) CurJ = NewJ; - offset = CurI * spadSize; - Input[offset+CurJ] = 0; - lBoundary[p].xy.x = CurJ; - lBoundary[p].xy.y = CurI; - ++p; - } - - return; - -} - - -void OpenCloseFilter(int olapValues[], int maskSize, int rows, int columns, int spadSize, - unsigned char *input, unsigned char *output, unsigned short *mask){ - - /* - // do morphological open/close image filtering. the olapValues array determines - // if the filter is Open or Close. + // filter Y */ - int i, j, k, l, m, overlap, hit; - int offset; - int LowValue1, HighValue1; - int LowValue2, HighValue2; - int morphoMaskSize = 11; - - LowValue1 = olapValues[0]; - HighValue1 = olapValues[1]; - LowValue2 = olapValues[2]; - HighValue2 = olapValues[3]; - - /* close - step 1 is dialate - open - step 1 is erode */ - offset = maskSize*spadSize; - for(i = maskSize; i < rows-maskSize; ++i){ - for(j = maskSize; j < columns-maskSize; ++j){ - hit = LowValue1; - for(k = -maskSize; k < maskSize; ++k){ - m = k*spadSize; - for(l = -maskSize; l < maskSize; ++l){ - overlap = mask[morphoMaskSize*(k+maskSize)+(l+maskSize)]*input[offset+m+j+l]; - if(overlap == HighValue1){ - hit = HighValue1; - } - } - } - output[offset+j] = hit; + count = 0; + for(i = 0; i < cols; ++i){ + for(j = 0; j < rows; ++j){ + ptr = j * cols; + tBuffer[j] = rawImage[ptr+i]; } - offset += spadSize; - } - - /* close - step 2 is erode - open - step 2 is dialate */ - offset = maskSize*spadSize; - for(i = maskSize; i < rows-maskSize; ++i){ - for(j = maskSize; j < columns-maskSize; ++j){ - hit = LowValue2; - for(k = -maskSize; k < maskSize; ++k){ - m = k*spadSize; - for(l = -maskSize; l < maskSize; ++l){ - overlap = mask[morphoMaskSize*(k+maskSize)+(l+maskSize)]*output[offset+m+j+l]; - if(overlap == HighValue2){ - hit = HighValue2; - } - } + for(j = gWidth; j < rows-gWidth; ++j){ + ptr = j * cols; + sum = dgKernel[0] * tBuffer[j]; + for(k = 1; k < gWidth; ++k){ + sum += dgKernel[k] * (-tBuffer[j+k] + tBuffer[j-k]); } - input[offset+j] = hit; - } - offset += spadSize; - } - - return; -} - -void getCompactness(unsigned char *Input, RECT roi, int label, int spadSize, - float *vCompactness, float length){ - - int i, j; - int maskOffset; - int area; - static float fpi = (float)(4.0 * 3.14159); - - area = 0; - for(i = roi.bottom; i < roi.top; ++i){ - maskOffset = i*spadSize; - for(j = roi.left; j < roi.right; ++j){ - if(Input[maskOffset+j] == label){ - ++area; + vDGImage[ptr+i] = sum; + if(sum != (float)0.0){ + ++count; + *aveYValue += (float)fabs(sum); } } } - if(area && (length != (float)0.0)){ - *vCompactness = (fpi * (float)area) / (length*length); + if(count){ + *aveYValue /= (float)count; } - else{ - *vCompactness = (float)0.0; - } - return; -} + free(tBuffer); + status = 1; -void doMorphology(unsigned char *Input, unsigned char *ImageE, unsigned char *ImageC, - unsigned char *ImageH, int olapValuesC[], int olapValuesO[], - unsigned short *cmask, unsigned short *omask, - RECT roi, int label, int CloseMaskSize, int OpenMaskSize, int spadSize){ + return status; - int i, j; - int rows, cols; - int srcOffset; - int dstOffset; - int maskSize; +} - cols = roi.right - roi.left; - rows = roi.top - roi.bottom; - - for(i = 0; i < spadSize*spadSize; ++i){ - ImageE[i] = 0; - ImageC[i] = 0; - } - - /* - // put the ROI in the ImageE array centered in ULC - */ - dstOffset = 0; - for(i = roi.bottom; i < roi.top; ++i){ - srcOffset = i*spadSize; - for(j = roi.left; j < roi.right; ++j){ - if(ImageH[srcOffset+j] == label){ - ImageE[dstOffset+j-roi.left] = 1; - } - } - dstOffset += spadSize; - } - - /* - // open - */ - maskSize = OpenMaskSize; - OpenCloseFilter(olapValuesO, maskSize, rows, cols, spadSize, ImageE, ImageC, omask); - /* - // close - */ - maskSize = CloseMaskSize; - OpenCloseFilter(olapValuesC, maskSize, rows, cols, spadSize, ImageE, ImageC, cmask); - - /* - // put the closed ROI (in ImageE) back in its roi space - */ - - srcOffset = 0; - for(i = roi.bottom; i < roi.top+2*maskSize+1; ++i){ - dstOffset = (i-(2*maskSize+1))*spadSize; - for(j = roi.left-maskSize-1; j < roi.right+maskSize+1; ++j){ - if(ImageE[srcOffset+j-roi.left] == 1){ - Input[dstOffset+j-maskSize+1] = label; - } - } - srcOffset += spadSize; - } - - return; - +double tmagnitude(double X, double Y){ + return sqrt(X*X + Y*Y); } - -void getBoundary(unsigned short *ThinEdgeImage, unsigned char *Input, - blobBoundary *pBoundary, blobBoundary *lBoundary, - boundaryIndex *pBoundaryIndex, RECT boundBox, int label, - int bBox, int nextSlot, int memOffset, - int spadSize, int searchWindow){ - +int NI_CannyNonMaxSupress(int num, int rows, int cols, double *magImage, double *hDGImage, + double *vDGImage, int mode, double aveXValue, double aveYValue, + double *tAve, double *cannyLow, double *cannyHigh, + double cannyL, double cannyH){ + int i, j; - int dstOffset; - int srcOffset; - int mcount; - int rows; - int columns; - bool first; - blobBoundary value; - int inflate = searchWindow+1; + int ptr, ptr_m1, ptr_p1; + float xSlope, ySlope, G1, G2, G3, G4, G, xC, yC; + float scale; + float maxValue = (float)0.0; + float minValue = (float)0.0; + int value; + int mValue; + int mIndex; int count; + int status; + int histogram[256]; + double step; - pBoundaryIndex[bBox+1].rectangle.left = boundBox.left; - pBoundaryIndex[bBox+1].rectangle.right = boundBox.right; - pBoundaryIndex[bBox+1].rectangle.top = boundBox.top; - pBoundaryIndex[bBox+1].rectangle.bottom = boundBox.bottom; - - for(i = 0; i < spadSize*spadSize; ++i){ - Input[i] = 0; - } - - /* copy to spad */ - - count = 0; - rows = boundBox.top-boundBox.bottom+2*inflate; - columns = boundBox.right-boundBox.left+2*inflate; - dstOffset = inflate*spadSize; - for(i = boundBox.bottom; i < boundBox.top; ++i){ - srcOffset = i*spadSize; - for(j = boundBox.left; j < boundBox.right; ++j){ - if(ThinEdgeImage[srcOffset+j] == label){ - Input[dstOffset+j-boundBox.left+inflate] = 1; - ++count; + for(i = 1; i < rows-1; ++i){ + ptr = i * cols; + ptr_m1 = ptr - cols; + ptr_p1 = ptr + cols; + for(j = 1; j < cols; ++j){ + magImage[ptr+j] = (float)0.0; + xC = hDGImage[ptr+j]; + yC = vDGImage[ptr+j]; + if(!((fabs(xC) < aveXValue) && (fabs(yC) < aveYValue))){ + G = tmagnitude(xC, yC); + if(fabs(yC) > fabs(xC)){ + /* vertical gradient */ + xSlope = (float)(fabs(xC) / fabs(yC)); + ySlope = (float)1.0; + G2 = tmagnitude(hDGImage[ptr_m1+j], vDGImage[ptr_m1+j]); + G4 = tmagnitude(hDGImage[ptr_p1+j], vDGImage[ptr_p1+j]); + if((xC*yC) > (float)0.0){ + G1 = tmagnitude(hDGImage[ptr_m1+j-1], vDGImage[ptr_m1+j-1]); + G3 = tmagnitude(hDGImage[ptr_p1+j+1], vDGImage[ptr_p1+j+1]); + } + else{ + G1 = tmagnitude(hDGImage[ptr_m1+j+1], vDGImage[ptr_m1+j+1]); + G3 = tmagnitude(hDGImage[ptr_p1+j-1], vDGImage[ptr_p1+j-1]); + } + } + else{ + /* horizontal gradient */ + xSlope = (float)(fabs(yC) / fabs(xC)); + ySlope = (float)1.0; + G2 = tmagnitude(hDGImage[ptr+j+1], vDGImage[ptr+j+1]); + G4 = tmagnitude(hDGImage[ptr+j-1], vDGImage[ptr+j-1]); + if((xC*yC) > (float)0.0){ + G1 = tmagnitude(hDGImage[ptr_p1+j+1], vDGImage[ptr_p1+j+1]); + G3 = tmagnitude(hDGImage[ptr_m1+j-1], vDGImage[ptr_m1+j-1]); + } + else{ + G1 = tmagnitude(hDGImage[ptr_m1+j+1], vDGImage[ptr_m1+j+1]); + G3 = tmagnitude(hDGImage[ptr_p1+j-1], vDGImage[ptr_p1+j-1]); + } + } + if((G > (xSlope*G1+(ySlope-xSlope)*G2))&&(G > (xSlope*G3+(ySlope-xSlope)*G4))){ + magImage[ptr+j] = G; + } + if(magImage[ptr+j] > maxValue) maxValue = magImage[ptr+j]; + if(magImage[ptr+j] < minValue) minValue = magImage[ptr+j]; } } - dstOffset += spadSize; } - mcount = 0; - first = TRUE; - srcOffset = 0; + scale = (float)1.0 / (maxValue-minValue); + ptr = 0; + count = 0; + *tAve = 0.0; for(i = 0; i < rows; ++i){ - for(j = 0; j < columns; ++j){ - if(Input[srcOffset+j]){ - if(first){ - first = FALSE; - /* index of the seed sample */ - value.xy.x = i; - value.xy.y = j; - } - ++mcount; + for(j = 0; j < cols; ++j){ + magImage[ptr] = scale * (magImage[ptr]-minValue); + if(magImage[ptr] > 0.0){ + *tAve += magImage[ptr]; + ++count; } + ++ptr; } - srcOffset += spadSize; } + *tAve /= (float)count; - trackBoundary(Input, lBoundary, mcount, spadSize, value, searchWindow); - - pBoundaryIndex[nextSlot].numberPoints = mcount; - for(i = 0; i < mcount; ++i){ - value.xy.x = lBoundary[i].xy.x + boundBox.left - inflate; - value.xy.y = lBoundary[i].xy.y + boundBox.bottom - inflate + 1; - pBoundary[memOffset].xy.x = value.xy.x; - pBoundary[memOffset].xy.y = value.xy.y; - ++memOffset; + step = 255.0; + for(i = 0; i < 256; ++i){ + histogram[i] = 0; } - - return; - -} - - -void buildBoundary(objStruct objectMetrics[], int searchWindow, unsigned short *ThinEdgeImage, - int numberObjects, int srcRows, int srcCols){ - - int i, j, k; - int count; - int numBoundaries; - int numSamples; - int offset; - int offset2; - int end; - int label; - int distance; - /* these will be user-setup parameters */ - int closureDistance = 12; - int CloseSize = 5; - int OpenSize = 5; - int threshold = 3; - int newSamples; - int spadSize; - POINT rectPoint[4]; - int in[4]; - float length; - float minRadius; - float maxRadius; - float aveRadius; - float vCompactness; - /* for morphological close of mask. max structuring element is 11x11 */ - unsigned short *cmask; - unsigned short *omask; - int maskSize = 11; - int olapValuesC[4]; - int olapValuesO[4]; - int CloseMaskSize; - int OpenMaskSize; - int LowValue1, HighValue1; - int LowValue2, HighValue2; - RECT bBox; - - boundaryIndex *pBoundaryIndex; - blobBoundary *pBoundary; - blobBoundary *lBoundary; - bPOINT *boundary; - unsigned char *Input; - unsigned char *ImageE; - unsigned char *ImageC; - unsigned char *ImageH; - - spadSize = srcCols; - pBoundaryIndex = calloc(srcRows+srcCols, sizeof(boundaryIndex)); - Input = calloc(spadSize*spadSize, sizeof(unsigned char)); - ImageE = calloc(spadSize*spadSize, sizeof(unsigned char)); - ImageC = calloc(spadSize*spadSize, sizeof(unsigned char)); - ImageH = calloc(spadSize*spadSize, sizeof(unsigned char)); - pBoundary = calloc(srcRows*srcCols, sizeof(blobBoundary)); - lBoundary = calloc(32767, sizeof(blobBoundary)); - boundary = calloc(32767, sizeof(POINT)); - cmask = calloc(11*11, sizeof(unsigned short)); - omask = calloc(11*11, sizeof(unsigned short)); - - /* - // Close filter - */ - CloseMaskSize = (CloseSize-1)/2; - for(i = 0; i < 2*CloseMaskSize+1; ++i){ - for(j = 0; j < 2*CloseMaskSize+1; ++j){ - cmask[i*maskSize+j] = 1; + ptr = 0; + for(i = 0; i < rows; ++i){ + for(j = 0; j < cols; ++j){ + value = (int)(step*(magImage[ptr])); + ++histogram[value]; + ++ptr; } } - LowValue1 = 0; - HighValue1 = 1; - LowValue2 = 1; - HighValue2 = 0; - olapValuesC[0] = LowValue1; - olapValuesC[1] = HighValue1; - olapValuesC[2] = LowValue2; - olapValuesC[3] = HighValue2; - /* - // Open filter + // now get the max after skipping the low values */ - OpenMaskSize = (OpenSize-1)/2; - for(i = 0; i < 2*OpenMaskSize+1; ++i){ - for(j = 0; j < 2*OpenMaskSize+1; ++j){ - omask[i*maskSize+j] = 1; + mValue = -1; + mIndex = 0; + for(i = 10; i < 256; ++i){ + if(histogram[i] > mValue){ + mValue = histogram[i]; + mIndex = i; } } - LowValue1 = 1; - HighValue1 = 0; - LowValue2 = 0; - HighValue2 = 1; - olapValuesO[0] = LowValue1; - olapValuesO[1] = HighValue1; - olapValuesO[2] = LowValue2; - olapValuesO[3] = HighValue2; - for(i = 0; i < (srcRows+srcCols); ++i){ - pBoundaryIndex[i].numberPoints = 0; - pBoundaryIndex[i].curveClose = 0; - pBoundaryIndex[i].isWithin = FALSE; - pBoundaryIndex[i].criticalSize = FALSE; - pBoundaryIndex[i].closedCurve = FALSE; + if(mode == 1){ + /* based on the mean value of edge energy */ + *cannyLow = ((cannyL) * *tAve); + *cannyHigh = ((cannyH) * *tAve); } - - - for(i = 0; i < numberObjects; ++i){ - ++pBoundaryIndex[0].numberPoints; - count = 0; - j = 1; - while(pBoundaryIndex[j].numberPoints){ - count += pBoundaryIndex[j++].numberPoints; - } - bBox.left = objectMetrics[i].L; - bBox.right = objectMetrics[i].R; - bBox.top = objectMetrics[i].T; - bBox.bottom = objectMetrics[i].B; - label = objectMetrics[i].Label; - pBoundaryIndex[i+1].Label = label; - getBoundary(ThinEdgeImage, Input, pBoundary, lBoundary, pBoundaryIndex, bBox, label, - i, pBoundaryIndex[0].numberPoints, count, spadSize, searchWindow); + else{ + /* based on the mode value of edge energy */ + *cannyLow = ((cannyL) * ((float)mIndex/step)); + *cannyHigh = ((cannyH) * ((float)mIndex/step)); } + status = 1; - /* - // Input will now be used in the fill. Copy the labeled edge image - */ + return status; - offset = 0; - numBoundaries = pBoundaryIndex[0].numberPoints; - for(i = 0; i < numBoundaries; ++i){ - numSamples = pBoundaryIndex[i+1].numberPoints; - end = numSamples-2; - newSamples = numSamples-1; - for(j = 0; j < numSamples; ++j){ - boundary[j].x = pBoundary[offset+j+1].xy.x; - boundary[j].y = pBoundary[offset+j+1].xy.y; - } +} - /* - // clip off the ends where stray boundary pixels were left over - */ - while(1){ - distance = abs(boundary[end].x-boundary[end-1].x) + abs(boundary[end].y-boundary[end-1].y); - if(distance > threshold){ - --end; - --newSamples; - } - else{ - break; - } - } +int trace_Edge(int i, int j, int rows, int cols, double cannyLow, double *magImage, + unsigned short *hys_image){ - distance = abs(boundary[0].x-boundary[end-2].x) + abs(boundary[0].y-boundary[end-2].y); - pBoundaryIndex[i+1].curveClose = distance; + int n, m; + int ptr; + int flag; - if(pBoundaryIndex[i+1].curveClose < closureDistance){ - pBoundaryIndex[i+1].closedCurve = TRUE; - } - pBoundaryIndex[i+1].centroid.x = 0; - pBoundaryIndex[i+1].centroid.y = 0; - for(j = 0; j < newSamples; ++j){ - pBoundaryIndex[i+1].centroid.x += boundary[j].x; - pBoundaryIndex[i+1].centroid.y += boundary[j].y; - } - if(newSamples){ - pBoundaryIndex[i+1].centroid.x /= newSamples; - pBoundaryIndex[i+1].centroid.y /= newSamples; - } - getBoundaryMetrics(boundary, &length, &minRadius, &maxRadius, &aveRadius, - (float)pBoundaryIndex[i+1].centroid.x, - (float)pBoundaryIndex[i+1].centroid.y, newSamples); - pBoundaryIndex[i+1].boundaryLength = length; - pBoundaryIndex[i+1].minRadius = minRadius; - pBoundaryIndex[i+1].maxRadius = maxRadius; - pBoundaryIndex[i+1].aveRadius = aveRadius; - if(minRadius != 0.0){ - pBoundaryIndex[i+1].ratio = maxRadius / minRadius; - } - else{ - pBoundaryIndex[i+1].ratio = -1.0; - } - + ptr = i * cols; + if(hys_image[ptr+j] == 0){ /* - // augment the ROI boundary + // this point is above high threshold */ - pBoundaryIndex[i+1].rectangle.left -= 2*CloseMaskSize; - pBoundaryIndex[i+1].rectangle.right += 2*CloseMaskSize; - pBoundaryIndex[i+1].rectangle.bottom -= 2*CloseMaskSize; - pBoundaryIndex[i+1].rectangle.top += 2*CloseMaskSize; - label = pBoundaryIndex[i+1].Label; - - /* - // mask goes in ImageH. morpho filter the mask first - */ - generateMask(ImageH, boundary, newSamples, label, spadSize); - - /* - // open-close the mask - */ - doMorphology(Input, ImageE, ImageC, ImageH, olapValuesC, olapValuesO, cmask, omask, - pBoundaryIndex[i+1].rectangle, label, CloseMaskSize, OpenMaskSize, spadSize); - - /* - // now get the compactness metrics - */ - getCompactness(Input, pBoundaryIndex[i+1].rectangle, label, spadSize, &vCompactness, length); - pBoundaryIndex[i+1].compactness = vCompactness; - - /* - // reset the ROI boundary - */ - pBoundaryIndex[i+1].rectangle.left += 2*CloseMaskSize; - pBoundaryIndex[i+1].rectangle.right -= 2*CloseMaskSize; - pBoundaryIndex[i+1].rectangle.bottom += 2*CloseMaskSize; - pBoundaryIndex[i+1].rectangle.top -= 2*CloseMaskSize; - offset += numSamples; - } - - - for(i = 0; i < numBoundaries; ++i){ - for(j = 0; j < numBoundaries; ++j){ - if(j != i){ - rectPoint[0].x = pBoundaryIndex[j+1].rectangle.left; - rectPoint[0].y = pBoundaryIndex[j+1].rectangle.bottom; - rectPoint[1].x = pBoundaryIndex[j+1].rectangle.left; - rectPoint[1].y = pBoundaryIndex[j+1].rectangle.top; - rectPoint[2].x = pBoundaryIndex[j+1].rectangle.right; - rectPoint[2].y = pBoundaryIndex[j+1].rectangle.bottom; - rectPoint[3].x = pBoundaryIndex[j+1].rectangle.right; - rectPoint[3].y = pBoundaryIndex[j+1].rectangle.top; - in[0] = 0; - in[1] = 0; - in[2] = 0; - in[3] = 0; - for(k = 0; k < 4; ++k){ - if((rectPoint[k].x > pBoundaryIndex[i+1].rectangle.left) && - (rectPoint[k].x < pBoundaryIndex[i+1].rectangle.right)){ - if((rectPoint[k].y > pBoundaryIndex[i+1].rectangle.bottom) && - (rectPoint[k].y < pBoundaryIndex[i+1].rectangle.top)){ - in[k] = 1; + hys_image[ptr+j] = 1; + flag = 0; + for(n = -1; n <= 1; ++n){ + for(m = -1; m <= 1; ++m){ + if(n == 0 && m == 0) continue; + if(((i+n) > 0) && ((j+m) > 0) && ((i+n) < rows) && ((j+m) < cols)){ + ptr = (i+n) * cols; + if(magImage[ptr+j+m] > cannyLow){ + /* + // this point is above low threshold + */ + if(trace_Edge(i+n, j+m, rows, cols, cannyLow, magImage, hys_image)){ + flag = 1; + break; } } } - if(in[0] && in[1] && in[2] && in[3]){ - pBoundaryIndex[j+1].isWithin = TRUE; - } } + if(flag) break; } + return(1); } - /* - // fill in the Python features - */ - for(i = 0; i < numBoundaries; ++i){ - objectMetrics[i].curveClose = pBoundaryIndex[i+1].curveClose; - objectMetrics[i].cXBoundary = pBoundaryIndex[i+1].centroid.x; - objectMetrics[i].cYBoundary = pBoundaryIndex[i+1].centroid.y; - objectMetrics[i].boundaryLength = pBoundaryIndex[i+1].boundaryLength; - objectMetrics[i].minRadius = pBoundaryIndex[i+1].minRadius; - objectMetrics[i].maxRadius = pBoundaryIndex[i+1].maxRadius; - objectMetrics[i].aveRadius = pBoundaryIndex[i+1].aveRadius; - objectMetrics[i].ratio = pBoundaryIndex[i+1].ratio; - objectMetrics[i].compactness = pBoundaryIndex[i+1].compactness; - } + return(0); - // debug only - if(0){ - for(i = 0; i < numBoundaries; ++i){ - if(pBoundaryIndex[i+1].boundaryLength != (float)0.0){ - printf("boundary %d:\n", i); - printf("\t\tRect (%d, %d, %d, %d)\n", pBoundaryIndex[i+1].rectangle.left, - pBoundaryIndex[i+1].rectangle.right, - pBoundaryIndex[i+1].rectangle.top, - pBoundaryIndex[i+1].rectangle.bottom); - printf("\t\tCentroid (%d, %d)\n", pBoundaryIndex[i+1].centroid.x, pBoundaryIndex[i+1].centroid.y); - printf("\t\tLength (%f)\n", pBoundaryIndex[i+1].boundaryLength); - printf("\t\tRatio (%f)\n", pBoundaryIndex[i+1].ratio); - printf("\t\taveRadius (%f)\n", pBoundaryIndex[i+1].aveRadius); - printf("\t\tLabel (%d)\n", pBoundaryIndex[i+1].Label); - printf("\t\tCompactness (%f)\n", pBoundaryIndex[i+1].compactness); - printf("\t\tCurveClose (%d)\n", pBoundaryIndex[i+1].curveClose); - if(pBoundaryIndex[i+1].isWithin){ - printf("\t\tContained (T)\n"); - } - else{ - printf("\t\tContained (F)\n"); - } - if(pBoundaryIndex[i+1].closedCurve){ - printf("\t\tclosedCurve (T)\n"); - } - else{ - printf("\t\tclosedCurve (F)\n"); - } - } - } - } - - /* - // need to return input which is now mask image - */ - - offset = 0; - offset2 = 0; - for(i = 0; i < srcRows; ++i){ - for(j = 0; j < srcCols; ++j){ - ThinEdgeImage[offset+j] = (unsigned short)Input[offset2+j]; - } - offset += srcCols; - offset2 += spadSize; - } - - free(pBoundaryIndex); - free(Input); - free(ImageE); - free(ImageC); - free(ImageH); - free(pBoundary); - free(lBoundary); - free(boundary); - free(cmask); - free(omask); - - return; - } +int NI_CannyHysteresis(int num, int rows, int cols, double *magImage, unsigned short *hys_image, + double cannyLow, double cannyHigh){ -void initLaws(LawsFilter7 *lawsFilter){ - - int i; - float sum; - float L7[7] = { 1.0, 6.0, 15.0, 20.0, 15.0, 6.0, 1.0}; - float E7[7] = {-1.0, -4.0, -5.0, 0.0, 5.0, 4.0, 1.0}; - float S7[7] = {-1.0, -2.0, 1.0, 4.0, 1.0, -2.0, -1.0}; - float W7[7] = {-1.0, 0.0, 3.0, 0.0, -3.0, 0.0, 1.0}; - float R7[7] = { 1.0, -2.0, -1.0, 4.0, -1.0, -2.0, 1.0}; - float O7[7] = {-1.0, 6.0, -15.0, 20.0, -15.0, 6.0, -1.0}; - - lawsFilter->numberKernels = 6; - lawsFilter->kernelLength = 7; - lawsFilter->numberFilterLayers = 21; - lawsFilter->name[0] = 'L'; - lawsFilter->name[1] = 'E'; - lawsFilter->name[2] = 'S'; - lawsFilter->name[3] = 'W'; - lawsFilter->name[4] = 'R'; - lawsFilter->name[5] = 'O'; - for(i = 0; i < 7; ++i){ - lawsFilter->lawsKernel[0][i] = L7[i]; - lawsFilter->lawsKernel[1][i] = E7[i]; - lawsFilter->lawsKernel[2][i] = S7[i]; - lawsFilter->lawsKernel[3][i] = W7[i]; - lawsFilter->lawsKernel[4][i] = R7[i]; - lawsFilter->lawsKernel[5][i] = O7[i]; - } - - /* L filter is unity gain */ - sum = (float)0.0; - for(i = 0; i < 7; ++i){ - sum += lawsFilter->lawsKernel[0][i]; - } - for(i = 0; i < 7; ++i){ - lawsFilter->lawsKernel[0][i] /= sum; - } - - return; - -} - -float lawsConvolution(float *image, float *rowFilter, float *colFilter, int kernelSize){ - + int status; int i, j; - int offset; - float result[7]; - float sum; + int ptr; - /* filter rows */ - for(i = 0; i < kernelSize; ++i){ - sum = (float)0.0; - offset = i * kernelSize; - for(j = 0; j < kernelSize; ++j){ - sum += (rowFilter[j]*image[offset+j]); - } - result[i] = sum; - } - - /* filter columns */ - sum = (float)0.0; - for(j = 0; j < kernelSize; ++j){ - sum += (rowFilter[j]*result[j]); - } - - return(sum); - -} - - -void getLawsTexture(LawsFilter7 lawsFilter, tTEM LawsFeatures[], - objStruct objectMetrics[], double *sourceImage, - unsigned short *MaskImage, int numberObjects, - int srcRows, int srcCols){ - - int i, j; - int label; - RECT bBox; - int aperature = (lawsFilter.kernelLength-1)/2; - unsigned char *ImageH; - float *ImageT; - float *lawsImage; - - ImageH = calloc(srcRows*srcCols, sizeof(unsigned char)); - ImageT = calloc(srcRows*srcCols, sizeof(float)); - lawsImage = calloc(lawsFilter.numberFilterLayers*srcRows*srcCols, sizeof(float)); - - for(i = 0; i < numberObjects; ++i){ - bBox.left = objectMetrics[i].L; - bBox.right = objectMetrics[i].R; - bBox.top = objectMetrics[i].T; - bBox.bottom = objectMetrics[i].B; - label = objectMetrics[i].Label; - if(objectMetrics[i].voxelMean != (float)0.0){ - /* - // valid size region - */ - computeLaws(lawsFilter, LawsFeatures, bBox, label, aperature, srcRows, srcCols, ImageH, ImageT, - MaskImage, lawsImage, sourceImage); - for(j = 1; j < lawsFilter.numberFilterLayers; ++j){ - objectMetrics[i].TEM[j-1] = LawsFeatures[j].Variance; + for(i = 0; i < rows; ++i){ + ptr = i * cols; + for(j = 0; j < cols; ++j){ + if(magImage[ptr+j] > cannyHigh){ + trace_Edge(i, j, rows, cols, cannyLow, magImage, hys_image); } - /* -- later will need to return a view of the texture images - int index; - int offset; - int layerStep = srcRows*srcCols; - if(label == debugBlob){ - index = 0; - for(j = 1; j < lawsFilter.numberFilterLayers; ++j){ - if(LawsFeatures[j].Variance == (float)1.0) index = j; - } - // overwrite the raw image - offset = index * layerStep; - for(j = 0; j < layerStep; ++j){ - sourceImage[j] = lawsImage[offset+j]; - } - } - */ } } - free(ImageH); - free(ImageT); - free(lawsImage); - return; + status = 1; -} - -void computeLaws(LawsFilter7 lawsFilter, tTEM LawsFeatures[], RECT roi, int label, - int aperature, int srcRows, int srcCols, - unsigned char *ImageH, float *ImageT, unsigned short *MaskImage, - float *lawsImage, double *sourceImage){ - - /* - // hard-wirred to Law's 7 kernels - */ - int i, j, k; - int lawsLayer; - int column, row; - int offset; - int maskOffset[7]; - int dataOffset[7]; - float myImage[49]; - int count; - int outerKernelNumber; - int innerKernelNumber; - int rowNumber; - int kernelSize = lawsFilter.kernelLength; - int fullMask = kernelSize*kernelSize; - int layerStep = srcRows*srcCols; - float *rowFilter; - float *colFilter; - float filterResult1; - float filterResult2; - float lawsLL=1.0; - float t; - float maxValue; - float scale; - char I, J; - char combo[24]; - char dual[24]; - - - /* zero the laws mask memory first */ - for(i = 0; i < srcRows*srcCols; ++i){ - ImageH[i] = 0; - } - for(j = 0; j < lawsFilter.numberFilterLayers; ++j){ - LawsFeatures[j].Mean = (float)0.0; - LawsFeatures[j].Variance = (float)0.0; - } - - for(i = roi.bottom+aperature; i < roi.top-aperature; ++i){ - // get the row array offset for mask and data source. - for(row = -aperature; row <= aperature; ++row){ - maskOffset[row+aperature] = (i+row)*srcCols; - dataOffset[row+aperature] = maskOffset[row+aperature]; - } - for(j = roi.left+aperature; j < roi.right-aperature; ++j){ - /* - // get 7x7 segment and make sure have 100% mask coverage - */ - count = 0; - for(row = -aperature; row <= aperature; ++row){ - rowNumber = (row+aperature)*kernelSize; - for(column = -aperature; column <= aperature; ++column){ - if(MaskImage[maskOffset[row+aperature]+j+column] == label){ - myImage[rowNumber+column+aperature] = sourceImage[dataOffset[row+aperature]+j+column]; - ++count; - } - } - } - if(count == fullMask){ - /* - // 100% coverage. now do the Law's texture filters - */ - ImageH[i*srcCols+j] = 1; - lawsLayer = 0; - for(outerKernelNumber = 0; outerKernelNumber < lawsFilter.numberKernels; ++outerKernelNumber){ - /* - // outer loop pulls the i'th kernel. kernel 0 is the LP kernel - // the outer loop is the iso-kernel - */ - I = lawsFilter.name[outerKernelNumber]; - sprintf(dual, "%c_%c", I, I); - rowFilter = &lawsFilter.lawsKernel[outerKernelNumber][0]; - colFilter = &lawsFilter.lawsKernel[outerKernelNumber][0]; - filterResult1 = lawsConvolution(myImage, rowFilter, colFilter, kernelSize); - /* lawsLayer 0 is the LP and needs to be used to scale. */ - if(outerKernelNumber){ - lawsImage[lawsLayer*layerStep + i*srcCols + j] = (float)2.0 * filterResult1 / lawsLL; - } - else{ - lawsLL = (float)2.0 * filterResult1; - lawsImage[lawsLayer*layerStep + i*srcCols + j] = (float)2.0 * filterResult1; - } - strcpy(&LawsFeatures[lawsLayer].filterName[0], dual); - ++lawsLayer; - /* - // now do the inner loop and get the column filters for the other laws kernels - */ - for(innerKernelNumber = outerKernelNumber+1; - innerKernelNumber < lawsFilter.numberKernels; - ++innerKernelNumber){ - J = lawsFilter.name[innerKernelNumber]; - sprintf(combo, "%c_%c", I, J); - strcpy(&LawsFeatures[lawsLayer].filterName[0], combo); - colFilter = &lawsFilter.lawsKernel[innerKernelNumber][0]; - filterResult1 = lawsConvolution(myImage, rowFilter, colFilter, kernelSize); - filterResult2 = lawsConvolution(myImage, colFilter, rowFilter, kernelSize); - lawsImage[lawsLayer*layerStep + i*srcCols + j] = - (filterResult1 / lawsLL) + (filterResult2 / lawsLL); - ++lawsLayer; - } - } - } - } - } - - for(i = 0; i < lawsFilter.numberFilterLayers; ++i){ - LawsFeatures[i].Mean = (float)0.0; - LawsFeatures[i].Variance = (float)0.0; - } - - count = 0; - for(i = roi.bottom+aperature; i < roi.top-aperature; ++i){ - row = i * srcCols; - for(j = roi.left+aperature; j < roi.right-aperature; ++j){ - if(ImageH[row+j]){ - ++count; - for(k = 0; k < lawsFilter.numberFilterLayers; ++k){ - offset = k * layerStep + row; - LawsFeatures[k].Mean += lawsImage[offset+j]; - } - } - } - } - - if(count == 0){ - // debug statement - // printf("no samples for texture\n"); - return; - } - - for(k = 0; k < lawsFilter.numberFilterLayers; ++k){ - LawsFeatures[k].Mean /= (float)count; - } - for(i = roi.bottom+aperature; i < roi.top-aperature; ++i){ - row = i * srcCols; - for(j = roi.left+aperature; j < roi.right-aperature; ++j){ - if(ImageH[row+j]){ - for(k = 0; k < lawsFilter.numberFilterLayers; ++k){ - offset = k * layerStep + row; - t = lawsImage[offset+j] - LawsFeatures[k].Mean; - LawsFeatures[k].Variance += (t * t); - } - } - } - } - for(k = 0; k < lawsFilter.numberFilterLayers; ++k){ - LawsFeatures[k].Variance /= (float)count; - LawsFeatures[k].Variance = (float)(sqrt(LawsFeatures[k].Variance)); - } - - /* - // now normalize the variance feature (TEM) - */ - maxValue = (float)0.0; - for(i = 1; i < lawsFilter.numberFilterLayers; ++i){ - if((LawsFeatures[i].Variance) > maxValue) maxValue = LawsFeatures[i].Variance; - } - scale = (float)1.0 / maxValue; - for(i = 1; i < lawsFilter.numberFilterLayers; ++i){ - LawsFeatures[i].Variance = scale * LawsFeatures[i].Variance; - } - - - return; - -} - -void getVoxelMeasures(objStruct objectMetrics[], double *sourceImage, - unsigned short *MaskImage, int numberObjects, - int srcRows, int srcCols){ - - int i, j, k; - int label; - int offset; - int count; - float mean, std, t; - RECT bBox; - - for(i = 0; i < numberObjects; ++i){ - bBox.left = objectMetrics[i].L; - bBox.right = objectMetrics[i].R; - bBox.top = objectMetrics[i].T; - bBox.bottom = objectMetrics[i].B; - label = objectMetrics[i].Label; - count = 0; - mean = (float)0.0; - for(j = bBox.bottom; j < bBox.top; ++j){ - offset = j * srcCols; - for(k = bBox.left; k < bBox.right; ++k){ - if(MaskImage[offset+k] == label){ - mean += sourceImage[offset+k]; - ++count; - } - } - } - if(count){ - mean /= (float)count; - std = (float)0.0; - for(j = bBox.bottom; j < bBox.top; ++j){ - offset = j * srcCols; - for(k = bBox.left; k < bBox.right; ++k){ - if(MaskImage[offset+k] == label){ - t = (sourceImage[offset+k]-mean); - std += (t * t); - } - } - } - } - if(count){ - std /= (float)count; - std = sqrt(std); - objectMetrics[i].voxelMean = mean; - objectMetrics[i].voxelVar = std; - } - else{ - objectMetrics[i].voxelMean = 0.0; - objectMetrics[i].voxelVar = 0.0; - } - } - - return; - -} - -int NI_BuildBoundary(int samples, int rows, int cols, int numberObjects, - unsigned short *edgeImage, objStruct objectMetrics[]){ - - int searchWindow = 5; // 5 is good value for Sobel - int status = 1; - - buildBoundary(objectMetrics, searchWindow, edgeImage, numberObjects, rows, cols); - return status; } -int NI_VoxelMeasures(int samples, int rows, int cols, int numberObjects, double *sourceImage, - unsigned short *maskImage, objStruct objectMetrics[]){ - int status = 1; - getVoxelMeasures(objectMetrics, sourceImage, maskImage, numberObjects, rows, cols); - return status; -} - - -int NI_TextureMeasures(int samples, int rows, int cols, int numberObjects, double *sourceImage, - unsigned short *maskImage, objStruct objectMetrics[]){ - - int status = 1; - LawsFilter7 lawsFilter; - tTEM LawsFeatures[21]; - - initLaws(&lawsFilter); - getLawsTexture(lawsFilter, LawsFeatures, objectMetrics, sourceImage, - maskImage, numberObjects, rows, cols); - - return status; - -} - - - From scipy-svn at scipy.org Tue Mar 11 22:47:52 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Tue, 11 Mar 2008 21:47:52 -0500 (CDT) Subject: [Scipy-svn] r4014 - trunk/scipy/ndimage Message-ID: <20080312024752.E576439C121@new.scipy.org> Author: tom.waite Date: 2008-03-11 21:47:46 -0500 (Tue, 11 Mar 2008) New Revision: 4014 Modified: trunk/scipy/ndimage/_segmenter.py Log: phase 1 of segmenter rewrite Modified: trunk/scipy/ndimage/_segmenter.py =================================================================== --- trunk/scipy/ndimage/_segmenter.py 2008-03-12 02:47:17 UTC (rev 4013) +++ trunk/scipy/ndimage/_segmenter.py 2008-03-12 02:47:46 UTC (rev 4014) @@ -2,25 +2,6 @@ import numpy as N import scipy.ndimage._segment as S -# Issue warning regarding heavy development status of this module -import warnings -_msg = "The segmenter code is under heavy development and therefore public \ -API will change in the future. The NIPY group is actively working on this \ -code, and has every intention of generalizing this for the Scipy community.\ -Use this module minimally, if at all, until it this warning is removed." -warnings.warn(_msg, UserWarning) - -# TODO: Add docstrings for public functions in extension code. -# Add docstrings to extension code. -#from numpy.lib import add_newdoc -#add_newdoc('scipy.ndimage._segment', 'canny_edges', -# """Canney edge detector. -# """) - - -# WARNING: _objstruct data structure mirrors a corresponding data structure -# in ndImage_Segmenter_structs.h that is built into the _segment.so library. -# These structs must match! _objstruct = N.dtype([('L', 'i'), ('R', 'i'), ('T', 'i'), @@ -44,317 +25,367 @@ ) -def shen_castan(image, IIRFilter=0.8, scLow=0.3, window=7, lowThreshold=220+2048, - highThreshold=600+2048, dust=16): +def canny_hysteresis(magnitude, canny_stats): """ - labeledEdges, ROIList = shen_castan(image, [default]) + edge_image = canny_hysteresis(magnitude, canny_stats) - implements Shen-Castan edge finding + hystereis stage of Canny filter - Inputs - image, IIR filter, shen_castan_low, window, low_threshold, high_threshold, dust - - image is the numarray 2D image - - IIR filter is filter parameter for exponential filter - - shen_castan_low is edge threshold is range (0.0, 1.0] - - window is search window for edge detection - - low_ and high_ threshold are density values - - dust is blob filter. blob area (length x width of bounding box) under this - size threshold are filtered (referred to as dust and blown away) + Parameters + .......... - Outputs - labeledEdges, ROIList[>dust] - - labeledEdges is boundary (edges) of segmented 'blobs', - numerically labeled by blob number - - ROIList[>dust] is a blob feature list. Only values - with bounding box area greater than dust threshold are returned + magnitude : {nd_array} + the output from the canny_nonmax_supress() method + canny_stats : {dictionary} + contains the low and high thesholds determined from canny_nonmax_supress() + + Returns + .......... + edge_image : {nd_array} + the labeled edge image that can be displayed and used for later processing + """ - labeledEdges, numberObjects = S.shen_castan_edges(scLow, IIRFilter, window, - lowThreshold, highThreshold, image) - # allocated struct array for edge object measures. for now just the rect bounding box - ROIList = N.zeros(numberObjects, dtype=_objstruct) - # return the bounding box for each connected edge - S.get_object_stats(labeledEdges, ROIList) - return labeledEdges, ROIList[ROIList['Area']>dust] + [rows, cols] = magnitude.shape + edge_image = N.zeros(rows*cols, dtype=N.int16).reshape(rows, cols) + S.canny_hysteresis(magnitude, edge_image, canny_stats['low'], canny_stats['high']) -def sobel(image, sLow=0.3, tMode=1, lowThreshold=220+2048, highThreshold=600+2048, BPHigh=10.0, - apearture=21, dust=16): + return edge_image + +def canny_nonmax_supress(horz_DGFilter, vert_DGFilter, img_means, thres=0.5, + mode=1, canny_l=0.5, canny_h=0.8): """ - labeledEdges, ROIList = sobel(image, [default]) + magnitude, canny_stats = canny_nonmax_supress(horz_DGFilter, vert_DGFilter, img_means, + thres=0.5, mode=1, canny_l=0.5, canny_h=0.8) - implements sobel magnitude edge finding + non-max supression stage of Canny filter - Inputs - image, sobel_low, tMode, low_threshold, high_threshold, - high_filter_cutoff, filter_aperature, dust - - image is the numarray 2D image - - sobel_low is edge threshold is range (0.0, 1.0] - - tMode is threshold mode: 1 for ave, 2 for mode (histogram peak) - - low_ and high_ threshold are density values - - high_filter_cutoff is digital high frequency cutoff in range (0.0, 180.0] - - aperature is odd filter kernel length - - dust is blob filter. blob area (length x width of bounding box) under this - size threshold are filtered (referred to as dust and blown away) + Parameters + .......... - Outputs - labeledEdges, ROIList[>dust] - - labeledEdges is boundary (edges) of segmented 'blobs', - numerically labeled by blob number - - ROIList[>dust] is a blob feature list. Only values - with bounding box area greater than dust threshold are returned + horz_DGFilter : {nd_array} + the horizonal filtered image using the derivative of Gaussian kernel filter. + this is the output of the canny_filter method - """ - # get sobel edge points. return edges that are labeled (1..numberObjects) - labeledEdges, numberObjects = S.sobel_edges(sLow, tMode, lowThreshold, - highThreshold, BPHigh, apearture, image) - # allocated struct array for edge object measures. for now just the rect bounding box - ROIList = N.zeros(numberObjects, dtype=_objstruct) - # return the bounding box for each connected edge - S.get_object_stats(labeledEdges, ROIList) - # thin (medial axis transform) of the sobel edges as the sobel produces a 'band edge' - S.morpho_thin_filt(labeledEdges, ROIList) - return labeledEdges, ROIList[ROIList['Area']>dust] + vert_DGFilter : {nd_array} + the vertical filtered image using the derivative of Gaussian kernel filter. + this is the output of the canny_filter method -def canny(image, cSigma=1.0, cLow=0.5, cHigh=0.8, tMode=1, lowThreshold=220+2048, - highThreshold=600+2048, BPHigh=10.0, apearture=21, dust=16): - """ - labeledEdges, ROIList = canny(image, [default]) + img_means : {dictionary} + mean X and Y values of edge signals determined from canny_filter - implements canny edge finding + thres : {float}, optional + edge threshold applied to x and y filtered means - Inputs - image, DG_sigma, canny_low, canny_high, tMode, low_threshold, - high_threshold, high_filter_cutoff, filter_aperature, dust - - image is the numarray 2D image - - DG_sigma is Gaussain sigma for the derivative-of-gaussian filter - - clow is low edge threshold is range (0.0, 1.0] - - chigh is high edge threshold is range (0.0, 1.0] - - tMode is threshold mode: 1 for ave, 2 for mode (histogram peak) - - low_ and high_ threshold are density values - - high_filter_cutoff is digital high frequency cutoff in range (0.0, 180.0] - - high_filter_cutoff is digital high frequency cutoff in range (0.0, 180.0] - - aperature is odd filter kernel length - - dust is blob filter. blob area (length x width of bounding box) under this - size threshold are filtered (referred to as dust and blown away) + mode : {0, 1}, optional + threshold based on histogram mean(0) or mode(1) - Outputs - labeledEdges, ROIList[>dust] - - labeledEdges is boundary (edges) of segmented 'blobs', - numerically labeled by blob number - - ROIList[>dust] is a blob feature list. Only values - with bounding box area greater than dust threshold are returned + canny_low : {float}, optional + low threshold applied to magnitude filtered + + canny_high : {float}, optional + high threshold applied to magnitude filtered + Returns + .......... + + magnitude : {nd_array} + magnitude of X and Y filtered for critical samples + + canny_stats : {dictionary} + mean, low and high to be used for hysteresis + """ - # get canny edge points. return edges that are labeled (1..numberObjects) - labeledEdges, numberObjects = S.canny_edges(cSigma, cLow, cHigh, tMode, lowThreshold, highThreshold, - BPHigh, apearture, image) - # allocated struct array for edge object measures. for now just the rect bounding box - ROIList = N.zeros(numberObjects, dtype=_objstruct) - # return the bounding box for each connected edge - S.get_object_stats(labeledEdges, ROIList) - return labeledEdges, ROIList[ROIList['Area']>dust] + [rows, cols] = horz_DGFilter.shape + magnitude = N.zeros(rows*cols, dtype=N.float64).reshape(rows, cols) + aveMag, canny_low, canny_high = S.canny_nonmax_supress(horz_DGFilter, vert_DGFilter, + magnitude, mode, img_means['x-dg']*thres, + img_means['y-dg']*thres, canny_l, canny_h) -def get_shape_mask(labeledEdges, ROIList): + canny_stats = {'mean' : aveMag, 'low' : canny_low, 'high' : canny_high} + + return magnitude, canny_stats + +def canny_filter(slice, dg_kernel): """ - get_shape_mask(labeledEdges, ROIList) + horz_DGFilter, vert_DGFilter, img_means = canny_filter(slice, dg_kernel) - takes labeled edge image plus ROIList (blob descriptors) and generates - boundary shape features and builds labeled blob masks. 'labeledEdges' - is over-written by 'labeledMask'. Adds features to ROIList structure + Canny derivative of Gaussian filter + returns the X and Y filterd image - Inputs - labeledEdges, ROIList - - labeledEdges is boundary (edges) of segmented 'blobs', - numerically labeled by blob number - - ROIList is a blob feature list. + Parameters + .......... - Output - no return. edge image input is over-written with mask image. - ROIList added to. + slice : {nd_array} + 2D image array - """ + dg_kernel : {dictionary} + derivative of Gaussian kernel from build_d_gauss_kernel() - # pass in Sobel morph-thinned labeled edge image (LEI) and ROIList - # GetShapeMask will augment the ROI list - # labeledEdges is the original edge image and overwritten as mask image - # maskImage is the mask that is used for blob texture / pixel features - S.build_boundary(labeledEdges, ROIList) - return + Returns + .......... -def get_voxel_measures(rawImage, labeledEdges, ROIList): + horz_DGFilter : {nd_array} + X filtered image + + vert_DGFilter : {nd_array} + Y filtered image + + img_means : {dictionary} + + """ - get_voxel_measures(rawImage, labeledEdges, ROIList) + [rows, cols] = slice.shape + horz_DGFilter = N.zeros(rows*cols, dtype=N.float64).reshape(rows, cols) + vert_DGFilter = N.zeros(rows*cols, dtype=N.float64).reshape(rows, cols) + aveX, aveY = S.canny_filter(slice, horz_DGFilter, vert_DGFilter, + dg_kernel['coefficients'], dg_kernel['kernelSize']) - takes raw 2D image, labeled blob mask and ROIList. computes voxel features - (moments, histogram) for each blob. Adds features to ROIList structure. + img_means = {'x-dg' : aveX, 'y-dg' : aveY} - Inputs - rawImage, labeledEdges, ROIList - - rawImage is the original source 2D image - - labeledEdges is boundary (edges) of segmented 'blobs', - numerically labeled by blob number - - ROIList is a blob feature list. + return horz_DGFilter, vert_DGFilter, img_means - Output - no return. ROIList added to. +def mat_filter(label_image, thin_kernel, ROI=None): """ - # - # pass raw image, labeled mask and the partially filled ROIList - # VoxelMeasures will fill the voxel features in the list - # - S.voxel_measures(rawImage, labeledEdges, ROIList) - return + mat_image = mat_filter(label_image, thin_kernel, ROI=None) -def get_texture_measures(rawImage, labeledEdges, ROIList): + takes the ROI dictionary with the blob bounding boxes and thins each blob + giving the medial axis. if ROI is null will create a single ROI with the + bounding box set equal to the full image + + Parameters + .......... + + label_image : {nd_array} + an image with labeled regions from get_blobs() method + + thin_kernel : {dictionary} + set of 8 'J' and 'K' 3x3 masks from build_morpho_thin_masks() method + + ROI : {dictionary} + Region of Interest structure that has blob bounding boxes + + Returns + .......... + + mat_image : {nd_array} + thinned edge image + """ - get_texture_measures(rawImage, labeledEdges, ROIList) + if ROI==None: + ROIList = N.zeros(1, dtype=_objstruct) + [rows, cols] = label_image.shape + ROIList['L'] = 2 + ROIList['R'] = cols-3 + ROIList['B'] = 2 + ROIList['T'] = rows-3 - takes raw 2D image, labeled blob mask and ROIList. computes 2D - texture features using 7x7 Law's texture filters applied - to segmented blobs. TEM (texture energy metric) is computed - for each Law's filter image and stored in TEM part of ROIList. + [rows, cols] = label_image.shape + # destination image + thin_edge_image = N.zeros(rows*cols, dtype=N.uint16).reshape(rows, cols) + mat_image = N.zeros(rows*cols, dtype=N.uint16).reshape(rows, cols) + # scratch memory for thin + input = N.zeros(rows*cols, dtype=N.uint8).reshape(rows, cols) + cinput = N.zeros(rows*cols, dtype=N.uint8).reshape(rows, cols) + erosion = N.zeros(rows*cols, dtype=N.uint8).reshape(rows, cols) + dialation = N.zeros(rows*cols, dtype=N.uint8).reshape(rows, cols) + hmt = N.zeros(rows*cols, dtype=N.uint8).reshape(rows, cols) + copy = N.zeros(rows*cols, dtype=N.uint8).reshape(rows, cols) - Inputs - rawImage, labeledEdges, ROIList - - rawImage is the original source 2D image - - labeledEdges is boundary (edges) of segmented 'blobs', - numerically labeled by blob number - - ROIList is a blob feature list. + number_regions = ROI.size + indices = range(0, number_regions) + inflate = 1 + for i in indices: + left = ROI[i]['L']-1 + right = ROI[i]['R']+1 + bottom = ROI[i]['B']-1 + top = ROI[i]['T']+1 + Label = ROI[i]['Label'] + if left < 0: + left = 0 + if bottom < 0: + bottom = 0 + if right > cols-1: + right = cols-1 + if top > rows-1: + top = rows-1 - Output - no return. ROIList added to. + roi_rows = top-bottom+2*inflate + roi_cols = right-left+2*inflate + rgrows = top-bottom + rgcols = right-left + # clear the memory + input[0:roi_rows, 0:roi_cols] = 0 + # load the labeled region + input[inflate:inflate+rgrows, inflate:inflate+rgcols] \ + [label_image[bottom:top, left:right]==Label] = 1 + # thin this region + S.thin_filter(thin_kernel['jmask'], thin_kernel['kmask'], thin_kernel['number3x3Masks'], + roi_rows, roi_cols, cols, input, cinput, erosion, dialation, hmt, copy); + + # accumulate the images (do not over-write). for overlapping regions + input[inflate:rgrows+inflate,inflate:rgcols+inflate] \ + [input[inflate:rgrows+inflate,inflate:rgcols+inflate]==1] = Label + thin_edge_image[bottom:top,left:right] = thin_edge_image[bottom:top,left:right] + \ + input[inflate:rgrows+inflate,inflate:rgcols+inflate] + + + mat_image[:, :] = thin_edge_image[:, :] + # accumulate overlaps set back to 1 + + return mat_image + + +def get_blob_regions(labeled_image, groups, dust=16): """ - # - # pass raw image, labeled mask and the partially filled ROIList - # VoxelMeasures will fill the texture (Law's, sub-edges, co-occurence, Gabor) features in the list - # - S.texture_measures(rawImage, labeledEdges, ROIList) - return + ROIList = get_blob_regions(labeled_image, groups, dust=16) -def segment_regions(filename): + get the bounding box for each labelled blob in the image + allocate the dictionary structure that gets filled in with later + stage processing to add blob features. + + Parameters + .......... + + label_image : {nd_array} + an image with labeled regions from get_blobs() method + + groups : {int} + number of blobs in image determined by get_blobs() method + + Returns + .......... + + ROIList : {dictionary} + structure that has the bounding box and area of each blob + + + """ - sourceImage, labeledMask, ROIList = segment_regions() + ROIList = N.zeros(groups, dtype=_objstruct) + # return the bounding box for each connected edge + S.get_blob_regions(labeled_image, ROIList) - Inputs - No Input + return ROIList[ROIList['Area']>dust] - Outputs - sourceImage, labeledMask, ROIList - - sourceImage is raw 2D image (default cardiac CT slice for demo - - labeledMask is mask of segmented 'blobs', - numerically labeled by blob number - - ROIList is numerical Python structure of intensity, shape and - texture features for each blob - High level script calls Python functions: - get_slice() - a cardiac CT slice demo file - sobel() - sobel magnitude edge finder, - returns connected edges - get_shape_mask() - gets segmented blob boundary and mask - and shape features - get_voxel_measures() - uses masks get object voxel moment - and histogram features - get_texture_measures() - uses masks get object 2D texture features +def get_blobs(binary_edge_image): """ - # get slice from the CT volume - image = get_slice(filename) - # need a copy of original image as filtering will occur on the extracted slice - sourceImage = image.copy() - # Sobel is the first level segmenter. Sobel magnitude and MAT (medial axis transform) - # followed by connected component analysis. What is returned is labeled edges and the object list - labeledMask, ROIList = sobel(image) - # From the labeled edges and the object list get the labeled mask for each blob object - get_shape_mask(labeledMask, ROIList) - # Use the labeled mask and source image (raw) to get voxel features - get_voxel_measures(sourceImage, labeledMask, ROIList) - # Use the labeled mask and source image (raw) to get texture features - get_texture_measures(sourceImage, labeledMask, ROIList) - return sourceImage, labeledMask, ROIList -def grow_regions(filename): + labeled_edge_image, groups = get_blobs(binary_edge_image) + + get the total number of blobs in a 2D image and convert the binary + image to labelled regions + + Parameters + .......... + + binary_edge_image : {nd_array} + an binary image + + Returns + .......... + + label_image : {nd_array} + an image with labeled regions from get_blobs() method + + groups : {int} + number of blobs in image determined by get_blobs() method + """ - regionMask, numberRegions = region_grow() - Inputs - No Input - Outputs - regionMask, numberRegions - - regionMask is the labeled segment masks from 2D image - - numberRegions is the number of segmented blobs + [rows, cols] = binary_edge_image.shape + labeled_edge_image = N.zeros(rows*cols, dtype=N.uint16).reshape(rows, cols) + groups = S.get_blobs(binary_edge_image, labeled_edge_image) - High level script calls Python functions: - get_slice() - a cardiac CT slice demo file - region_grow() - "grows" connected blobs. default threshold - and morphological filter structuring element + return labeled_edge_image, groups + + +def sobel_edges(sobel_edge_image, sobel_stats, mode=1, sobel_threshold=0.3): """ - # get slice from the CT volume - image = get_slice(filename) - regionMask, numberRegions = region_grow(image) - return regionMask, numberRegions + sobel_edge = sobel_edges(sobel_edge_image, sobel_stats, mode=1, sobel_threshold=0.3) + take sobel-filtered image and return binary edges + Parameters + .......... -def region_grow(image, lowThreshold=220+2048, highThreshold=600+2048, open=7, close=7): + sobel_edge_image : {nd_array} + edge-filtered image from sobel_image() method + + sobel_stats : {dictionary} + mean and nonzero min, max of sobel filtering + + mode : {0, 1}, optional + threshold based on histogram mean(0) or mode(1) + + sobel_threshold : {float}, optional + low threshold applied to edge filtered image for edge generation + + Returns + .......... + + sobel_edge : {nd_array} + binary edge-image + """ - regionMask, numberRegions = region_grow(image, [defaults]) + [rows, cols] = sobel_edge_image.shape + sobel_edge = N.zeros(rows*cols, dtype=N.uint16).reshape(rows, cols) + S.sobel_edges(sobel_edge_image, sobel_edge, sobel_stats['ave_gt0'], sobel_stats['min_gt0'], + sobel_stats['max_gt0'], mode, sobel_threshold) - Inputs - image, low_threshold, high_threshold, open, close - - image is the numarray 2D image - - low_ and high_ threshold are density values - - open is open morphology structuring element - odd size. 0 to turn off. max is 11 - - close is close morphology structuring element - odd size. 0 to turn off. max is 11 + return sobel_edge - Outputs - regionMask, numberRegions - - regionMask is the labeled segment masks from 2D image - - numberRegions is the number of segmented blobs + +def sobel_image(filtered_slice): """ - # morphology filters need to be clipped to 11 max and be odd - regionMask, numberRegions = S.region_grow(lowThreshold, highThreshold, close, open, image) - return regionMask, numberRegions - + sobel_edge_image, sobel_stats = sobel_image(filtered_slice) -def get_slice(imageName='slice112.raw', bytes=2, rows=512, columns=512): - # get a slice alrady extracted from the CT volume - #image = open(imageName, 'rb') - #slice = image.read(rows*columns*bytes) - #values = struct.unpack('h'*rows*columns, slice) - #ImageSlice = N.array(values, dtype=float).reshape(rows, columns) + take 2D raw or filtered image slice and get sobel-filtered image - ImageSlice = N.fromfile(imageName, dtype=N.uint16).reshape(rows, columns); + Parameters + .......... - # clip the ends for this test CT image file as the spine runs off the end of the image - ImageSlice[505:512, :] = 0 - return (ImageSlice).astype(float) + filtered_slice : {nd_array} + raw or pre-processed (filtered and thresholded) 2D image -def get_slice2(image_name='slice112.raw', bytes=2, shape=(512,512)): - import mmap - file = open(image_name, 'rb') - mm = mmap.mmap(file.fileno(), 0, access=mmap.ACCESS_READ) - slice = N.frombuffer(mm, dtype='u%d' % bytes).reshape(shape) - slice = slice.astype(float) - # this is for the test CT as spine runs off back of image - slice[505:512,:] = 0 - return slice + Returns + .......... -def save_slice(mySlice, filename='junk.raw', bytes=4): - # just save the slice to a fixed file - slice = mySlice.astype('u%d' % bytes) - slice.tofile(filename) + sobel_edge_image : {nd_array} + edge-filtered image from sobel_image() method -def build_d_gauss_kernel(gWidth=21, sigma=1.0): + sobel_stats : {dictionary} + mean and nonzero min, max of sobel filtering """ - build the derivative of Gaussian kernel for Canny edge filter - DGFilter = build_d_gauss_kernel(gWidth, sigma) - Inputs: - gWdith is width of derivative of Gaussian kernel - sigma is sigma term of derivative of Gaussian kernel - Output: - DGFilter (a struct). Use in Canny filter call + [rows, cols] = filtered_slice.shape + sobel_edge_image = N.zeros(rows*cols, dtype=N.float64).reshape(rows, cols) + pAve, min_value, max_value = S.sobel_image(filtered_slice, sobel_edge_image) + sobel_stats= {'ave_gt0' : pAve, 'min_gt0': min_value, 'max_gt0': max_value} + return sobel_edge_image, sobel_stats + +def pre_filter(slice, filter, low_threshold=2048+220, high_threshold=600+2048): """ - kernel = N.zeros((1+2*(gWidth-1)), dtype=float) - indices = range(1, gWidth) + take 2D image slice and filter and pre-filter and threshold prior to segmentation - i = 0 - kernel[gWidth-1] = math.exp(((-i*i)/(2.0 * sigma * sigma))) - kernel[gWidth-1] *= -(i / (sigma * sigma)) - for i in indices: - kernel[gWidth-1+i] = math.exp(((-i*i)/(2.0 * sigma * sigma))) - kernel[gWidth-1+i] *= -(i / (sigma * sigma)) - kernel[gWidth-1-i] = -kernel[gWidth-1+i] + """ - DGFilter= {'kernelSize' : gWidth, 'coefficients': kernel} + [rows, cols] = slice.shape + edge_image = N.zeros(rows*cols, dtype=N.float64).reshape(rows, cols) + S.edge_prefilter(low_threshold, high_threshold, filter['kernelSize'], filter['kernel'], + slice, edge_image) - return DGFilter + return edge_image + +def get_slice(imageName='slice112.raw', bytes=2, rows=512, columns=512): + # clip the ends for this test CT image file as the spine runs off the end of the image + ImageSlice = N.fromfile(imageName, dtype=N.uint16).reshape(rows, columns) + ImageSlice[505:512, :] = 0 + return ImageSlice + def build_2d_kernel(aperature=21, hiFilterCutoff=10.0): - """ build flat FIR filter with sinc kernel this is bandpass, but low cutoff is 0.0 @@ -371,7 +402,7 @@ rad = math.pi / 180.0 HalfFilterTaps = (aperature-1) / 2 - kernel = N.zeros((aperature), dtype=N.float32) + kernel = N.zeros((aperature), dtype=N.float64) LC = 0.0 HC = hiFilterCutoff * rad t2 = 2.0 * math.pi @@ -395,41 +426,34 @@ sum = kernel.sum() kernel /= sum - FIRFilter= {'kernelSize' : aperature, 'coefficients': kernel} + FIRFilter= {'kernelSize' : HalfFilterTaps, 'kernel': kernel} return FIRFilter +def build_d_gauss_kernel(gWidth=20, sigma=1.0): -def build_laws_kernel(): - """ - build 6 length-7 Law's texture filter masks - mask names are: 'L', 'S', 'E', 'W', 'R', 'O' - - LAWSFilter = build_laws_kernel() - + build the derivative of Gaussian kernel for Canny edge filter + DGFilter = build_d_gauss_kernel(gWidth, sigma) Inputs: - None - + gWdith is width of derivative of Gaussian kernel + sigma is sigma term of derivative of Gaussian kernel Output: - LAWSFilter (a struct) + DGFilter (a dictionary). Use in Canny filter call """ - aperature = (6, 7) - coefficients = N.zeros((aperature), dtype=N.float32) - names = ('L', 'E', 'S', 'W', 'R', 'O' ) - coefficients[0, :] = ( 1.0, 6.0, 15.0, 20.0, 15.0, 6.0, 1.0 ) - coefficients[1, :] = (-1.0, -4.0, -5.0, 0.0, 5.0, 4.0, 1.0 ) - coefficients[2, :] = (-1.0, -2.0, 1.0, 4.0, 1.0, -2.0, -1.0 ) - coefficients[3, :] = (-1.0, 0.0, 3.0, 0.0, -3.0, 0.0, 1.0 ) - coefficients[4, :] = ( 1.0, -2.0, -1.0, 4.0, -1.0, -2.0, 1.0 ) - coefficients[5, :] = (-1.0, 6.0, -15.0, 20.0, -15.0, 6.0, -1.0 ) + kernel = N.zeros((1+gWidth), dtype=N.float64) + indices = range(0, gWidth) - LAWSFilter= {'numKernels' : 6, 'kernelSize' : 7, 'coefficients': coefficients, 'names': names} + for i in indices: + kernel[i] = math.exp(((-i*i)/(2.0 * sigma * sigma))) + kernel[i] *= -(i / (sigma * sigma)) - return LAWSFilter + DGFilter= {'kernelSize' : gWidth, 'coefficients': kernel} + return DGFilter + def build_morpho_thin_masks(): """ @@ -447,81 +471,97 @@ """ # (layers, rows, cols) - shape = (8, 3, 3) - J_mask = N.zeros((shape), dtype=N.ushort) - K_mask = N.zeros((shape), dtype=N.ushort) + size = (8*3*3) + J_mask = N.zeros(size, dtype=N.int16) + K_mask = N.zeros(size, dtype=N.int16) + maskCols = 3 # load the 8 J masks for medial axis transformation - J_mask[0][0][0] = 1; - J_mask[0][0][1] = 1; - J_mask[0][0][2] = 1; - J_mask[0][1][1] = 1; + Column = 0 + J_mask[0+maskCols*(Column+0)] = 1 + J_mask[0+maskCols*(Column+1)] = 1 + J_mask[0+maskCols*(Column+2)] = 1 + J_mask[1+maskCols*(Column+1)] = 1 - J_mask[1][0][1] = 1; - J_mask[1][1][1] = 1; - J_mask[1][1][2] = 1; + Column += 3 + J_mask[0+maskCols*(Column+1)] = 1 + J_mask[1+maskCols*(Column+1)] = 1 + J_mask[1+maskCols*(Column+2)] = 1 - J_mask[2][0][0] = 1; - J_mask[2][1][0] = 1; - J_mask[2][2][0] = 1; - J_mask[2][1][1] = 1; + Column += 3 + J_mask[0+maskCols*(Column+0)] = 1 + J_mask[1+maskCols*(Column+0)] = 1 + J_mask[2+maskCols*(Column+0)] = 1 + J_mask[1+maskCols*(Column+1)] = 1 - J_mask[3][0][1] = 1; - J_mask[3][1][0] = 1; - J_mask[3][1][1] = 1; + Column += 3 + J_mask[0+maskCols*(Column+1)] = 1 + J_mask[1+maskCols*(Column+0)] = 1 + J_mask[1+maskCols*(Column+1)] = 1 - J_mask[4][0][2] = 1; - J_mask[4][1][1] = 1; - J_mask[4][1][2] = 1; - J_mask[4][2][2] = 1; + Column += 3 + J_mask[0+maskCols*(Column+2)] = 1 + J_mask[1+maskCols*(Column+1)] = 1 + J_mask[1+maskCols*(Column+2)] = 1 + J_mask[2+maskCols*(Column+2)] = 1 - J_mask[5][1][0] = 1; - J_mask[5][1][1] = 1; - J_mask[5][2][1] = 1; + Column += 3 + J_mask[1+maskCols*(Column+0)] = 1 + J_mask[1+maskCols*(Column+1)] = 1 + J_mask[2+maskCols*(Column+1)] = 1 - J_mask[6][1][1] = 1; - J_mask[6][2][0] = 1; - J_mask[6][2][1] = 1; - J_mask[6][2][2] = 1; + Column += 3 + J_mask[1+maskCols*(Column+1)] = 1 + J_mask[2+maskCols*(Column+0)] = 1 + J_mask[2+maskCols*(Column+1)] = 1 + J_mask[2+maskCols*(Column+2)] = 1 - J_mask[7][1][1] = 1; - J_mask[7][1][2] = 1; - J_mask[7][2][1] = 1; + Column += 3 + J_mask[1+maskCols*(Column+1)] = 1 + J_mask[1+maskCols*(Column+2)] = 1 + J_mask[2+maskCols*(Column+1)] = 1 - # load the 8 K masks for medial axis transformation - K_mask[0][2][0] = 1; - K_mask[0][2][1] = 1; - K_mask[0][2][2] = 1; + Column = 0 + K_mask[2+maskCols*(Column+0)] = 1 + K_mask[2+maskCols*(Column+1)] = 1 + K_mask[2+maskCols*(Column+2)] = 1 + + Column += 3 + K_mask[1+maskCols*(Column+0)] = 1 + K_mask[2+maskCols*(Column+0)] = 1 + K_mask[2+maskCols*(Column+1)] = 1 + + Column += 3 + K_mask[0+maskCols*(Column+2)] = 1 + K_mask[1+maskCols*(Column+2)] = 1 + K_mask[2+maskCols*(Column+2)] = 1 - K_mask[1][1][0] = 1; - K_mask[1][2][0] = 1; - K_mask[1][2][1] = 1; + Column += 3 + K_mask[1+maskCols*(Column+2)] = 1 + K_mask[2+maskCols*(Column+1)] = 1 + K_mask[2+maskCols*(Column+2)] = 1 - K_mask[2][0][2] = 1; - K_mask[2][1][2] = 1; - K_mask[2][2][2] = 1; + Column += 3 + K_mask[0+maskCols*(Column+0)] = 1 + K_mask[1+maskCols*(Column+0)] = 1 + K_mask[2+maskCols*(Column+0)] = 1 - K_mask[3][1][2] = 1; - K_mask[3][2][1] = 1; - K_mask[3][2][2] = 1; + Column += 3 + K_mask[0+maskCols*(Column+1)] = 1 + K_mask[0+maskCols*(Column+2)] = 1 + K_mask[1+maskCols*(Column+2)] = 1 - K_mask[4][0][0] = 1; - K_mask[4][1][0] = 1; - K_mask[4][2][0] = 1; + Column += 3 + K_mask[0+maskCols*(Column+0)] = 1 + K_mask[0+maskCols*(Column+1)] = 1 + K_mask[0+maskCols*(Column+2)] = 1 - K_mask[5][0][1] = 1; - K_mask[5][0][2] = 1; - K_mask[5][1][2] = 1; + Column += 3 + K_mask[0+maskCols*(Column+0)] = 1 + K_mask[0+maskCols*(Column+1)] = 1 + K_mask[1+maskCols*(Column+0)] = 1 - K_mask[6][0][0] = 1; - K_mask[6][0][1] = 1; - K_mask[6][0][2] = 1; - - K_mask[7][0][0] = 1; - K_mask[7][0][1] = 1; - K_mask[7][1][0] = 1; - MATFilter = {'number3x3Masks' : 8, 'jmask' : J_mask, 'kmask' : K_mask} return MATFilter From scipy-svn at scipy.org Wed Mar 12 04:57:07 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Wed, 12 Mar 2008 03:57:07 -0500 (CDT) Subject: [Scipy-svn] r4015 - trunk/scipy/sparse/linalg/eigen/arpack Message-ID: <20080312085707.081AE39C0E1@new.scipy.org> Author: stefan Date: 2008-03-12 03:57:03 -0500 (Wed, 12 Mar 2008) New Revision: 4015 Modified: trunk/scipy/sparse/linalg/eigen/arpack/arpack.py Log: Do not force eigen return type to be a matrix. Modified: trunk/scipy/sparse/linalg/eigen/arpack/arpack.py =================================================================== --- trunk/scipy/sparse/linalg/eigen/arpack/arpack.py 2008-03-12 02:47:46 UTC (rev 4014) +++ trunk/scipy/sparse/linalg/eigen/arpack/arpack.py 2008-03-12 08:57:03 UTC (rev 4015) @@ -301,7 +301,7 @@ raise RuntimeError("Error info=%d in arpack"%info) return None if return_eigenvectors: - return d,np.asmatrix(z) + return d,z return d @@ -482,5 +482,5 @@ raise RuntimeError("Error info=%d in arpack"%info) return None if return_eigenvectors: - return d,np.asmatrix(z) + return d,z return d From scipy-svn at scipy.org Thu Mar 13 03:38:59 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Thu, 13 Mar 2008 02:38:59 -0500 (CDT) Subject: [Scipy-svn] r4016 - trunk/scipy Message-ID: <20080313073859.6837B39C117@new.scipy.org> Author: cdavid Date: 2008-03-13 02:38:51 -0500 (Thu, 13 Mar 2008) New Revision: 4016 Modified: trunk/scipy/__init__.py Log: Put a meaningful message when importing scipy from its source tree. Modified: trunk/scipy/__init__.py =================================================================== --- trunk/scipy/__init__.py 2008-03-12 08:57:03 UTC (rev 4015) +++ trunk/scipy/__init__.py 2008-03-13 07:38:51 UTC (rev 4016) @@ -45,7 +45,13 @@ # imported. del linalg -from __config__ import show as show_config +try: + from __config__ import show as show_config +except ImportError, e: + msg = """Error importing scipy: you cannot import scipy while + being in scipy source directory; please exit the scipy source + tree first, and relaunch your python intepreter.""" + raise ImportError(msg) from version import version as __version__ # Load scipy packages, their global_symbols, set up __doc__ string. From scipy-svn at scipy.org Thu Mar 13 10:25:17 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Thu, 13 Mar 2008 09:25:17 -0500 (CDT) Subject: [Scipy-svn] r4017 - trunk/scipy/sparse/sparsetools Message-ID: <20080313142517.C688439C049@new.scipy.org> Author: wnbell Date: 2008-03-13 09:24:58 -0500 (Thu, 13 Mar 2008) New Revision: 4017 Modified: trunk/scipy/sparse/sparsetools/sparsetools.h trunk/scipy/sparse/sparsetools/sparsetools_wrap.cxx Log: disable fixed size bsr_matvec implementation Modified: trunk/scipy/sparse/sparsetools/sparsetools.h =================================================================== --- trunk/scipy/sparse/sparsetools/sparsetools.h 2008-03-13 07:38:51 UTC (rev 4016) +++ trunk/scipy/sparse/sparsetools/sparsetools.h 2008-03-13 14:24:58 UTC (rev 4017) @@ -767,7 +767,6 @@ } -#define F(X,Y,Z) bsr_matmat_pass2_fixed template void bsr_matmat_pass2(const I n_brow, const I n_bcol, @@ -778,7 +777,9 @@ { assert(R > 0 && C > 0 && N > 0); -#ifdef TESTING +#ifdef SPARSETOOLS_TESTING +#define F(X,Y,Z) bsr_matmat_pass2_fixed + void (*dispatch[4][4][4])(I,I,const I*,const I*,const T*, const I*,const I*,const T*, I*, I*, T*) = \ @@ -809,6 +810,8 @@ dispatch[R-1][N-1][C-1](n_brow,n_bcol,Ap,Aj,Ax,Bp,Bj,Bx,Cp,Cj,Cx); return; } + +#undef F #endif const I RC = R*C; @@ -872,7 +875,6 @@ } } -#undef F @@ -1492,7 +1494,6 @@ * */ -#define F(X,Y) bsr_matvec_fixed template void bsr_matvec(const I n_brow, @@ -1507,6 +1508,9 @@ { assert(R > 0 && C > 0); +#ifdef SPARSETOOLS_TESTING +#define F(X,Y) bsr_matvec_fixed + void (*dispatch[8][8])(I,I,const I*,const I*,const T*,const T*,T*) = \ { { F(1,1), F(1,2), F(1,3), F(1,4), F(1,5), F(1,6), F(1,7), F(1,8) }, @@ -1524,6 +1528,8 @@ return; } +#undef F +#endif //otherwise use general method for(I i = 0; i < R*n_brow; i++){ @@ -1549,7 +1555,6 @@ } } } -#undef F Modified: trunk/scipy/sparse/sparsetools/sparsetools_wrap.cxx =================================================================== --- trunk/scipy/sparse/sparsetools/sparsetools_wrap.cxx 2008-03-13 07:38:51 UTC (rev 4016) +++ trunk/scipy/sparse/sparsetools/sparsetools_wrap.cxx 2008-03-13 14:24:58 UTC (rev 4017) @@ -147,7 +147,7 @@ /* This should only be incremented when either the layout of swig_type_info changes, or for whatever reason, the runtime changes incompatibly */ -#define SWIG_RUNTIME_VERSION "3" +#define SWIG_RUNTIME_VERSION "4" /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */ #ifdef SWIG_TYPE_TABLE @@ -182,6 +182,7 @@ /* Flags for pointer conversions */ #define SWIG_POINTER_DISOWN 0x1 +#define SWIG_CAST_NEW_MEMORY 0x2 /* Flags for new pointer objects */ #define SWIG_POINTER_OWN 0x1 @@ -322,10 +323,10 @@ extern "C" { #endif -typedef void *(*swig_converter_func)(void *); +typedef void *(*swig_converter_func)(void *, int *); typedef struct swig_type_info *(*swig_dycast_func)(void **); -/* Structure to store inforomation on one type */ +/* Structure to store information on one type */ typedef struct swig_type_info { const char *name; /* mangled name of this type */ const char *str; /* human readable name of this type */ @@ -452,8 +453,8 @@ Cast a pointer up an inheritance hierarchy */ SWIGRUNTIMEINLINE void * -SWIG_TypeCast(swig_cast_info *ty, void *ptr) { - return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr); +SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) { + return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory); } /* @@ -877,7 +878,7 @@ Py_DECREF(old_str); Py_DECREF(value); } else { - PyErr_Format(PyExc_RuntimeError, mesg); + PyErr_SetString(PyExc_RuntimeError, mesg); } } @@ -1437,7 +1438,7 @@ { PySwigObject *sobj = (PySwigObject *) v; PyObject *next = sobj->next; - if (sobj->own) { + if (sobj->own == SWIG_POINTER_OWN) { swig_type_info *ty = sobj->ty; PySwigClientData *data = ty ? (PySwigClientData *) ty->clientdata : 0; PyObject *destroy = data ? data->destroy : 0; @@ -1455,12 +1456,13 @@ res = ((*meth)(mself, v)); } Py_XDECREF(res); - } else { + } +#if !defined(SWIG_PYTHON_SILENT_MEMLEAK) + else { const char *name = SWIG_TypePrettyName(ty); -#if !defined(SWIG_PYTHON_SILENT_MEMLEAK) - printf("swig/python detected a memory leak of type '%s', no destructor found.\n", name); + printf("swig/python detected a memory leak of type '%s', no destructor found.\n", (name ? name : "unknown")); + } #endif - } } Py_XDECREF(next); PyObject_DEL(v); @@ -1965,7 +1967,7 @@ SWIGRUNTIME int SWIG_Python_AcquirePtr(PyObject *obj, int own) { - if (own) { + if (own == SWIG_POINTER_OWN) { PySwigObject *sobj = SWIG_Python_GetSwigThis(obj); if (sobj) { int oldown = sobj->own; @@ -1986,6 +1988,8 @@ return SWIG_OK; } else { PySwigObject *sobj = SWIG_Python_GetSwigThis(obj); + if (own) + *own = 0; while (sobj) { void *vptr = sobj->ptr; if (ty) { @@ -1999,7 +2003,15 @@ if (!tc) { sobj = (PySwigObject *)sobj->next; } else { - if (ptr) *ptr = SWIG_TypeCast(tc,vptr); + if (ptr) { + int newmemory = 0; + *ptr = SWIG_TypeCast(tc,vptr,&newmemory); + if (newmemory == SWIG_CAST_NEW_MEMORY) { + assert(own); + if (own) + *own = *own | SWIG_CAST_NEW_MEMORY; + } + } break; } } @@ -2009,7 +2021,8 @@ } } if (sobj) { - if (own) *own = sobj->own; + if (own) + *own = *own | sobj->own; if (flags & SWIG_POINTER_DISOWN) { sobj->own = 0; } @@ -2074,8 +2087,13 @@ } if (ty) { swig_cast_info *tc = SWIG_TypeCheck(desc,ty); - if (!tc) return SWIG_ERROR; - *ptr = SWIG_TypeCast(tc,vptr); + if (tc) { + int newmemory = 0; + *ptr = SWIG_TypeCast(tc,vptr,&newmemory); + assert(!newmemory); /* newmemory handling not yet implemented */ + } else { + return SWIG_ERROR; + } } else { *ptr = vptr; } @@ -2478,20 +2496,20 @@ /* -------- TYPES TABLE (BEGIN) -------- */ #define SWIGTYPE_p_char swig_types[0] -#define SWIGTYPE_p_std__vectorTdouble_t swig_types[1] -#define SWIGTYPE_p_std__vectorTfloat_t swig_types[2] -#define SWIGTYPE_p_std__vectorTint_t swig_types[3] -#define SWIGTYPE_p_std__vectorTlong_double_t swig_types[4] -#define SWIGTYPE_p_std__vectorTlong_long_t swig_types[5] -#define SWIGTYPE_p_std__vectorTnpy_cdouble_wrapper_t swig_types[6] -#define SWIGTYPE_p_std__vectorTnpy_cfloat_wrapper_t swig_types[7] -#define SWIGTYPE_p_std__vectorTnpy_clongdouble_wrapper_t swig_types[8] -#define SWIGTYPE_p_std__vectorTshort_t swig_types[9] -#define SWIGTYPE_p_std__vectorTsigned_char_t swig_types[10] -#define SWIGTYPE_p_std__vectorTunsigned_char_t swig_types[11] -#define SWIGTYPE_p_std__vectorTunsigned_int_t swig_types[12] -#define SWIGTYPE_p_std__vectorTunsigned_long_long_t swig_types[13] -#define SWIGTYPE_p_std__vectorTunsigned_short_t swig_types[14] +#define SWIGTYPE_p_std__vectorT_double_t swig_types[1] +#define SWIGTYPE_p_std__vectorT_float_t swig_types[2] +#define SWIGTYPE_p_std__vectorT_int_t swig_types[3] +#define SWIGTYPE_p_std__vectorT_long_double_t swig_types[4] +#define SWIGTYPE_p_std__vectorT_long_long_t swig_types[5] +#define SWIGTYPE_p_std__vectorT_npy_cdouble_wrapper_t swig_types[6] +#define SWIGTYPE_p_std__vectorT_npy_cfloat_wrapper_t swig_types[7] +#define SWIGTYPE_p_std__vectorT_npy_clongdouble_wrapper_t swig_types[8] +#define SWIGTYPE_p_std__vectorT_short_t swig_types[9] +#define SWIGTYPE_p_std__vectorT_signed_char_t swig_types[10] +#define SWIGTYPE_p_std__vectorT_unsigned_char_t swig_types[11] +#define SWIGTYPE_p_std__vectorT_unsigned_int_t swig_types[12] +#define SWIGTYPE_p_std__vectorT_unsigned_long_long_t swig_types[13] +#define SWIGTYPE_p_std__vectorT_unsigned_short_t swig_types[14] static swig_type_info *swig_types[16]; static swig_module_info swig_module = {swig_types, 15, 0, 0, 0, 0}; #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name) @@ -3174,7 +3192,7 @@ if (!temp6 || !require_contiguous(temp6) || !require_native(temp6)) SWIG_fail; arg6 = (signed char*) array_data(temp6); } - csr_diagonal(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(signed char const (*))arg5,arg6); + csr_diagonal< int,signed char >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(signed char const (*))arg5,arg6); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -3272,7 +3290,7 @@ if (!temp6 || !require_contiguous(temp6) || !require_native(temp6)) SWIG_fail; arg6 = (unsigned char*) array_data(temp6); } - csr_diagonal(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned char const (*))arg5,arg6); + csr_diagonal< int,unsigned char >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned char const (*))arg5,arg6); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -3370,7 +3388,7 @@ if (!temp6 || !require_contiguous(temp6) || !require_native(temp6)) SWIG_fail; arg6 = (short*) array_data(temp6); } - csr_diagonal(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(short const (*))arg5,arg6); + csr_diagonal< int,short >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(short const (*))arg5,arg6); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -3468,7 +3486,7 @@ if (!temp6 || !require_contiguous(temp6) || !require_native(temp6)) SWIG_fail; arg6 = (unsigned short*) array_data(temp6); } - csr_diagonal(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned short const (*))arg5,arg6); + csr_diagonal< int,unsigned short >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned short const (*))arg5,arg6); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -3566,7 +3584,7 @@ if (!temp6 || !require_contiguous(temp6) || !require_native(temp6)) SWIG_fail; arg6 = (int*) array_data(temp6); } - csr_diagonal(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(int const (*))arg5,arg6); + csr_diagonal< int,int >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(int const (*))arg5,arg6); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -3664,7 +3682,7 @@ if (!temp6 || !require_contiguous(temp6) || !require_native(temp6)) SWIG_fail; arg6 = (unsigned int*) array_data(temp6); } - csr_diagonal(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned int const (*))arg5,arg6); + csr_diagonal< int,unsigned int >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned int const (*))arg5,arg6); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -3762,7 +3780,7 @@ if (!temp6 || !require_contiguous(temp6) || !require_native(temp6)) SWIG_fail; arg6 = (long long*) array_data(temp6); } - csr_diagonal(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long long const (*))arg5,arg6); + csr_diagonal< int,long long >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long long const (*))arg5,arg6); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -3860,7 +3878,7 @@ if (!temp6 || !require_contiguous(temp6) || !require_native(temp6)) SWIG_fail; arg6 = (unsigned long long*) array_data(temp6); } - csr_diagonal(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned long long const (*))arg5,arg6); + csr_diagonal< int,unsigned long long >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned long long const (*))arg5,arg6); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -3958,7 +3976,7 @@ if (!temp6 || !require_contiguous(temp6) || !require_native(temp6)) SWIG_fail; arg6 = (float*) array_data(temp6); } - csr_diagonal(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(float const (*))arg5,arg6); + csr_diagonal< int,float >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(float const (*))arg5,arg6); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -4056,7 +4074,7 @@ if (!temp6 || !require_contiguous(temp6) || !require_native(temp6)) SWIG_fail; arg6 = (double*) array_data(temp6); } - csr_diagonal(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(double const (*))arg5,arg6); + csr_diagonal< int,double >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(double const (*))arg5,arg6); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -4154,7 +4172,7 @@ if (!temp6 || !require_contiguous(temp6) || !require_native(temp6)) SWIG_fail; arg6 = (long double*) array_data(temp6); } - csr_diagonal(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long double const (*))arg5,arg6); + csr_diagonal< int,long double >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long double const (*))arg5,arg6); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -4252,7 +4270,7 @@ if (!temp6 || !require_contiguous(temp6) || !require_native(temp6)) SWIG_fail; arg6 = (npy_cfloat_wrapper*) array_data(temp6); } - csr_diagonal(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cfloat_wrapper const (*))arg5,arg6); + csr_diagonal< int,npy_cfloat_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cfloat_wrapper const (*))arg5,arg6); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -4350,7 +4368,7 @@ if (!temp6 || !require_contiguous(temp6) || !require_native(temp6)) SWIG_fail; arg6 = (npy_cdouble_wrapper*) array_data(temp6); } - csr_diagonal(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cdouble_wrapper const (*))arg5,arg6); + csr_diagonal< int,npy_cdouble_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cdouble_wrapper const (*))arg5,arg6); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -4448,7 +4466,7 @@ if (!temp6 || !require_contiguous(temp6) || !require_native(temp6)) SWIG_fail; arg6 = (npy_clongdouble_wrapper*) array_data(temp6); } - csr_diagonal(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_clongdouble_wrapper const (*))arg5,arg6); + csr_diagonal< int,npy_clongdouble_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_clongdouble_wrapper const (*))arg5,arg6); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -4990,7 +5008,22 @@ } fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'csr_diagonal'.\n Possible C/C++ prototypes are:\n"" csr_diagonal<(int,signed char)>(int const,int const,int const [],int const [],signed char const [],signed char [])\n"" csr_diagonal<(int,unsigned char)>(int const,int const,int const [],int const [],unsigned char const [],unsigned char [])\n"" csr_diagonal<(int,short)>(int const,int const,int const [],int const [],short const [],short [])\n"" csr_diagonal<(int,unsigned short)>(int const,int const,int const [],int const [],unsigned short const [],unsigned short [])\n"" csr_diagonal<(int,int)>(int const,int const,int const [],int const [],int const [],int [])\n"" csr_diagonal<(int,unsigned int)>(int const,int const,int const [],int const [],unsigned int const [],unsigned int [])\n"" csr_diagonal<(int,long long)>(int const,int const,int const [],int const [],long long const [],long long [])\n"" csr_diagonal<(int,unsigned long long)>(int const,int const,int const [],int const [],unsigned long long const [],unsigned long long [])\n"" csr_diagonal<(int,float)>(int const,int const,int const [],int const [],float const [],float [])\n"" csr_diagonal<(int,double)>(int const,int const,int const [],int const [],double const [],double [])\n"" csr_diagonal<(int,long double)>(int const,int const,int const [],int const [],long double const [],long double [])\n"" csr_diagonal<(int,npy_cfloat_wrapper)>(int const,int const,int const [],int const [],npy_cfloat_wrapper const [],npy_cfloat_wrapper [])\n"" csr_diagonal<(int,npy_cdouble_wrapper)>(int const,int const,int const [],int const [],npy_cdouble_wrapper const [],npy_cdouble_wrapper [])\n"" csr_diagonal<(int,npy_clongdouble_wrapper)>(int const,int const,int const [],int const [],npy_clongdouble_wrapper const [],npy_clongdouble_wrapper [])\n"); + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'csr_diagonal'.\n" + " Possible C/C++ prototypes are:\n" + " csr_diagonal< int,signed char >(int const,int const,int const [],int const [],signed char const [],signed char [])\n" + " csr_diagonal< int,unsigned char >(int const,int const,int const [],int const [],unsigned char const [],unsigned char [])\n" + " csr_diagonal< int,short >(int const,int const,int const [],int const [],short const [],short [])\n" + " csr_diagonal< int,unsigned short >(int const,int const,int const [],int const [],unsigned short const [],unsigned short [])\n" + " csr_diagonal< int,int >(int const,int const,int const [],int const [],int const [],int [])\n" + " csr_diagonal< int,unsigned int >(int const,int const,int const [],int const [],unsigned int const [],unsigned int [])\n" + " csr_diagonal< int,long long >(int const,int const,int const [],int const [],long long const [],long long [])\n" + " csr_diagonal< int,unsigned long long >(int const,int const,int const [],int const [],unsigned long long const [],unsigned long long [])\n" + " csr_diagonal< int,float >(int const,int const,int const [],int const [],float const [],float [])\n" + " csr_diagonal< int,double >(int const,int const,int const [],int const [],double const [],double [])\n" + " csr_diagonal< int,long double >(int const,int const,int const [],int const [],long double const [],long double [])\n" + " csr_diagonal< int,npy_cfloat_wrapper >(int const,int const,int const [],int const [],npy_cfloat_wrapper const [],npy_cfloat_wrapper [])\n" + " csr_diagonal< int,npy_cdouble_wrapper >(int const,int const,int const [],int const [],npy_cdouble_wrapper const [],npy_cdouble_wrapper [])\n" + " csr_diagonal< int,npy_clongdouble_wrapper >(int const,int const,int const [],int const [],npy_clongdouble_wrapper const [],npy_clongdouble_wrapper [])\n"); return NULL; } @@ -5067,7 +5100,7 @@ if (!temp6 || !require_contiguous(temp6) || !require_native(temp6)) SWIG_fail; arg6 = (signed char*) array_data(temp6); } - csc_diagonal(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(signed char const (*))arg5,arg6); + csc_diagonal< int,signed char >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(signed char const (*))arg5,arg6); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -5165,7 +5198,7 @@ if (!temp6 || !require_contiguous(temp6) || !require_native(temp6)) SWIG_fail; arg6 = (unsigned char*) array_data(temp6); } - csc_diagonal(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned char const (*))arg5,arg6); + csc_diagonal< int,unsigned char >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned char const (*))arg5,arg6); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -5263,7 +5296,7 @@ if (!temp6 || !require_contiguous(temp6) || !require_native(temp6)) SWIG_fail; arg6 = (short*) array_data(temp6); } - csc_diagonal(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(short const (*))arg5,arg6); + csc_diagonal< int,short >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(short const (*))arg5,arg6); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -5361,7 +5394,7 @@ if (!temp6 || !require_contiguous(temp6) || !require_native(temp6)) SWIG_fail; arg6 = (unsigned short*) array_data(temp6); } - csc_diagonal(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned short const (*))arg5,arg6); + csc_diagonal< int,unsigned short >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned short const (*))arg5,arg6); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -5459,7 +5492,7 @@ if (!temp6 || !require_contiguous(temp6) || !require_native(temp6)) SWIG_fail; arg6 = (int*) array_data(temp6); } - csc_diagonal(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(int const (*))arg5,arg6); + csc_diagonal< int,int >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(int const (*))arg5,arg6); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -5557,7 +5590,7 @@ if (!temp6 || !require_contiguous(temp6) || !require_native(temp6)) SWIG_fail; arg6 = (unsigned int*) array_data(temp6); } - csc_diagonal(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned int const (*))arg5,arg6); + csc_diagonal< int,unsigned int >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned int const (*))arg5,arg6); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -5655,7 +5688,7 @@ if (!temp6 || !require_contiguous(temp6) || !require_native(temp6)) SWIG_fail; arg6 = (long long*) array_data(temp6); } - csc_diagonal(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long long const (*))arg5,arg6); + csc_diagonal< int,long long >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long long const (*))arg5,arg6); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -5753,7 +5786,7 @@ if (!temp6 || !require_contiguous(temp6) || !require_native(temp6)) SWIG_fail; arg6 = (unsigned long long*) array_data(temp6); } - csc_diagonal(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned long long const (*))arg5,arg6); + csc_diagonal< int,unsigned long long >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned long long const (*))arg5,arg6); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -5851,7 +5884,7 @@ if (!temp6 || !require_contiguous(temp6) || !require_native(temp6)) SWIG_fail; arg6 = (float*) array_data(temp6); } - csc_diagonal(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(float const (*))arg5,arg6); + csc_diagonal< int,float >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(float const (*))arg5,arg6); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -5949,7 +5982,7 @@ if (!temp6 || !require_contiguous(temp6) || !require_native(temp6)) SWIG_fail; arg6 = (double*) array_data(temp6); } - csc_diagonal(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(double const (*))arg5,arg6); + csc_diagonal< int,double >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(double const (*))arg5,arg6); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -6047,7 +6080,7 @@ if (!temp6 || !require_contiguous(temp6) || !require_native(temp6)) SWIG_fail; arg6 = (long double*) array_data(temp6); } - csc_diagonal(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long double const (*))arg5,arg6); + csc_diagonal< int,long double >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long double const (*))arg5,arg6); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -6145,7 +6178,7 @@ if (!temp6 || !require_contiguous(temp6) || !require_native(temp6)) SWIG_fail; arg6 = (npy_cfloat_wrapper*) array_data(temp6); } - csc_diagonal(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cfloat_wrapper const (*))arg5,arg6); + csc_diagonal< int,npy_cfloat_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cfloat_wrapper const (*))arg5,arg6); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -6243,7 +6276,7 @@ if (!temp6 || !require_contiguous(temp6) || !require_native(temp6)) SWIG_fail; arg6 = (npy_cdouble_wrapper*) array_data(temp6); } - csc_diagonal(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cdouble_wrapper const (*))arg5,arg6); + csc_diagonal< int,npy_cdouble_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cdouble_wrapper const (*))arg5,arg6); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -6341,7 +6374,7 @@ if (!temp6 || !require_contiguous(temp6) || !require_native(temp6)) SWIG_fail; arg6 = (npy_clongdouble_wrapper*) array_data(temp6); } - csc_diagonal(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_clongdouble_wrapper const (*))arg5,arg6); + csc_diagonal< int,npy_clongdouble_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_clongdouble_wrapper const (*))arg5,arg6); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -6883,7 +6916,22 @@ } fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'csc_diagonal'.\n Possible C/C++ prototypes are:\n"" csc_diagonal<(int,signed char)>(int const,int const,int const [],int const [],signed char const [],signed char [])\n"" csc_diagonal<(int,unsigned char)>(int const,int const,int const [],int const [],unsigned char const [],unsigned char [])\n"" csc_diagonal<(int,short)>(int const,int const,int const [],int const [],short const [],short [])\n"" csc_diagonal<(int,unsigned short)>(int const,int const,int const [],int const [],unsigned short const [],unsigned short [])\n"" csc_diagonal<(int,int)>(int const,int const,int const [],int const [],int const [],int [])\n"" csc_diagonal<(int,unsigned int)>(int const,int const,int const [],int const [],unsigned int const [],unsigned int [])\n"" csc_diagonal<(int,long long)>(int const,int const,int const [],int const [],long long const [],long long [])\n"" csc_diagonal<(int,unsigned long long)>(int const,int const,int const [],int const [],unsigned long long const [],unsigned long long [])\n"" csc_diagonal<(int,float)>(int const,int const,int const [],int const [],float const [],float [])\n"" csc_diagonal<(int,double)>(int const,int const,int const [],int const [],double const [],double [])\n"" csc_diagonal<(int,long double)>(int const,int const,int const [],int const [],long double const [],long double [])\n"" csc_diagonal<(int,npy_cfloat_wrapper)>(int const,int const,int const [],int const [],npy_cfloat_wrapper const [],npy_cfloat_wrapper [])\n"" csc_diagonal<(int,npy_cdouble_wrapper)>(int const,int const,int const [],int const [],npy_cdouble_wrapper const [],npy_cdouble_wrapper [])\n"" csc_diagonal<(int,npy_clongdouble_wrapper)>(int const,int const,int const [],int const [],npy_clongdouble_wrapper const [],npy_clongdouble_wrapper [])\n"); + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'csc_diagonal'.\n" + " Possible C/C++ prototypes are:\n" + " csc_diagonal< int,signed char >(int const,int const,int const [],int const [],signed char const [],signed char [])\n" + " csc_diagonal< int,unsigned char >(int const,int const,int const [],int const [],unsigned char const [],unsigned char [])\n" + " csc_diagonal< int,short >(int const,int const,int const [],int const [],short const [],short [])\n" + " csc_diagonal< int,unsigned short >(int const,int const,int const [],int const [],unsigned short const [],unsigned short [])\n" + " csc_diagonal< int,int >(int const,int const,int const [],int const [],int const [],int [])\n" + " csc_diagonal< int,unsigned int >(int const,int const,int const [],int const [],unsigned int const [],unsigned int [])\n" + " csc_diagonal< int,long long >(int const,int const,int const [],int const [],long long const [],long long [])\n" + " csc_diagonal< int,unsigned long long >(int const,int const,int const [],int const [],unsigned long long const [],unsigned long long [])\n" + " csc_diagonal< int,float >(int const,int const,int const [],int const [],float const [],float [])\n" + " csc_diagonal< int,double >(int const,int const,int const [],int const [],double const [],double [])\n" + " csc_diagonal< int,long double >(int const,int const,int const [],int const [],long double const [],long double [])\n" + " csc_diagonal< int,npy_cfloat_wrapper >(int const,int const,int const [],int const [],npy_cfloat_wrapper const [],npy_cfloat_wrapper [])\n" + " csc_diagonal< int,npy_cdouble_wrapper >(int const,int const,int const [],int const [],npy_cdouble_wrapper const [],npy_cdouble_wrapper [])\n" + " csc_diagonal< int,npy_clongdouble_wrapper >(int const,int const,int const [],int const [],npy_clongdouble_wrapper const [],npy_clongdouble_wrapper [])\n"); return NULL; } @@ -6978,7 +7026,7 @@ if (!temp8 || !require_contiguous(temp8) || !require_native(temp8)) SWIG_fail; arg8 = (signed char*) array_data(temp8); } - bsr_diagonal(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(signed char const (*))arg7,arg8); + bsr_diagonal< int,signed char >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(signed char const (*))arg7,arg8); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -7094,7 +7142,7 @@ if (!temp8 || !require_contiguous(temp8) || !require_native(temp8)) SWIG_fail; arg8 = (unsigned char*) array_data(temp8); } - bsr_diagonal(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(unsigned char const (*))arg7,arg8); + bsr_diagonal< int,unsigned char >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(unsigned char const (*))arg7,arg8); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -7210,7 +7258,7 @@ if (!temp8 || !require_contiguous(temp8) || !require_native(temp8)) SWIG_fail; arg8 = (short*) array_data(temp8); } - bsr_diagonal(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(short const (*))arg7,arg8); + bsr_diagonal< int,short >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(short const (*))arg7,arg8); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -7326,7 +7374,7 @@ if (!temp8 || !require_contiguous(temp8) || !require_native(temp8)) SWIG_fail; arg8 = (unsigned short*) array_data(temp8); } - bsr_diagonal(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(unsigned short const (*))arg7,arg8); + bsr_diagonal< int,unsigned short >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(unsigned short const (*))arg7,arg8); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -7442,7 +7490,7 @@ if (!temp8 || !require_contiguous(temp8) || !require_native(temp8)) SWIG_fail; arg8 = (int*) array_data(temp8); } - bsr_diagonal(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(int const (*))arg7,arg8); + bsr_diagonal< int,int >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(int const (*))arg7,arg8); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -7558,7 +7606,7 @@ if (!temp8 || !require_contiguous(temp8) || !require_native(temp8)) SWIG_fail; arg8 = (unsigned int*) array_data(temp8); } - bsr_diagonal(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(unsigned int const (*))arg7,arg8); + bsr_diagonal< int,unsigned int >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(unsigned int const (*))arg7,arg8); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -7674,7 +7722,7 @@ if (!temp8 || !require_contiguous(temp8) || !require_native(temp8)) SWIG_fail; arg8 = (long long*) array_data(temp8); } - bsr_diagonal(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(long long const (*))arg7,arg8); + bsr_diagonal< int,long long >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(long long const (*))arg7,arg8); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -7790,7 +7838,7 @@ if (!temp8 || !require_contiguous(temp8) || !require_native(temp8)) SWIG_fail; arg8 = (unsigned long long*) array_data(temp8); } - bsr_diagonal(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(unsigned long long const (*))arg7,arg8); + bsr_diagonal< int,unsigned long long >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(unsigned long long const (*))arg7,arg8); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -7906,7 +7954,7 @@ if (!temp8 || !require_contiguous(temp8) || !require_native(temp8)) SWIG_fail; arg8 = (float*) array_data(temp8); } - bsr_diagonal(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(float const (*))arg7,arg8); + bsr_diagonal< int,float >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(float const (*))arg7,arg8); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -8022,7 +8070,7 @@ if (!temp8 || !require_contiguous(temp8) || !require_native(temp8)) SWIG_fail; arg8 = (double*) array_data(temp8); } - bsr_diagonal(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(double const (*))arg7,arg8); + bsr_diagonal< int,double >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(double const (*))arg7,arg8); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -8138,7 +8186,7 @@ if (!temp8 || !require_contiguous(temp8) || !require_native(temp8)) SWIG_fail; arg8 = (long double*) array_data(temp8); } - bsr_diagonal(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(long double const (*))arg7,arg8); + bsr_diagonal< int,long double >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(long double const (*))arg7,arg8); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -8254,7 +8302,7 @@ if (!temp8 || !require_contiguous(temp8) || !require_native(temp8)) SWIG_fail; arg8 = (npy_cfloat_wrapper*) array_data(temp8); } - bsr_diagonal(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(npy_cfloat_wrapper const (*))arg7,arg8); + bsr_diagonal< int,npy_cfloat_wrapper >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(npy_cfloat_wrapper const (*))arg7,arg8); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -8370,7 +8418,7 @@ if (!temp8 || !require_contiguous(temp8) || !require_native(temp8)) SWIG_fail; arg8 = (npy_cdouble_wrapper*) array_data(temp8); } - bsr_diagonal(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(npy_cdouble_wrapper const (*))arg7,arg8); + bsr_diagonal< int,npy_cdouble_wrapper >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(npy_cdouble_wrapper const (*))arg7,arg8); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -8486,7 +8534,7 @@ if (!temp8 || !require_contiguous(temp8) || !require_native(temp8)) SWIG_fail; arg8 = (npy_clongdouble_wrapper*) array_data(temp8); } - bsr_diagonal(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(npy_clongdouble_wrapper const (*))arg7,arg8); + bsr_diagonal< int,npy_clongdouble_wrapper >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(npy_clongdouble_wrapper const (*))arg7,arg8); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -9196,7 +9244,22 @@ } fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'bsr_diagonal'.\n Possible C/C++ prototypes are:\n"" bsr_diagonal<(int,signed char)>(int const,int const,int const,int const,int const [],int const [],signed char const [],signed char [])\n"" bsr_diagonal<(int,unsigned char)>(int const,int const,int const,int const,int const [],int const [],unsigned char const [],unsigned char [])\n"" bsr_diagonal<(int,short)>(int const,int const,int const,int const,int const [],int const [],short const [],short [])\n"" bsr_diagonal<(int,unsigned short)>(int const,int const,int const,int const,int const [],int const [],unsigned short const [],unsigned short [])\n"" bsr_diagonal<(int,int)>(int const,int const,int const,int const,int const [],int const [],int const [],int [])\n"" bsr_diagonal<(int,unsigned int)>(int const,int const,int const,int const,int const [],int const [],unsigned int const [],unsigned int [])\n"" bsr_diagonal<(int,long long)>(int const,int const,int const,int const,int const [],int const [],long long const [],long long [])\n"" bsr_diagonal<(int,unsigned long long)>(int const,int const,int const,int const,int const [],int const [],unsigned long long const [],unsigned long long [])\n"" bsr_diagonal<(int,float)>(int const,int const,int const,int const,int const [],int const [],float const [],float [])\n"" bsr_diagonal<(int,double)>(int const,int const,int const,int const,int const [],int const [],double const [],double [])\n"" bsr_diagonal<(int,long double)>(int const,int const,int const,int const,int const [],int const [],long double const [],long double [])\n"" bsr_diagonal<(int,npy_cfloat_wrapper)>(int const,int const,int const,int const,int const [],int const [],npy_cfloat_wrapper const [],npy_cfloat_wrapper [])\n"" bsr_diagonal<(int,npy_cdouble_wrapper)>(int const,int const,int const,int const,int const [],int const [],npy_cdouble_wrapper const [],npy_cdouble_wrapper [])\n"" bsr_diagonal<(int,npy_clongdouble_wrapper)>(int const,int const,int const,int const,int const [],int const [],npy_clongdouble_wrapper const [],npy_clongdouble_wrapper [])\n"); + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'bsr_diagonal'.\n" + " Possible C/C++ prototypes are:\n" + " bsr_diagonal< int,signed char >(int const,int const,int const,int const,int const [],int const [],signed char const [],signed char [])\n" + " bsr_diagonal< int,unsigned char >(int const,int const,int const,int const,int const [],int const [],unsigned char const [],unsigned char [])\n" + " bsr_diagonal< int,short >(int const,int const,int const,int const,int const [],int const [],short const [],short [])\n" + " bsr_diagonal< int,unsigned short >(int const,int const,int const,int const,int const [],int const [],unsigned short const [],unsigned short [])\n" + " bsr_diagonal< int,int >(int const,int const,int const,int const,int const [],int const [],int const [],int [])\n" + " bsr_diagonal< int,unsigned int >(int const,int const,int const,int const,int const [],int const [],unsigned int const [],unsigned int [])\n" + " bsr_diagonal< int,long long >(int const,int const,int const,int const,int const [],int const [],long long const [],long long [])\n" + " bsr_diagonal< int,unsigned long long >(int const,int const,int const,int const,int const [],int const [],unsigned long long const [],unsigned long long [])\n" + " bsr_diagonal< int,float >(int const,int const,int const,int const,int const [],int const [],float const [],float [])\n" + " bsr_diagonal< int,double >(int const,int const,int const,int const,int const [],int const [],double const [],double [])\n" + " bsr_diagonal< int,long double >(int const,int const,int const,int const,int const [],int const [],long double const [],long double [])\n" + " bsr_diagonal< int,npy_cfloat_wrapper >(int const,int const,int const,int const,int const [],int const [],npy_cfloat_wrapper const [],npy_cfloat_wrapper [])\n" + " bsr_diagonal< int,npy_cdouble_wrapper >(int const,int const,int const,int const,int const [],int const [],npy_cdouble_wrapper const [],npy_cdouble_wrapper [])\n" + " bsr_diagonal< int,npy_clongdouble_wrapper >(int const,int const,int const,int const,int const [],int const [],npy_clongdouble_wrapper const [],npy_clongdouble_wrapper [])\n"); return NULL; } @@ -9273,7 +9336,7 @@ arg6 = (signed char*) array6->data; } - csr_scale_rows(arg1,arg2,(int const (*))arg3,(int const (*))arg4,arg5,(signed char const (*))arg6); + csr_scale_rows< int,signed char >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,arg5,(signed char const (*))arg6); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -9371,7 +9434,7 @@ arg6 = (unsigned char*) array6->data; } - csr_scale_rows(arg1,arg2,(int const (*))arg3,(int const (*))arg4,arg5,(unsigned char const (*))arg6); + csr_scale_rows< int,unsigned char >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,arg5,(unsigned char const (*))arg6); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -9469,7 +9532,7 @@ arg6 = (short*) array6->data; } - csr_scale_rows(arg1,arg2,(int const (*))arg3,(int const (*))arg4,arg5,(short const (*))arg6); + csr_scale_rows< int,short >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,arg5,(short const (*))arg6); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -9567,7 +9630,7 @@ arg6 = (unsigned short*) array6->data; } - csr_scale_rows(arg1,arg2,(int const (*))arg3,(int const (*))arg4,arg5,(unsigned short const (*))arg6); + csr_scale_rows< int,unsigned short >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,arg5,(unsigned short const (*))arg6); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -9665,7 +9728,7 @@ arg6 = (int*) array6->data; } - csr_scale_rows(arg1,arg2,(int const (*))arg3,(int const (*))arg4,arg5,(int const (*))arg6); + csr_scale_rows< int,int >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,arg5,(int const (*))arg6); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -9763,7 +9826,7 @@ arg6 = (unsigned int*) array6->data; } - csr_scale_rows(arg1,arg2,(int const (*))arg3,(int const (*))arg4,arg5,(unsigned int const (*))arg6); + csr_scale_rows< int,unsigned int >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,arg5,(unsigned int const (*))arg6); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -9861,7 +9924,7 @@ arg6 = (long long*) array6->data; } - csr_scale_rows(arg1,arg2,(int const (*))arg3,(int const (*))arg4,arg5,(long long const (*))arg6); + csr_scale_rows< int,long long >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,arg5,(long long const (*))arg6); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -9959,7 +10022,7 @@ arg6 = (unsigned long long*) array6->data; } - csr_scale_rows(arg1,arg2,(int const (*))arg3,(int const (*))arg4,arg5,(unsigned long long const (*))arg6); + csr_scale_rows< int,unsigned long long >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,arg5,(unsigned long long const (*))arg6); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -10057,7 +10120,7 @@ arg6 = (float*) array6->data; } - csr_scale_rows(arg1,arg2,(int const (*))arg3,(int const (*))arg4,arg5,(float const (*))arg6); + csr_scale_rows< int,float >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,arg5,(float const (*))arg6); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -10155,7 +10218,7 @@ arg6 = (double*) array6->data; } - csr_scale_rows(arg1,arg2,(int const (*))arg3,(int const (*))arg4,arg5,(double const (*))arg6); + csr_scale_rows< int,double >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,arg5,(double const (*))arg6); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -10253,7 +10316,7 @@ arg6 = (long double*) array6->data; } - csr_scale_rows(arg1,arg2,(int const (*))arg3,(int const (*))arg4,arg5,(long double const (*))arg6); + csr_scale_rows< int,long double >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,arg5,(long double const (*))arg6); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -10351,7 +10414,7 @@ arg6 = (npy_cfloat_wrapper*) array6->data; } - csr_scale_rows(arg1,arg2,(int const (*))arg3,(int const (*))arg4,arg5,(npy_cfloat_wrapper const (*))arg6); + csr_scale_rows< int,npy_cfloat_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,arg5,(npy_cfloat_wrapper const (*))arg6); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -10449,7 +10512,7 @@ arg6 = (npy_cdouble_wrapper*) array6->data; } - csr_scale_rows(arg1,arg2,(int const (*))arg3,(int const (*))arg4,arg5,(npy_cdouble_wrapper const (*))arg6); + csr_scale_rows< int,npy_cdouble_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,arg5,(npy_cdouble_wrapper const (*))arg6); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -10547,7 +10610,7 @@ arg6 = (npy_clongdouble_wrapper*) array6->data; } - csr_scale_rows(arg1,arg2,(int const (*))arg3,(int const (*))arg4,arg5,(npy_clongdouble_wrapper const (*))arg6); + csr_scale_rows< int,npy_clongdouble_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,arg5,(npy_clongdouble_wrapper const (*))arg6); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -11089,7 +11152,22 @@ } fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'csr_scale_rows'.\n Possible C/C++ prototypes are:\n"" csr_scale_rows<(int,signed char)>(int const,int const,int const [],int const [],signed char [],signed char const [])\n"" csr_scale_rows<(int,unsigned char)>(int const,int const,int const [],int const [],unsigned char [],unsigned char const [])\n"" csr_scale_rows<(int,short)>(int const,int const,int const [],int const [],short [],short const [])\n"" csr_scale_rows<(int,unsigned short)>(int const,int const,int const [],int const [],unsigned short [],unsigned short const [])\n"" csr_scale_rows<(int,int)>(int const,int const,int const [],int const [],int [],int const [])\n"" csr_scale_rows<(int,unsigned int)>(int const,int const,int const [],int const [],unsigned int [],unsigned int const [])\n"" csr_scale_rows<(int,long long)>(int const,int const,int const [],int const [],long long [],long long const [])\n"" csr_scale_rows<(int,unsigned long long)>(int const,int const,int const [],int const [],unsigned long long [],unsigned long long const [])\n"" csr_scale_rows<(int,float)>(int const,int const,int const [],int const [],float [],float const [])\n"" csr_scale_rows<(int,double)>(int const,int const,int const [],int const [],double [],double const [])\n"" csr_scale_rows<(int,long double)>(int const,int const,int const [],int const [],long double [],long double const [])\n"" csr_scale_rows<(int,npy_cfloat_wrapper)>(int const,int const,int const [],int const [],npy_cfloat_wrapper [],npy_cfloat_wrapper const [])\n"" csr_scale_rows<(int,npy_cdouble_wrapper)>(int const,int const,int const [],int const [],npy_cdouble_wrapper [],npy_cdouble_wrapper const [])\n"" csr_scale_rows<(int,npy_clongdouble_wrapper)>(int const,int const,int const [],int const [],npy_clongdouble_wrapper [],npy_clongdouble_wrapper const [])\n"); + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'csr_scale_rows'.\n" + " Possible C/C++ prototypes are:\n" + " csr_scale_rows< int,signed char >(int const,int const,int const [],int const [],signed char [],signed char const [])\n" + " csr_scale_rows< int,unsigned char >(int const,int const,int const [],int const [],unsigned char [],unsigned char const [])\n" + " csr_scale_rows< int,short >(int const,int const,int const [],int const [],short [],short const [])\n" + " csr_scale_rows< int,unsigned short >(int const,int const,int const [],int const [],unsigned short [],unsigned short const [])\n" + " csr_scale_rows< int,int >(int const,int const,int const [],int const [],int [],int const [])\n" + " csr_scale_rows< int,unsigned int >(int const,int const,int const [],int const [],unsigned int [],unsigned int const [])\n" + " csr_scale_rows< int,long long >(int const,int const,int const [],int const [],long long [],long long const [])\n" + " csr_scale_rows< int,unsigned long long >(int const,int const,int const [],int const [],unsigned long long [],unsigned long long const [])\n" + " csr_scale_rows< int,float >(int const,int const,int const [],int const [],float [],float const [])\n" + " csr_scale_rows< int,double >(int const,int const,int const [],int const [],double [],double const [])\n" + " csr_scale_rows< int,long double >(int const,int const,int const [],int const [],long double [],long double const [])\n" + " csr_scale_rows< int,npy_cfloat_wrapper >(int const,int const,int const [],int const [],npy_cfloat_wrapper [],npy_cfloat_wrapper const [])\n" + " csr_scale_rows< int,npy_cdouble_wrapper >(int const,int const,int const [],int const [],npy_cdouble_wrapper [],npy_cdouble_wrapper const [])\n" + " csr_scale_rows< int,npy_clongdouble_wrapper >(int const,int const,int const [],int const [],npy_clongdouble_wrapper [],npy_clongdouble_wrapper const [])\n"); return NULL; } @@ -11166,7 +11244,7 @@ arg6 = (signed char*) array6->data; } - csr_scale_columns(arg1,arg2,(int const (*))arg3,(int const (*))arg4,arg5,(signed char const (*))arg6); + csr_scale_columns< int,signed char >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,arg5,(signed char const (*))arg6); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -11264,7 +11342,7 @@ arg6 = (unsigned char*) array6->data; } - csr_scale_columns(arg1,arg2,(int const (*))arg3,(int const (*))arg4,arg5,(unsigned char const (*))arg6); + csr_scale_columns< int,unsigned char >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,arg5,(unsigned char const (*))arg6); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -11362,7 +11440,7 @@ arg6 = (short*) array6->data; } - csr_scale_columns(arg1,arg2,(int const (*))arg3,(int const (*))arg4,arg5,(short const (*))arg6); + csr_scale_columns< int,short >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,arg5,(short const (*))arg6); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -11460,7 +11538,7 @@ arg6 = (unsigned short*) array6->data; } - csr_scale_columns(arg1,arg2,(int const (*))arg3,(int const (*))arg4,arg5,(unsigned short const (*))arg6); + csr_scale_columns< int,unsigned short >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,arg5,(unsigned short const (*))arg6); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -11558,7 +11636,7 @@ arg6 = (int*) array6->data; } - csr_scale_columns(arg1,arg2,(int const (*))arg3,(int const (*))arg4,arg5,(int const (*))arg6); + csr_scale_columns< int,int >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,arg5,(int const (*))arg6); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -11656,7 +11734,7 @@ arg6 = (unsigned int*) array6->data; } - csr_scale_columns(arg1,arg2,(int const (*))arg3,(int const (*))arg4,arg5,(unsigned int const (*))arg6); + csr_scale_columns< int,unsigned int >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,arg5,(unsigned int const (*))arg6); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -11754,7 +11832,7 @@ arg6 = (long long*) array6->data; } - csr_scale_columns(arg1,arg2,(int const (*))arg3,(int const (*))arg4,arg5,(long long const (*))arg6); + csr_scale_columns< int,long long >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,arg5,(long long const (*))arg6); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -11852,7 +11930,7 @@ arg6 = (unsigned long long*) array6->data; } - csr_scale_columns(arg1,arg2,(int const (*))arg3,(int const (*))arg4,arg5,(unsigned long long const (*))arg6); + csr_scale_columns< int,unsigned long long >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,arg5,(unsigned long long const (*))arg6); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -11950,7 +12028,7 @@ arg6 = (float*) array6->data; } - csr_scale_columns(arg1,arg2,(int const (*))arg3,(int const (*))arg4,arg5,(float const (*))arg6); + csr_scale_columns< int,float >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,arg5,(float const (*))arg6); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -12048,7 +12126,7 @@ arg6 = (double*) array6->data; } - csr_scale_columns(arg1,arg2,(int const (*))arg3,(int const (*))arg4,arg5,(double const (*))arg6); + csr_scale_columns< int,double >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,arg5,(double const (*))arg6); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -12146,7 +12224,7 @@ arg6 = (long double*) array6->data; } - csr_scale_columns(arg1,arg2,(int const (*))arg3,(int const (*))arg4,arg5,(long double const (*))arg6); + csr_scale_columns< int,long double >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,arg5,(long double const (*))arg6); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -12244,7 +12322,7 @@ arg6 = (npy_cfloat_wrapper*) array6->data; } - csr_scale_columns(arg1,arg2,(int const (*))arg3,(int const (*))arg4,arg5,(npy_cfloat_wrapper const (*))arg6); + csr_scale_columns< int,npy_cfloat_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,arg5,(npy_cfloat_wrapper const (*))arg6); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -12342,7 +12420,7 @@ arg6 = (npy_cdouble_wrapper*) array6->data; } - csr_scale_columns(arg1,arg2,(int const (*))arg3,(int const (*))arg4,arg5,(npy_cdouble_wrapper const (*))arg6); + csr_scale_columns< int,npy_cdouble_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,arg5,(npy_cdouble_wrapper const (*))arg6); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -12440,7 +12518,7 @@ arg6 = (npy_clongdouble_wrapper*) array6->data; } - csr_scale_columns(arg1,arg2,(int const (*))arg3,(int const (*))arg4,arg5,(npy_clongdouble_wrapper const (*))arg6); + csr_scale_columns< int,npy_clongdouble_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,arg5,(npy_clongdouble_wrapper const (*))arg6); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -12982,7 +13060,22 @@ } fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'csr_scale_columns'.\n Possible C/C++ prototypes are:\n"" csr_scale_columns<(int,signed char)>(int const,int const,int const [],int const [],signed char [],signed char const [])\n"" csr_scale_columns<(int,unsigned char)>(int const,int const,int const [],int const [],unsigned char [],unsigned char const [])\n"" csr_scale_columns<(int,short)>(int const,int const,int const [],int const [],short [],short const [])\n"" csr_scale_columns<(int,unsigned short)>(int const,int const,int const [],int const [],unsigned short [],unsigned short const [])\n"" csr_scale_columns<(int,int)>(int const,int const,int const [],int const [],int [],int const [])\n"" csr_scale_columns<(int,unsigned int)>(int const,int const,int const [],int const [],unsigned int [],unsigned int const [])\n"" csr_scale_columns<(int,long long)>(int const,int const,int const [],int const [],long long [],long long const [])\n"" csr_scale_columns<(int,unsigned long long)>(int const,int const,int const [],int const [],unsigned long long [],unsigned long long const [])\n"" csr_scale_columns<(int,float)>(int const,int const,int const [],int const [],float [],float const [])\n"" csr_scale_columns<(int,double)>(int const,int const,int const [],int const [],double [],double const [])\n"" csr_scale_columns<(int,long double)>(int const,int const,int const [],int const [],long double [],long double const [])\n"" csr_scale_columns<(int,npy_cfloat_wrapper)>(int const,int const,int const [],int const [],npy_cfloat_wrapper [],npy_cfloat_wrapper const [])\n"" csr_scale_columns<(int,npy_cdouble_wrapper)>(int const,int const,int const [],int const [],npy_cdouble_wrapper [],npy_cdouble_wrapper const [])\n"" csr_scale_columns<(int,npy_clongdouble_wrapper)>(int const,int const,int const [],int const [],npy_clongdouble_wrapper [],npy_clongdouble_wrapper const [])\n"); + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'csr_scale_columns'.\n" + " Possible C/C++ prototypes are:\n" + " csr_scale_columns< int,signed char >(int const,int const,int const [],int const [],signed char [],signed char const [])\n" + " csr_scale_columns< int,unsigned char >(int const,int const,int const [],int const [],unsigned char [],unsigned char const [])\n" + " csr_scale_columns< int,short >(int const,int const,int const [],int const [],short [],short const [])\n" + " csr_scale_columns< int,unsigned short >(int const,int const,int const [],int const [],unsigned short [],unsigned short const [])\n" + " csr_scale_columns< int,int >(int const,int const,int const [],int const [],int [],int const [])\n" + " csr_scale_columns< int,unsigned int >(int const,int const,int const [],int const [],unsigned int [],unsigned int const [])\n" + " csr_scale_columns< int,long long >(int const,int const,int const [],int const [],long long [],long long const [])\n" + " csr_scale_columns< int,unsigned long long >(int const,int const,int const [],int const [],unsigned long long [],unsigned long long const [])\n" + " csr_scale_columns< int,float >(int const,int const,int const [],int const [],float [],float const [])\n" + " csr_scale_columns< int,double >(int const,int const,int const [],int const [],double [],double const [])\n" + " csr_scale_columns< int,long double >(int const,int const,int const [],int const [],long double [],long double const [])\n" + " csr_scale_columns< int,npy_cfloat_wrapper >(int const,int const,int const [],int const [],npy_cfloat_wrapper [],npy_cfloat_wrapper const [])\n" + " csr_scale_columns< int,npy_cdouble_wrapper >(int const,int const,int const [],int const [],npy_cdouble_wrapper [],npy_cdouble_wrapper const [])\n" + " csr_scale_columns< int,npy_clongdouble_wrapper >(int const,int const,int const [],int const [],npy_clongdouble_wrapper [],npy_clongdouble_wrapper const [])\n"); return NULL; } @@ -13077,7 +13170,7 @@ arg8 = (signed char*) array8->data; } - bsr_scale_rows(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,arg7,(signed char const (*))arg8); + bsr_scale_rows< int,signed char >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,arg7,(signed char const (*))arg8); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -13193,7 +13286,7 @@ arg8 = (unsigned char*) array8->data; } - bsr_scale_rows(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,arg7,(unsigned char const (*))arg8); + bsr_scale_rows< int,unsigned char >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,arg7,(unsigned char const (*))arg8); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -13309,7 +13402,7 @@ arg8 = (short*) array8->data; } - bsr_scale_rows(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,arg7,(short const (*))arg8); + bsr_scale_rows< int,short >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,arg7,(short const (*))arg8); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -13425,7 +13518,7 @@ arg8 = (unsigned short*) array8->data; } - bsr_scale_rows(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,arg7,(unsigned short const (*))arg8); + bsr_scale_rows< int,unsigned short >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,arg7,(unsigned short const (*))arg8); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -13541,7 +13634,7 @@ arg8 = (int*) array8->data; } - bsr_scale_rows(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,arg7,(int const (*))arg8); + bsr_scale_rows< int,int >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,arg7,(int const (*))arg8); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -13657,7 +13750,7 @@ arg8 = (unsigned int*) array8->data; } - bsr_scale_rows(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,arg7,(unsigned int const (*))arg8); + bsr_scale_rows< int,unsigned int >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,arg7,(unsigned int const (*))arg8); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -13773,7 +13866,7 @@ arg8 = (long long*) array8->data; } - bsr_scale_rows(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,arg7,(long long const (*))arg8); + bsr_scale_rows< int,long long >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,arg7,(long long const (*))arg8); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -13889,7 +13982,7 @@ arg8 = (unsigned long long*) array8->data; } - bsr_scale_rows(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,arg7,(unsigned long long const (*))arg8); + bsr_scale_rows< int,unsigned long long >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,arg7,(unsigned long long const (*))arg8); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -14005,7 +14098,7 @@ arg8 = (float*) array8->data; } - bsr_scale_rows(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,arg7,(float const (*))arg8); + bsr_scale_rows< int,float >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,arg7,(float const (*))arg8); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -14121,7 +14214,7 @@ arg8 = (double*) array8->data; } - bsr_scale_rows(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,arg7,(double const (*))arg8); + bsr_scale_rows< int,double >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,arg7,(double const (*))arg8); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -14237,7 +14330,7 @@ arg8 = (long double*) array8->data; } - bsr_scale_rows(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,arg7,(long double const (*))arg8); + bsr_scale_rows< int,long double >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,arg7,(long double const (*))arg8); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -14353,7 +14446,7 @@ arg8 = (npy_cfloat_wrapper*) array8->data; } - bsr_scale_rows(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,arg7,(npy_cfloat_wrapper const (*))arg8); + bsr_scale_rows< int,npy_cfloat_wrapper >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,arg7,(npy_cfloat_wrapper const (*))arg8); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -14469,7 +14562,7 @@ arg8 = (npy_cdouble_wrapper*) array8->data; } - bsr_scale_rows(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,arg7,(npy_cdouble_wrapper const (*))arg8); + bsr_scale_rows< int,npy_cdouble_wrapper >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,arg7,(npy_cdouble_wrapper const (*))arg8); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -14585,7 +14678,7 @@ arg8 = (npy_clongdouble_wrapper*) array8->data; } - bsr_scale_rows(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,arg7,(npy_clongdouble_wrapper const (*))arg8); + bsr_scale_rows< int,npy_clongdouble_wrapper >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,arg7,(npy_clongdouble_wrapper const (*))arg8); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -15295,7 +15388,22 @@ } fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'bsr_scale_rows'.\n Possible C/C++ prototypes are:\n"" bsr_scale_rows<(int,signed char)>(int const,int const,int const,int const,int const [],int const [],signed char [],signed char const [])\n"" bsr_scale_rows<(int,unsigned char)>(int const,int const,int const,int const,int const [],int const [],unsigned char [],unsigned char const [])\n"" bsr_scale_rows<(int,short)>(int const,int const,int const,int const,int const [],int const [],short [],short const [])\n"" bsr_scale_rows<(int,unsigned short)>(int const,int const,int const,int const,int const [],int const [],unsigned short [],unsigned short const [])\n"" bsr_scale_rows<(int,int)>(int const,int const,int const,int const,int const [],int const [],int [],int const [])\n"" bsr_scale_rows<(int,unsigned int)>(int const,int const,int const,int const,int const [],int const [],unsigned int [],unsigned int const [])\n"" bsr_scale_rows<(int,long long)>(int const,int const,int const,int const,int const [],int const [],long long [],long long const [])\n"" bsr_scale_rows<(int,unsigned long long)>(int const,int const,int const,int const,int const [],int const [],unsigned long long [],unsigned long long const [])\n"" bsr_scale_rows<(int,float)>(int const,int const,int const,int const,int const [],int const [],float [],float const [])\n"" bsr_scale_rows<(int,double)>(int const,int const,int const,int const,int const [],int const [],double [],double const [])\n"" bsr_scale_rows<(int,long double)>(int const,int const,int const,int const,int const [],int const [],long double [],long double const [])\n"" bsr_scale_rows<(int,npy_cfloat_wrapper)>(int const,int const,int const,int const,int const [],int const [],npy_cfloat_wrapper [],npy_cfloat_wrapper const [])\n"" bsr_scale_rows<(int,npy_cdouble_wrapper)>(int const,int const,int const,int const,int const [],int const [],npy_cdouble_wrapper [],npy_cdouble_wrapper const [])\n"" bsr_scale_rows<(int,npy_clongdouble_wrapper)>(int const,int const,int const,int const,int const [],int const [],npy_clongdouble_wrapper [],npy_clongdouble_wrapper const [])\n"); + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'bsr_scale_rows'.\n" + " Possible C/C++ prototypes are:\n" + " bsr_scale_rows< int,signed char >(int const,int const,int const,int const,int const [],int const [],signed char [],signed char const [])\n" + " bsr_scale_rows< int,unsigned char >(int const,int const,int const,int const,int const [],int const [],unsigned char [],unsigned char const [])\n" + " bsr_scale_rows< int,short >(int const,int const,int const,int const,int const [],int const [],short [],short const [])\n" + " bsr_scale_rows< int,unsigned short >(int const,int const,int const,int const,int const [],int const [],unsigned short [],unsigned short const [])\n" + " bsr_scale_rows< int,int >(int const,int const,int const,int const,int const [],int const [],int [],int const [])\n" + " bsr_scale_rows< int,unsigned int >(int const,int const,int const,int const,int const [],int const [],unsigned int [],unsigned int const [])\n" + " bsr_scale_rows< int,long long >(int const,int const,int const,int const,int const [],int const [],long long [],long long const [])\n" + " bsr_scale_rows< int,unsigned long long >(int const,int const,int const,int const,int const [],int const [],unsigned long long [],unsigned long long const [])\n" + " bsr_scale_rows< int,float >(int const,int const,int const,int const,int const [],int const [],float [],float const [])\n" + " bsr_scale_rows< int,double >(int const,int const,int const,int const,int const [],int const [],double [],double const [])\n" + " bsr_scale_rows< int,long double >(int const,int const,int const,int const,int const [],int const [],long double [],long double const [])\n" + " bsr_scale_rows< int,npy_cfloat_wrapper >(int const,int const,int const,int const,int const [],int const [],npy_cfloat_wrapper [],npy_cfloat_wrapper const [])\n" + " bsr_scale_rows< int,npy_cdouble_wrapper >(int const,int const,int const,int const,int const [],int const [],npy_cdouble_wrapper [],npy_cdouble_wrapper const [])\n" + " bsr_scale_rows< int,npy_clongdouble_wrapper >(int const,int const,int const,int const,int const [],int const [],npy_clongdouble_wrapper [],npy_clongdouble_wrapper const [])\n"); return NULL; } @@ -15390,7 +15498,7 @@ arg8 = (signed char*) array8->data; } - bsr_scale_columns(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,arg7,(signed char const (*))arg8); + bsr_scale_columns< int,signed char >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,arg7,(signed char const (*))arg8); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -15506,7 +15614,7 @@ arg8 = (unsigned char*) array8->data; } - bsr_scale_columns(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,arg7,(unsigned char const (*))arg8); + bsr_scale_columns< int,unsigned char >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,arg7,(unsigned char const (*))arg8); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -15622,7 +15730,7 @@ arg8 = (short*) array8->data; } - bsr_scale_columns(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,arg7,(short const (*))arg8); + bsr_scale_columns< int,short >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,arg7,(short const (*))arg8); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -15738,7 +15846,7 @@ arg8 = (unsigned short*) array8->data; } - bsr_scale_columns(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,arg7,(unsigned short const (*))arg8); + bsr_scale_columns< int,unsigned short >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,arg7,(unsigned short const (*))arg8); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -15854,7 +15962,7 @@ arg8 = (int*) array8->data; } - bsr_scale_columns(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,arg7,(int const (*))arg8); + bsr_scale_columns< int,int >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,arg7,(int const (*))arg8); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -15970,7 +16078,7 @@ arg8 = (unsigned int*) array8->data; } - bsr_scale_columns(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,arg7,(unsigned int const (*))arg8); + bsr_scale_columns< int,unsigned int >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,arg7,(unsigned int const (*))arg8); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -16086,7 +16194,7 @@ arg8 = (long long*) array8->data; } - bsr_scale_columns(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,arg7,(long long const (*))arg8); + bsr_scale_columns< int,long long >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,arg7,(long long const (*))arg8); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -16202,7 +16310,7 @@ arg8 = (unsigned long long*) array8->data; } - bsr_scale_columns(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,arg7,(unsigned long long const (*))arg8); + bsr_scale_columns< int,unsigned long long >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,arg7,(unsigned long long const (*))arg8); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -16318,7 +16426,7 @@ arg8 = (float*) array8->data; } - bsr_scale_columns(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,arg7,(float const (*))arg8); + bsr_scale_columns< int,float >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,arg7,(float const (*))arg8); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -16434,7 +16542,7 @@ arg8 = (double*) array8->data; } - bsr_scale_columns(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,arg7,(double const (*))arg8); + bsr_scale_columns< int,double >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,arg7,(double const (*))arg8); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -16550,7 +16658,7 @@ arg8 = (long double*) array8->data; } - bsr_scale_columns(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,arg7,(long double const (*))arg8); + bsr_scale_columns< int,long double >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,arg7,(long double const (*))arg8); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -16666,7 +16774,7 @@ arg8 = (npy_cfloat_wrapper*) array8->data; } - bsr_scale_columns(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,arg7,(npy_cfloat_wrapper const (*))arg8); + bsr_scale_columns< int,npy_cfloat_wrapper >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,arg7,(npy_cfloat_wrapper const (*))arg8); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -16782,7 +16890,7 @@ arg8 = (npy_cdouble_wrapper*) array8->data; } - bsr_scale_columns(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,arg7,(npy_cdouble_wrapper const (*))arg8); + bsr_scale_columns< int,npy_cdouble_wrapper >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,arg7,(npy_cdouble_wrapper const (*))arg8); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -16898,7 +17006,7 @@ arg8 = (npy_clongdouble_wrapper*) array8->data; } - bsr_scale_columns(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,arg7,(npy_clongdouble_wrapper const (*))arg8); + bsr_scale_columns< int,npy_clongdouble_wrapper >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,arg7,(npy_clongdouble_wrapper const (*))arg8); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -17608,7 +17716,22 @@ } fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'bsr_scale_columns'.\n Possible C/C++ prototypes are:\n"" bsr_scale_columns<(int,signed char)>(int const,int const,int const,int const,int const [],int const [],signed char [],signed char const [])\n"" bsr_scale_columns<(int,unsigned char)>(int const,int const,int const,int const,int const [],int const [],unsigned char [],unsigned char const [])\n"" bsr_scale_columns<(int,short)>(int const,int const,int const,int const,int const [],int const [],short [],short const [])\n"" bsr_scale_columns<(int,unsigned short)>(int const,int const,int const,int const,int const [],int const [],unsigned short [],unsigned short const [])\n"" bsr_scale_columns<(int,int)>(int const,int const,int const,int const,int const [],int const [],int [],int const [])\n"" bsr_scale_columns<(int,unsigned int)>(int const,int const,int const,int const,int const [],int const [],unsigned int [],unsigned int const [])\n"" bsr_scale_columns<(int,long long)>(int const,int const,int const,int const,int const [],int const [],long long [],long long const [])\n"" bsr_scale_columns<(int,unsigned long long)>(int const,int const,int const,int const,int const [],int const [],unsigned long long [],unsigned long long const [])\n"" bsr_scale_columns<(int,float)>(int const,int const,int const,int const,int const [],int const [],float [],float const [])\n"" bsr_scale_columns<(int,double)>(int const,int const,int const,int const,int const [],int const [],double [],double const [])\n"" bsr_scale_columns<(int,long double)>(int const,int const,int const,int const,int const [],int const [],long double [],long double const [])\n"" bsr_scale_columns<(int,npy_cfloat_wrapper)>(int const,int const,int const,int const,int const [],int const [],npy_cfloat_wrapper [],npy_cfloat_wrapper const [])\n"" bsr_scale_columns<(int,npy_cdouble_wrapper)>(int const,int const,int const,int const,int const [],int const [],npy_cdouble_wrapper [],npy_cdouble_wrapper const [])\n"" bsr_scale_columns<(int,npy_clongdouble_wrapper)>(int const,int const,int const,int const,int const [],int const [],npy_clongdouble_wrapper [],npy_clongdouble_wrapper const [])\n"); + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'bsr_scale_columns'.\n" + " Possible C/C++ prototypes are:\n" + " bsr_scale_columns< int,signed char >(int const,int const,int const,int const,int const [],int const [],signed char [],signed char const [])\n" + " bsr_scale_columns< int,unsigned char >(int const,int const,int const,int const,int const [],int const [],unsigned char [],unsigned char const [])\n" + " bsr_scale_columns< int,short >(int const,int const,int const,int const,int const [],int const [],short [],short const [])\n" + " bsr_scale_columns< int,unsigned short >(int const,int const,int const,int const,int const [],int const [],unsigned short [],unsigned short const [])\n" + " bsr_scale_columns< int,int >(int const,int const,int const,int const,int const [],int const [],int [],int const [])\n" + " bsr_scale_columns< int,unsigned int >(int const,int const,int const,int const,int const [],int const [],unsigned int [],unsigned int const [])\n" + " bsr_scale_columns< int,long long >(int const,int const,int const,int const,int const [],int const [],long long [],long long const [])\n" + " bsr_scale_columns< int,unsigned long long >(int const,int const,int const,int const,int const [],int const [],unsigned long long [],unsigned long long const [])\n" + " bsr_scale_columns< int,float >(int const,int const,int const,int const,int const [],int const [],float [],float const [])\n" + " bsr_scale_columns< int,double >(int const,int const,int const,int const,int const [],int const [],double [],double const [])\n" + " bsr_scale_columns< int,long double >(int const,int const,int const,int const,int const [],int const [],long double [],long double const [])\n" + " bsr_scale_columns< int,npy_cfloat_wrapper >(int const,int const,int const,int const,int const [],int const [],npy_cfloat_wrapper [],npy_cfloat_wrapper const [])\n" + " bsr_scale_columns< int,npy_cdouble_wrapper >(int const,int const,int const,int const,int const [],int const [],npy_cdouble_wrapper [],npy_cdouble_wrapper const [])\n" + " bsr_scale_columns< int,npy_clongdouble_wrapper >(int const,int const,int const,int const,int const [],int const [],npy_clongdouble_wrapper [],npy_clongdouble_wrapper const [])\n"); return NULL; } @@ -17701,7 +17824,7 @@ if (!temp8 || !require_contiguous(temp8) || !require_native(temp8)) SWIG_fail; arg8 = (signed char*) array_data(temp8); } - csr_tocsc(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(signed char const (*))arg5,arg6,arg7,arg8); + csr_tocsc< int,signed char >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(signed char const (*))arg5,arg6,arg7,arg8); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -17815,7 +17938,7 @@ if (!temp8 || !require_contiguous(temp8) || !require_native(temp8)) SWIG_fail; arg8 = (unsigned char*) array_data(temp8); } - csr_tocsc(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned char const (*))arg5,arg6,arg7,arg8); + csr_tocsc< int,unsigned char >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned char const (*))arg5,arg6,arg7,arg8); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -17929,7 +18052,7 @@ if (!temp8 || !require_contiguous(temp8) || !require_native(temp8)) SWIG_fail; arg8 = (short*) array_data(temp8); } - csr_tocsc(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(short const (*))arg5,arg6,arg7,arg8); + csr_tocsc< int,short >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(short const (*))arg5,arg6,arg7,arg8); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -18043,7 +18166,7 @@ if (!temp8 || !require_contiguous(temp8) || !require_native(temp8)) SWIG_fail; arg8 = (unsigned short*) array_data(temp8); } - csr_tocsc(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned short const (*))arg5,arg6,arg7,arg8); + csr_tocsc< int,unsigned short >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned short const (*))arg5,arg6,arg7,arg8); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -18157,7 +18280,7 @@ if (!temp8 || !require_contiguous(temp8) || !require_native(temp8)) SWIG_fail; arg8 = (int*) array_data(temp8); } - csr_tocsc(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(int const (*))arg5,arg6,arg7,arg8); + csr_tocsc< int,int >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(int const (*))arg5,arg6,arg7,arg8); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -18271,7 +18394,7 @@ if (!temp8 || !require_contiguous(temp8) || !require_native(temp8)) SWIG_fail; arg8 = (unsigned int*) array_data(temp8); } - csr_tocsc(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned int const (*))arg5,arg6,arg7,arg8); + csr_tocsc< int,unsigned int >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned int const (*))arg5,arg6,arg7,arg8); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -18385,7 +18508,7 @@ if (!temp8 || !require_contiguous(temp8) || !require_native(temp8)) SWIG_fail; arg8 = (long long*) array_data(temp8); } - csr_tocsc(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long long const (*))arg5,arg6,arg7,arg8); + csr_tocsc< int,long long >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long long const (*))arg5,arg6,arg7,arg8); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -18499,7 +18622,7 @@ if (!temp8 || !require_contiguous(temp8) || !require_native(temp8)) SWIG_fail; arg8 = (unsigned long long*) array_data(temp8); } - csr_tocsc(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned long long const (*))arg5,arg6,arg7,arg8); + csr_tocsc< int,unsigned long long >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned long long const (*))arg5,arg6,arg7,arg8); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -18613,7 +18736,7 @@ if (!temp8 || !require_contiguous(temp8) || !require_native(temp8)) SWIG_fail; arg8 = (float*) array_data(temp8); } - csr_tocsc(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(float const (*))arg5,arg6,arg7,arg8); + csr_tocsc< int,float >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(float const (*))arg5,arg6,arg7,arg8); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -18727,7 +18850,7 @@ if (!temp8 || !require_contiguous(temp8) || !require_native(temp8)) SWIG_fail; arg8 = (double*) array_data(temp8); } - csr_tocsc(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(double const (*))arg5,arg6,arg7,arg8); + csr_tocsc< int,double >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(double const (*))arg5,arg6,arg7,arg8); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -18841,7 +18964,7 @@ if (!temp8 || !require_contiguous(temp8) || !require_native(temp8)) SWIG_fail; arg8 = (long double*) array_data(temp8); } - csr_tocsc(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long double const (*))arg5,arg6,arg7,arg8); + csr_tocsc< int,long double >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long double const (*))arg5,arg6,arg7,arg8); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -18955,7 +19078,7 @@ if (!temp8 || !require_contiguous(temp8) || !require_native(temp8)) SWIG_fail; arg8 = (npy_cfloat_wrapper*) array_data(temp8); } - csr_tocsc(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cfloat_wrapper const (*))arg5,arg6,arg7,arg8); + csr_tocsc< int,npy_cfloat_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cfloat_wrapper const (*))arg5,arg6,arg7,arg8); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -19069,7 +19192,7 @@ if (!temp8 || !require_contiguous(temp8) || !require_native(temp8)) SWIG_fail; arg8 = (npy_cdouble_wrapper*) array_data(temp8); } - csr_tocsc(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cdouble_wrapper const (*))arg5,arg6,arg7,arg8); + csr_tocsc< int,npy_cdouble_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cdouble_wrapper const (*))arg5,arg6,arg7,arg8); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -19183,7 +19306,7 @@ if (!temp8 || !require_contiguous(temp8) || !require_native(temp8)) SWIG_fail; arg8 = (npy_clongdouble_wrapper*) array_data(temp8); } - csr_tocsc(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_clongdouble_wrapper const (*))arg5,arg6,arg7,arg8); + csr_tocsc< int,npy_clongdouble_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_clongdouble_wrapper const (*))arg5,arg6,arg7,arg8); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -19865,7 +19988,22 @@ } fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'csr_tocsc'.\n Possible C/C++ prototypes are:\n"" csr_tocsc<(int,signed char)>(int const,int const,int const [],int const [],signed char const [],int [],int [],signed char [])\n"" csr_tocsc<(int,unsigned char)>(int const,int const,int const [],int const [],unsigned char const [],int [],int [],unsigned char [])\n"" csr_tocsc<(int,short)>(int const,int const,int const [],int const [],short const [],int [],int [],short [])\n"" csr_tocsc<(int,unsigned short)>(int const,int const,int const [],int const [],unsigned short const [],int [],int [],unsigned short [])\n"" csr_tocsc<(int,int)>(int const,int const,int const [],int const [],int const [],int [],int [],int [])\n"" csr_tocsc<(int,unsigned int)>(int const,int const,int const [],int const [],unsigned int const [],int [],int [],unsigned int [])\n"" csr_tocsc<(int,long long)>(int const,int const,int const [],int const [],long long const [],int [],int [],long long [])\n"" csr_tocsc<(int,unsigned long long)>(int const,int const,int const [],int const [],unsigned long long const [],int [],int [],unsigned long long [])\n"" csr_tocsc<(int,float)>(int const,int const,int const [],int const [],float const [],int [],int [],float [])\n"" csr_tocsc<(int,double)>(int const,int const,int const [],int const [],double const [],int [],int [],double [])\n"" csr_tocsc<(int,long double)>(int const,int const,int const [],int const [],long double const [],int [],int [],long double [])\n"" csr_tocsc<(int,npy_cfloat_wrapper)>(int const,int const,int const [],int const [],npy_cfloat_wrapper const [],int [],int [],npy_cfloat_wrapper [])\n"" csr_tocsc<(int,npy_cdouble_wrapper)>(int const,int const,int const [],int const [],npy_cdouble_wrapper const [],int [],int [],npy_cdouble_wrapper [])\n"" csr_tocsc<(int,npy_clongdouble_wrapper)>(int const,int const,int const [],int const [],npy_clongdouble_wrapper const [],int [],int [],npy_clongdouble_wrapper [])\n"); + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'csr_tocsc'.\n" + " Possible C/C++ prototypes are:\n" + " csr_tocsc< int,signed char >(int const,int const,int const [],int const [],signed char const [],int [],int [],signed char [])\n" + " csr_tocsc< int,unsigned char >(int const,int const,int const [],int const [],unsigned char const [],int [],int [],unsigned char [])\n" + " csr_tocsc< int,short >(int const,int const,int const [],int const [],short const [],int [],int [],short [])\n" + " csr_tocsc< int,unsigned short >(int const,int const,int const [],int const [],unsigned short const [],int [],int [],unsigned short [])\n" + " csr_tocsc< int,int >(int const,int const,int const [],int const [],int const [],int [],int [],int [])\n" + " csr_tocsc< int,unsigned int >(int const,int const,int const [],int const [],unsigned int const [],int [],int [],unsigned int [])\n" + " csr_tocsc< int,long long >(int const,int const,int const [],int const [],long long const [],int [],int [],long long [])\n" + " csr_tocsc< int,unsigned long long >(int const,int const,int const [],int const [],unsigned long long const [],int [],int [],unsigned long long [])\n" + " csr_tocsc< int,float >(int const,int const,int const [],int const [],float const [],int [],int [],float [])\n" + " csr_tocsc< int,double >(int const,int const,int const [],int const [],double const [],int [],int [],double [])\n" + " csr_tocsc< int,long double >(int const,int const,int const [],int const [],long double const [],int [],int [],long double [])\n" + " csr_tocsc< int,npy_cfloat_wrapper >(int const,int const,int const [],int const [],npy_cfloat_wrapper const [],int [],int [],npy_cfloat_wrapper [])\n" + " csr_tocsc< int,npy_cdouble_wrapper >(int const,int const,int const [],int const [],npy_cdouble_wrapper const [],int [],int [],npy_cdouble_wrapper [])\n" + " csr_tocsc< int,npy_clongdouble_wrapper >(int const,int const,int const [],int const [],npy_clongdouble_wrapper const [],int [],int [],npy_clongdouble_wrapper [])\n"); return NULL; } @@ -19958,7 +20096,7 @@ if (!temp8 || !require_contiguous(temp8) || !require_native(temp8)) SWIG_fail; arg8 = (signed char*) array_data(temp8); } - csc_tocsr(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(signed char const (*))arg5,arg6,arg7,arg8); + csc_tocsr< int,signed char >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(signed char const (*))arg5,arg6,arg7,arg8); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -20072,7 +20210,7 @@ if (!temp8 || !require_contiguous(temp8) || !require_native(temp8)) SWIG_fail; arg8 = (unsigned char*) array_data(temp8); } - csc_tocsr(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned char const (*))arg5,arg6,arg7,arg8); + csc_tocsr< int,unsigned char >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned char const (*))arg5,arg6,arg7,arg8); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -20186,7 +20324,7 @@ if (!temp8 || !require_contiguous(temp8) || !require_native(temp8)) SWIG_fail; arg8 = (short*) array_data(temp8); } - csc_tocsr(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(short const (*))arg5,arg6,arg7,arg8); + csc_tocsr< int,short >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(short const (*))arg5,arg6,arg7,arg8); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -20300,7 +20438,7 @@ if (!temp8 || !require_contiguous(temp8) || !require_native(temp8)) SWIG_fail; arg8 = (unsigned short*) array_data(temp8); } - csc_tocsr(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned short const (*))arg5,arg6,arg7,arg8); + csc_tocsr< int,unsigned short >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned short const (*))arg5,arg6,arg7,arg8); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -20414,7 +20552,7 @@ if (!temp8 || !require_contiguous(temp8) || !require_native(temp8)) SWIG_fail; arg8 = (int*) array_data(temp8); } - csc_tocsr(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(int const (*))arg5,arg6,arg7,arg8); + csc_tocsr< int,int >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(int const (*))arg5,arg6,arg7,arg8); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -20528,7 +20666,7 @@ if (!temp8 || !require_contiguous(temp8) || !require_native(temp8)) SWIG_fail; arg8 = (unsigned int*) array_data(temp8); } - csc_tocsr(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned int const (*))arg5,arg6,arg7,arg8); + csc_tocsr< int,unsigned int >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned int const (*))arg5,arg6,arg7,arg8); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -20642,7 +20780,7 @@ if (!temp8 || !require_contiguous(temp8) || !require_native(temp8)) SWIG_fail; arg8 = (long long*) array_data(temp8); } - csc_tocsr(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long long const (*))arg5,arg6,arg7,arg8); + csc_tocsr< int,long long >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long long const (*))arg5,arg6,arg7,arg8); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -20756,7 +20894,7 @@ if (!temp8 || !require_contiguous(temp8) || !require_native(temp8)) SWIG_fail; arg8 = (unsigned long long*) array_data(temp8); } - csc_tocsr(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned long long const (*))arg5,arg6,arg7,arg8); + csc_tocsr< int,unsigned long long >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned long long const (*))arg5,arg6,arg7,arg8); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -20870,7 +21008,7 @@ if (!temp8 || !require_contiguous(temp8) || !require_native(temp8)) SWIG_fail; arg8 = (float*) array_data(temp8); } - csc_tocsr(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(float const (*))arg5,arg6,arg7,arg8); + csc_tocsr< int,float >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(float const (*))arg5,arg6,arg7,arg8); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -20984,7 +21122,7 @@ if (!temp8 || !require_contiguous(temp8) || !require_native(temp8)) SWIG_fail; arg8 = (double*) array_data(temp8); } - csc_tocsr(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(double const (*))arg5,arg6,arg7,arg8); + csc_tocsr< int,double >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(double const (*))arg5,arg6,arg7,arg8); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -21098,7 +21236,7 @@ if (!temp8 || !require_contiguous(temp8) || !require_native(temp8)) SWIG_fail; arg8 = (long double*) array_data(temp8); } - csc_tocsr(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long double const (*))arg5,arg6,arg7,arg8); + csc_tocsr< int,long double >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long double const (*))arg5,arg6,arg7,arg8); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -21212,7 +21350,7 @@ if (!temp8 || !require_contiguous(temp8) || !require_native(temp8)) SWIG_fail; arg8 = (npy_cfloat_wrapper*) array_data(temp8); } - csc_tocsr(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cfloat_wrapper const (*))arg5,arg6,arg7,arg8); + csc_tocsr< int,npy_cfloat_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cfloat_wrapper const (*))arg5,arg6,arg7,arg8); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -21326,7 +21464,7 @@ if (!temp8 || !require_contiguous(temp8) || !require_native(temp8)) SWIG_fail; arg8 = (npy_cdouble_wrapper*) array_data(temp8); } - csc_tocsr(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cdouble_wrapper const (*))arg5,arg6,arg7,arg8); + csc_tocsr< int,npy_cdouble_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cdouble_wrapper const (*))arg5,arg6,arg7,arg8); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -21440,7 +21578,7 @@ if (!temp8 || !require_contiguous(temp8) || !require_native(temp8)) SWIG_fail; arg8 = (npy_clongdouble_wrapper*) array_data(temp8); } - csc_tocsr(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_clongdouble_wrapper const (*))arg5,arg6,arg7,arg8); + csc_tocsr< int,npy_clongdouble_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_clongdouble_wrapper const (*))arg5,arg6,arg7,arg8); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -22122,7 +22260,22 @@ } fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'csc_tocsr'.\n Possible C/C++ prototypes are:\n"" csc_tocsr<(int,signed char)>(int const,int const,int const [],int const [],signed char const [],int [],int [],signed char [])\n"" csc_tocsr<(int,unsigned char)>(int const,int const,int const [],int const [],unsigned char const [],int [],int [],unsigned char [])\n"" csc_tocsr<(int,short)>(int const,int const,int const [],int const [],short const [],int [],int [],short [])\n"" csc_tocsr<(int,unsigned short)>(int const,int const,int const [],int const [],unsigned short const [],int [],int [],unsigned short [])\n"" csc_tocsr<(int,int)>(int const,int const,int const [],int const [],int const [],int [],int [],int [])\n"" csc_tocsr<(int,unsigned int)>(int const,int const,int const [],int const [],unsigned int const [],int [],int [],unsigned int [])\n"" csc_tocsr<(int,long long)>(int const,int const,int const [],int const [],long long const [],int [],int [],long long [])\n"" csc_tocsr<(int,unsigned long long)>(int const,int const,int const [],int const [],unsigned long long const [],int [],int [],unsigned long long [])\n"" csc_tocsr<(int,float)>(int const,int const,int const [],int const [],float const [],int [],int [],float [])\n"" csc_tocsr<(int,double)>(int const,int const,int const [],int const [],double const [],int [],int [],double [])\n"" csc_tocsr<(int,long double)>(int const,int const,int const [],int const [],long double const [],int [],int [],long double [])\n"" csc_tocsr<(int,npy_cfloat_wrapper)>(int const,int const,int const [],int const [],npy_cfloat_wrapper const [],int [],int [],npy_cfloat_wrapper [])\n"" csc_tocsr<(int,npy_cdouble_wrapper)>(int const,int const,int const [],int const [],npy_cdouble_wrapper const [],int [],int [],npy_cdouble_wrapper [])\n"" csc_tocsr<(int,npy_clongdouble_wrapper)>(int const,int const,int const [],int const [],npy_clongdouble_wrapper const [],int [],int [],npy_clongdouble_wrapper [])\n"); + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'csc_tocsr'.\n" + " Possible C/C++ prototypes are:\n" + " csc_tocsr< int,signed char >(int const,int const,int const [],int const [],signed char const [],int [],int [],signed char [])\n" + " csc_tocsr< int,unsigned char >(int const,int const,int const [],int const [],unsigned char const [],int [],int [],unsigned char [])\n" + " csc_tocsr< int,short >(int const,int const,int const [],int const [],short const [],int [],int [],short [])\n" + " csc_tocsr< int,unsigned short >(int const,int const,int const [],int const [],unsigned short const [],int [],int [],unsigned short [])\n" + " csc_tocsr< int,int >(int const,int const,int const [],int const [],int const [],int [],int [],int [])\n" + " csc_tocsr< int,unsigned int >(int const,int const,int const [],int const [],unsigned int const [],int [],int [],unsigned int [])\n" + " csc_tocsr< int,long long >(int const,int const,int const [],int const [],long long const [],int [],int [],long long [])\n" + " csc_tocsr< int,unsigned long long >(int const,int const,int const [],int const [],unsigned long long const [],int [],int [],unsigned long long [])\n" + " csc_tocsr< int,float >(int const,int const,int const [],int const [],float const [],int [],int [],float [])\n" + " csc_tocsr< int,double >(int const,int const,int const [],int const [],double const [],int [],int [],double [])\n" + " csc_tocsr< int,long double >(int const,int const,int const [],int const [],long double const [],int [],int [],long double [])\n" + " csc_tocsr< int,npy_cfloat_wrapper >(int const,int const,int const [],int const [],npy_cfloat_wrapper const [],int [],int [],npy_cfloat_wrapper [])\n" + " csc_tocsr< int,npy_cdouble_wrapper >(int const,int const,int const [],int const [],npy_cdouble_wrapper const [],int [],int [],npy_cdouble_wrapper [])\n" + " csc_tocsr< int,npy_clongdouble_wrapper >(int const,int const,int const [],int const [],npy_clongdouble_wrapper const [],int [],int [],npy_clongdouble_wrapper [])\n"); return NULL; } @@ -22233,7 +22386,7 @@ if (!temp10 || !require_contiguous(temp10) || !require_native(temp10)) SWIG_fail; arg10 = (signed char*) array_data(temp10); } - csr_tobsr(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(signed char const (*))arg7,arg8,arg9,arg10); + csr_tobsr< int,signed char >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(signed char const (*))arg7,arg8,arg9,arg10); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -22365,7 +22518,7 @@ if (!temp10 || !require_contiguous(temp10) || !require_native(temp10)) SWIG_fail; arg10 = (unsigned char*) array_data(temp10); } - csr_tobsr(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(unsigned char const (*))arg7,arg8,arg9,arg10); + csr_tobsr< int,unsigned char >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(unsigned char const (*))arg7,arg8,arg9,arg10); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -22497,7 +22650,7 @@ if (!temp10 || !require_contiguous(temp10) || !require_native(temp10)) SWIG_fail; arg10 = (short*) array_data(temp10); } - csr_tobsr(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(short const (*))arg7,arg8,arg9,arg10); + csr_tobsr< int,short >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(short const (*))arg7,arg8,arg9,arg10); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -22629,7 +22782,7 @@ if (!temp10 || !require_contiguous(temp10) || !require_native(temp10)) SWIG_fail; arg10 = (unsigned short*) array_data(temp10); } - csr_tobsr(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(unsigned short const (*))arg7,arg8,arg9,arg10); + csr_tobsr< int,unsigned short >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(unsigned short const (*))arg7,arg8,arg9,arg10); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -22761,7 +22914,7 @@ if (!temp10 || !require_contiguous(temp10) || !require_native(temp10)) SWIG_fail; arg10 = (int*) array_data(temp10); } - csr_tobsr(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(int const (*))arg7,arg8,arg9,arg10); + csr_tobsr< int,int >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(int const (*))arg7,arg8,arg9,arg10); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -22893,7 +23046,7 @@ if (!temp10 || !require_contiguous(temp10) || !require_native(temp10)) SWIG_fail; arg10 = (unsigned int*) array_data(temp10); } - csr_tobsr(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(unsigned int const (*))arg7,arg8,arg9,arg10); + csr_tobsr< int,unsigned int >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(unsigned int const (*))arg7,arg8,arg9,arg10); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -23025,7 +23178,7 @@ if (!temp10 || !require_contiguous(temp10) || !require_native(temp10)) SWIG_fail; arg10 = (long long*) array_data(temp10); } - csr_tobsr(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(long long const (*))arg7,arg8,arg9,arg10); + csr_tobsr< int,long long >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(long long const (*))arg7,arg8,arg9,arg10); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -23157,7 +23310,7 @@ if (!temp10 || !require_contiguous(temp10) || !require_native(temp10)) SWIG_fail; arg10 = (unsigned long long*) array_data(temp10); } - csr_tobsr(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(unsigned long long const (*))arg7,arg8,arg9,arg10); + csr_tobsr< int,unsigned long long >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(unsigned long long const (*))arg7,arg8,arg9,arg10); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -23289,7 +23442,7 @@ if (!temp10 || !require_contiguous(temp10) || !require_native(temp10)) SWIG_fail; arg10 = (float*) array_data(temp10); } - csr_tobsr(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(float const (*))arg7,arg8,arg9,arg10); + csr_tobsr< int,float >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(float const (*))arg7,arg8,arg9,arg10); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -23421,7 +23574,7 @@ if (!temp10 || !require_contiguous(temp10) || !require_native(temp10)) SWIG_fail; arg10 = (double*) array_data(temp10); } - csr_tobsr(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(double const (*))arg7,arg8,arg9,arg10); + csr_tobsr< int,double >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(double const (*))arg7,arg8,arg9,arg10); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -23553,7 +23706,7 @@ if (!temp10 || !require_contiguous(temp10) || !require_native(temp10)) SWIG_fail; arg10 = (long double*) array_data(temp10); } - csr_tobsr(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(long double const (*))arg7,arg8,arg9,arg10); + csr_tobsr< int,long double >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(long double const (*))arg7,arg8,arg9,arg10); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -23685,7 +23838,7 @@ if (!temp10 || !require_contiguous(temp10) || !require_native(temp10)) SWIG_fail; arg10 = (npy_cfloat_wrapper*) array_data(temp10); } - csr_tobsr(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(npy_cfloat_wrapper const (*))arg7,arg8,arg9,arg10); + csr_tobsr< int,npy_cfloat_wrapper >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(npy_cfloat_wrapper const (*))arg7,arg8,arg9,arg10); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -23817,7 +23970,7 @@ if (!temp10 || !require_contiguous(temp10) || !require_native(temp10)) SWIG_fail; arg10 = (npy_cdouble_wrapper*) array_data(temp10); } - csr_tobsr(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(npy_cdouble_wrapper const (*))arg7,arg8,arg9,arg10); + csr_tobsr< int,npy_cdouble_wrapper >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(npy_cdouble_wrapper const (*))arg7,arg8,arg9,arg10); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -23949,7 +24102,7 @@ if (!temp10 || !require_contiguous(temp10) || !require_native(temp10)) SWIG_fail; arg10 = (npy_clongdouble_wrapper*) array_data(temp10); } - csr_tobsr(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(npy_clongdouble_wrapper const (*))arg7,arg8,arg9,arg10); + csr_tobsr< int,npy_clongdouble_wrapper >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(npy_clongdouble_wrapper const (*))arg7,arg8,arg9,arg10); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -24799,7 +24952,22 @@ } fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'csr_tobsr'.\n Possible C/C++ prototypes are:\n"" csr_tobsr<(int,signed char)>(int const,int const,int const,int const,int const [],int const [],signed char const [],int [],int [],signed char [])\n"" csr_tobsr<(int,unsigned char)>(int const,int const,int const,int const,int const [],int const [],unsigned char const [],int [],int [],unsigned char [])\n"" csr_tobsr<(int,short)>(int const,int const,int const,int const,int const [],int const [],short const [],int [],int [],short [])\n"" csr_tobsr<(int,unsigned short)>(int const,int const,int const,int const,int const [],int const [],unsigned short const [],int [],int [],unsigned short [])\n"" csr_tobsr<(int,int)>(int const,int const,int const,int const,int const [],int const [],int const [],int [],int [],int [])\n"" csr_tobsr<(int,unsigned int)>(int const,int const,int const,int const,int const [],int const [],unsigned int const [],int [],int [],unsigned int [])\n"" csr_tobsr<(int,long long)>(int const,int const,int const,int const,int const [],int const [],long long const [],int [],int [],long long [])\n"" csr_tobsr<(int,unsigned long long)>(int const,int const,int const,int const,int const [],int const [],unsigned long long const [],int [],int [],unsigned long long [])\n"" csr_tobsr<(int,float)>(int const,int const,int const,int const,int const [],int const [],float const [],int [],int [],float [])\n"" csr_tobsr<(int,double)>(int const,int const,int const,int const,int const [],int const [],double const [],int [],int [],double [])\n"" csr_tobsr<(int,long double)>(int const,int const,int const,int const,int const [],int const [],long double const [],int [],int [],long double [])\n"" csr_tobsr<(int,npy_cfloat_wrapper)>(int const,int const,int const,int const,int const [],int const [],npy_cfloat_wrapper const [],int [],int [],npy_cfloat_wrapper [])\n"" csr_tobsr<(int,npy_cdouble_wrapper)>(int const,int const,int const,int const,int const [],int const [],npy_cdouble_wrapper const [],int [],int [],npy_cdouble_wrapper [])\n"" csr_tobsr<(int,npy_clongdouble_wrapper)>(int const,int const,int const,int const,int const [],int const [],npy_clongdouble_wrapper const [],int [],int [],npy_clongdouble_wrapper [])\n"); + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'csr_tobsr'.\n" + " Possible C/C++ prototypes are:\n" + " csr_tobsr< int,signed char >(int const,int const,int const,int const,int const [],int const [],signed char const [],int [],int [],signed char [])\n" + " csr_tobsr< int,unsigned char >(int const,int const,int const,int const,int const [],int const [],unsigned char const [],int [],int [],unsigned char [])\n" + " csr_tobsr< int,short >(int const,int const,int const,int const,int const [],int const [],short const [],int [],int [],short [])\n" + " csr_tobsr< int,unsigned short >(int const,int const,int const,int const,int const [],int const [],unsigned short const [],int [],int [],unsigned short [])\n" + " csr_tobsr< int,int >(int const,int const,int const,int const,int const [],int const [],int const [],int [],int [],int [])\n" + " csr_tobsr< int,unsigned int >(int const,int const,int const,int const,int const [],int const [],unsigned int const [],int [],int [],unsigned int [])\n" + " csr_tobsr< int,long long >(int const,int const,int const,int const,int const [],int const [],long long const [],int [],int [],long long [])\n" + " csr_tobsr< int,unsigned long long >(int const,int const,int const,int const,int const [],int const [],unsigned long long const [],int [],int [],unsigned long long [])\n" + " csr_tobsr< int,float >(int const,int const,int const,int const,int const [],int const [],float const [],int [],int [],float [])\n" + " csr_tobsr< int,double >(int const,int const,int const,int const,int const [],int const [],double const [],int [],int [],double [])\n" + " csr_tobsr< int,long double >(int const,int const,int const,int const,int const [],int const [],long double const [],int [],int [],long double [])\n" + " csr_tobsr< int,npy_cfloat_wrapper >(int const,int const,int const,int const,int const [],int const [],npy_cfloat_wrapper const [],int [],int [],npy_cfloat_wrapper [])\n" + " csr_tobsr< int,npy_cdouble_wrapper >(int const,int const,int const,int const,int const [],int const [],npy_cdouble_wrapper const [],int [],int [],npy_cdouble_wrapper [])\n" + " csr_tobsr< int,npy_clongdouble_wrapper >(int const,int const,int const,int const,int const [],int const [],npy_clongdouble_wrapper const [],int [],int [],npy_clongdouble_wrapper [])\n"); return NULL; } @@ -24839,7 +25007,7 @@ if (!temp3 || !require_contiguous(temp3) || !require_native(temp3)) SWIG_fail; arg3 = (int*) array_data(temp3); } - expandptr(arg1,(int const (*))arg2,arg3); + expandptr< int >(arg1,(int const (*))arg2,arg3); resultobj = SWIG_Py_Void(); { if (is_new_object2 && array2) Py_DECREF(array2); @@ -24950,7 +25118,7 @@ if (!temp9 || !require_contiguous(temp9) || !require_native(temp9)) SWIG_fail; arg9 = (signed char*) array_data(temp9); } - coo_tocsr(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(signed char const (*))arg6,arg7,arg8,arg9); + coo_tocsr< int,signed char >(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(signed char const (*))arg6,arg7,arg8,arg9); resultobj = SWIG_Py_Void(); { if (is_new_object4 && array4) Py_DECREF(array4); @@ -25073,7 +25241,7 @@ if (!temp9 || !require_contiguous(temp9) || !require_native(temp9)) SWIG_fail; arg9 = (unsigned char*) array_data(temp9); } - coo_tocsr(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(unsigned char const (*))arg6,arg7,arg8,arg9); + coo_tocsr< int,unsigned char >(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(unsigned char const (*))arg6,arg7,arg8,arg9); resultobj = SWIG_Py_Void(); { if (is_new_object4 && array4) Py_DECREF(array4); @@ -25196,7 +25364,7 @@ if (!temp9 || !require_contiguous(temp9) || !require_native(temp9)) SWIG_fail; arg9 = (short*) array_data(temp9); } - coo_tocsr(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(short const (*))arg6,arg7,arg8,arg9); + coo_tocsr< int,short >(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(short const (*))arg6,arg7,arg8,arg9); resultobj = SWIG_Py_Void(); { if (is_new_object4 && array4) Py_DECREF(array4); @@ -25319,7 +25487,7 @@ if (!temp9 || !require_contiguous(temp9) || !require_native(temp9)) SWIG_fail; arg9 = (unsigned short*) array_data(temp9); } - coo_tocsr(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(unsigned short const (*))arg6,arg7,arg8,arg9); + coo_tocsr< int,unsigned short >(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(unsigned short const (*))arg6,arg7,arg8,arg9); resultobj = SWIG_Py_Void(); { if (is_new_object4 && array4) Py_DECREF(array4); @@ -25442,7 +25610,7 @@ if (!temp9 || !require_contiguous(temp9) || !require_native(temp9)) SWIG_fail; arg9 = (int*) array_data(temp9); } - coo_tocsr(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(int const (*))arg6,arg7,arg8,arg9); + coo_tocsr< int,int >(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(int const (*))arg6,arg7,arg8,arg9); resultobj = SWIG_Py_Void(); { if (is_new_object4 && array4) Py_DECREF(array4); @@ -25565,7 +25733,7 @@ if (!temp9 || !require_contiguous(temp9) || !require_native(temp9)) SWIG_fail; arg9 = (unsigned int*) array_data(temp9); } - coo_tocsr(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(unsigned int const (*))arg6,arg7,arg8,arg9); + coo_tocsr< int,unsigned int >(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(unsigned int const (*))arg6,arg7,arg8,arg9); resultobj = SWIG_Py_Void(); { if (is_new_object4 && array4) Py_DECREF(array4); @@ -25688,7 +25856,7 @@ if (!temp9 || !require_contiguous(temp9) || !require_native(temp9)) SWIG_fail; arg9 = (long long*) array_data(temp9); } - coo_tocsr(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(long long const (*))arg6,arg7,arg8,arg9); + coo_tocsr< int,long long >(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(long long const (*))arg6,arg7,arg8,arg9); resultobj = SWIG_Py_Void(); { if (is_new_object4 && array4) Py_DECREF(array4); @@ -25811,7 +25979,7 @@ if (!temp9 || !require_contiguous(temp9) || !require_native(temp9)) SWIG_fail; arg9 = (unsigned long long*) array_data(temp9); } - coo_tocsr(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(unsigned long long const (*))arg6,arg7,arg8,arg9); + coo_tocsr< int,unsigned long long >(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(unsigned long long const (*))arg6,arg7,arg8,arg9); resultobj = SWIG_Py_Void(); { if (is_new_object4 && array4) Py_DECREF(array4); @@ -25934,7 +26102,7 @@ if (!temp9 || !require_contiguous(temp9) || !require_native(temp9)) SWIG_fail; arg9 = (float*) array_data(temp9); } - coo_tocsr(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(float const (*))arg6,arg7,arg8,arg9); + coo_tocsr< int,float >(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(float const (*))arg6,arg7,arg8,arg9); resultobj = SWIG_Py_Void(); { if (is_new_object4 && array4) Py_DECREF(array4); @@ -26057,7 +26225,7 @@ if (!temp9 || !require_contiguous(temp9) || !require_native(temp9)) SWIG_fail; arg9 = (double*) array_data(temp9); } - coo_tocsr(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(double const (*))arg6,arg7,arg8,arg9); + coo_tocsr< int,double >(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(double const (*))arg6,arg7,arg8,arg9); resultobj = SWIG_Py_Void(); { if (is_new_object4 && array4) Py_DECREF(array4); @@ -26180,7 +26348,7 @@ if (!temp9 || !require_contiguous(temp9) || !require_native(temp9)) SWIG_fail; arg9 = (long double*) array_data(temp9); } - coo_tocsr(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(long double const (*))arg6,arg7,arg8,arg9); + coo_tocsr< int,long double >(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(long double const (*))arg6,arg7,arg8,arg9); resultobj = SWIG_Py_Void(); { if (is_new_object4 && array4) Py_DECREF(array4); @@ -26303,7 +26471,7 @@ if (!temp9 || !require_contiguous(temp9) || !require_native(temp9)) SWIG_fail; arg9 = (npy_cfloat_wrapper*) array_data(temp9); } - coo_tocsr(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(npy_cfloat_wrapper const (*))arg6,arg7,arg8,arg9); + coo_tocsr< int,npy_cfloat_wrapper >(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(npy_cfloat_wrapper const (*))arg6,arg7,arg8,arg9); resultobj = SWIG_Py_Void(); { if (is_new_object4 && array4) Py_DECREF(array4); @@ -26426,7 +26594,7 @@ if (!temp9 || !require_contiguous(temp9) || !require_native(temp9)) SWIG_fail; arg9 = (npy_cdouble_wrapper*) array_data(temp9); } - coo_tocsr(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(npy_cdouble_wrapper const (*))arg6,arg7,arg8,arg9); + coo_tocsr< int,npy_cdouble_wrapper >(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(npy_cdouble_wrapper const (*))arg6,arg7,arg8,arg9); resultobj = SWIG_Py_Void(); { if (is_new_object4 && array4) Py_DECREF(array4); @@ -26549,7 +26717,7 @@ if (!temp9 || !require_contiguous(temp9) || !require_native(temp9)) SWIG_fail; arg9 = (npy_clongdouble_wrapper*) array_data(temp9); } - coo_tocsr(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(npy_clongdouble_wrapper const (*))arg6,arg7,arg8,arg9); + coo_tocsr< int,npy_clongdouble_wrapper >(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(npy_clongdouble_wrapper const (*))arg6,arg7,arg8,arg9); resultobj = SWIG_Py_Void(); { if (is_new_object4 && array4) Py_DECREF(array4); @@ -27315,7 +27483,22 @@ } fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'coo_tocsr'.\n Possible C/C++ prototypes are:\n"" coo_tocsr<(int,signed char)>(int const,int const,int const,int const [],int const [],signed char const [],int [],int [],signed char [])\n"" coo_tocsr<(int,unsigned char)>(int const,int const,int const,int const [],int const [],unsigned char const [],int [],int [],unsigned char [])\n"" coo_tocsr<(int,short)>(int const,int const,int const,int const [],int const [],short const [],int [],int [],short [])\n"" coo_tocsr<(int,unsigned short)>(int const,int const,int const,int const [],int const [],unsigned short const [],int [],int [],unsigned short [])\n"" coo_tocsr<(int,int)>(int const,int const,int const,int const [],int const [],int const [],int [],int [],int [])\n"" coo_tocsr<(int,unsigned int)>(int const,int const,int const,int const [],int const [],unsigned int const [],int [],int [],unsigned int [])\n"" coo_tocsr<(int,long long)>(int const,int const,int const,int const [],int const [],long long const [],int [],int [],long long [])\n"" coo_tocsr<(int,unsigned long long)>(int const,int const,int const,int const [],int const [],unsigned long long const [],int [],int [],unsigned long long [])\n"" coo_tocsr<(int,float)>(int const,int const,int const,int const [],int const [],float const [],int [],int [],float [])\n"" coo_tocsr<(int,double)>(int const,int const,int const,int const [],int const [],double const [],int [],int [],double [])\n"" coo_tocsr<(int,long double)>(int const,int const,int const,int const [],int const [],long double const [],int [],int [],long double [])\n"" coo_tocsr<(int,npy_cfloat_wrapper)>(int const,int const,int const,int const [],int const [],npy_cfloat_wrapper const [],int [],int [],npy_cfloat_wrapper [])\n"" coo_tocsr<(int,npy_cdouble_wrapper)>(int const,int const,int const,int const [],int const [],npy_cdouble_wrapper const [],int [],int [],npy_cdouble_wrapper [])\n"" coo_tocsr<(int,npy_clongdouble_wrapper)>(int const,int const,int const,int const [],int const [],npy_clongdouble_wrapper const [],int [],int [],npy_clongdouble_wrapper [])\n"); + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'coo_tocsr'.\n" + " Possible C/C++ prototypes are:\n" + " coo_tocsr< int,signed char >(int const,int const,int const,int const [],int const [],signed char const [],int [],int [],signed char [])\n" + " coo_tocsr< int,unsigned char >(int const,int const,int const,int const [],int const [],unsigned char const [],int [],int [],unsigned char [])\n" + " coo_tocsr< int,short >(int const,int const,int const,int const [],int const [],short const [],int [],int [],short [])\n" + " coo_tocsr< int,unsigned short >(int const,int const,int const,int const [],int const [],unsigned short const [],int [],int [],unsigned short [])\n" + " coo_tocsr< int,int >(int const,int const,int const,int const [],int const [],int const [],int [],int [],int [])\n" + " coo_tocsr< int,unsigned int >(int const,int const,int const,int const [],int const [],unsigned int const [],int [],int [],unsigned int [])\n" + " coo_tocsr< int,long long >(int const,int const,int const,int const [],int const [],long long const [],int [],int [],long long [])\n" + " coo_tocsr< int,unsigned long long >(int const,int const,int const,int const [],int const [],unsigned long long const [],int [],int [],unsigned long long [])\n" + " coo_tocsr< int,float >(int const,int const,int const,int const [],int const [],float const [],int [],int [],float [])\n" + " coo_tocsr< int,double >(int const,int const,int const,int const [],int const [],double const [],int [],int [],double [])\n" + " coo_tocsr< int,long double >(int const,int const,int const,int const [],int const [],long double const [],int [],int [],long double [])\n" + " coo_tocsr< int,npy_cfloat_wrapper >(int const,int const,int const,int const [],int const [],npy_cfloat_wrapper const [],int [],int [],npy_cfloat_wrapper [])\n" + " coo_tocsr< int,npy_cdouble_wrapper >(int const,int const,int const,int const [],int const [],npy_cdouble_wrapper const [],int [],int [],npy_cdouble_wrapper [])\n" + " coo_tocsr< int,npy_clongdouble_wrapper >(int const,int const,int const,int const [],int const [],npy_clongdouble_wrapper const [],int [],int [],npy_clongdouble_wrapper [])\n"); return NULL; } @@ -27417,7 +27600,7 @@ if (!temp9 || !require_contiguous(temp9) || !require_native(temp9)) SWIG_fail; arg9 = (signed char*) array_data(temp9); } - coo_tocsc(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(signed char const (*))arg6,arg7,arg8,arg9); + coo_tocsc< int,signed char >(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(signed char const (*))arg6,arg7,arg8,arg9); resultobj = SWIG_Py_Void(); { if (is_new_object4 && array4) Py_DECREF(array4); @@ -27540,7 +27723,7 @@ if (!temp9 || !require_contiguous(temp9) || !require_native(temp9)) SWIG_fail; arg9 = (unsigned char*) array_data(temp9); } - coo_tocsc(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(unsigned char const (*))arg6,arg7,arg8,arg9); + coo_tocsc< int,unsigned char >(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(unsigned char const (*))arg6,arg7,arg8,arg9); resultobj = SWIG_Py_Void(); { if (is_new_object4 && array4) Py_DECREF(array4); @@ -27663,7 +27846,7 @@ if (!temp9 || !require_contiguous(temp9) || !require_native(temp9)) SWIG_fail; arg9 = (short*) array_data(temp9); } - coo_tocsc(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(short const (*))arg6,arg7,arg8,arg9); + coo_tocsc< int,short >(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(short const (*))arg6,arg7,arg8,arg9); resultobj = SWIG_Py_Void(); { if (is_new_object4 && array4) Py_DECREF(array4); @@ -27786,7 +27969,7 @@ if (!temp9 || !require_contiguous(temp9) || !require_native(temp9)) SWIG_fail; arg9 = (unsigned short*) array_data(temp9); } - coo_tocsc(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(unsigned short const (*))arg6,arg7,arg8,arg9); + coo_tocsc< int,unsigned short >(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(unsigned short const (*))arg6,arg7,arg8,arg9); resultobj = SWIG_Py_Void(); { if (is_new_object4 && array4) Py_DECREF(array4); @@ -27909,7 +28092,7 @@ if (!temp9 || !require_contiguous(temp9) || !require_native(temp9)) SWIG_fail; arg9 = (int*) array_data(temp9); } - coo_tocsc(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(int const (*))arg6,arg7,arg8,arg9); + coo_tocsc< int,int >(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(int const (*))arg6,arg7,arg8,arg9); resultobj = SWIG_Py_Void(); { if (is_new_object4 && array4) Py_DECREF(array4); @@ -28032,7 +28215,7 @@ if (!temp9 || !require_contiguous(temp9) || !require_native(temp9)) SWIG_fail; arg9 = (unsigned int*) array_data(temp9); } - coo_tocsc(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(unsigned int const (*))arg6,arg7,arg8,arg9); + coo_tocsc< int,unsigned int >(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(unsigned int const (*))arg6,arg7,arg8,arg9); resultobj = SWIG_Py_Void(); { if (is_new_object4 && array4) Py_DECREF(array4); @@ -28155,7 +28338,7 @@ if (!temp9 || !require_contiguous(temp9) || !require_native(temp9)) SWIG_fail; arg9 = (long long*) array_data(temp9); } - coo_tocsc(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(long long const (*))arg6,arg7,arg8,arg9); + coo_tocsc< int,long long >(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(long long const (*))arg6,arg7,arg8,arg9); resultobj = SWIG_Py_Void(); { if (is_new_object4 && array4) Py_DECREF(array4); @@ -28278,7 +28461,7 @@ if (!temp9 || !require_contiguous(temp9) || !require_native(temp9)) SWIG_fail; arg9 = (unsigned long long*) array_data(temp9); } - coo_tocsc(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(unsigned long long const (*))arg6,arg7,arg8,arg9); + coo_tocsc< int,unsigned long long >(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(unsigned long long const (*))arg6,arg7,arg8,arg9); resultobj = SWIG_Py_Void(); { if (is_new_object4 && array4) Py_DECREF(array4); @@ -28401,7 +28584,7 @@ if (!temp9 || !require_contiguous(temp9) || !require_native(temp9)) SWIG_fail; arg9 = (float*) array_data(temp9); } - coo_tocsc(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(float const (*))arg6,arg7,arg8,arg9); + coo_tocsc< int,float >(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(float const (*))arg6,arg7,arg8,arg9); resultobj = SWIG_Py_Void(); { if (is_new_object4 && array4) Py_DECREF(array4); @@ -28524,7 +28707,7 @@ if (!temp9 || !require_contiguous(temp9) || !require_native(temp9)) SWIG_fail; arg9 = (double*) array_data(temp9); } - coo_tocsc(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(double const (*))arg6,arg7,arg8,arg9); + coo_tocsc< int,double >(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(double const (*))arg6,arg7,arg8,arg9); resultobj = SWIG_Py_Void(); { if (is_new_object4 && array4) Py_DECREF(array4); @@ -28647,7 +28830,7 @@ if (!temp9 || !require_contiguous(temp9) || !require_native(temp9)) SWIG_fail; arg9 = (long double*) array_data(temp9); } - coo_tocsc(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(long double const (*))arg6,arg7,arg8,arg9); + coo_tocsc< int,long double >(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(long double const (*))arg6,arg7,arg8,arg9); resultobj = SWIG_Py_Void(); { if (is_new_object4 && array4) Py_DECREF(array4); @@ -28770,7 +28953,7 @@ if (!temp9 || !require_contiguous(temp9) || !require_native(temp9)) SWIG_fail; arg9 = (npy_cfloat_wrapper*) array_data(temp9); } - coo_tocsc(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(npy_cfloat_wrapper const (*))arg6,arg7,arg8,arg9); + coo_tocsc< int,npy_cfloat_wrapper >(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(npy_cfloat_wrapper const (*))arg6,arg7,arg8,arg9); resultobj = SWIG_Py_Void(); { if (is_new_object4 && array4) Py_DECREF(array4); @@ -28893,7 +29076,7 @@ if (!temp9 || !require_contiguous(temp9) || !require_native(temp9)) SWIG_fail; arg9 = (npy_cdouble_wrapper*) array_data(temp9); } - coo_tocsc(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(npy_cdouble_wrapper const (*))arg6,arg7,arg8,arg9); + coo_tocsc< int,npy_cdouble_wrapper >(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(npy_cdouble_wrapper const (*))arg6,arg7,arg8,arg9); resultobj = SWIG_Py_Void(); { if (is_new_object4 && array4) Py_DECREF(array4); @@ -29016,7 +29199,7 @@ if (!temp9 || !require_contiguous(temp9) || !require_native(temp9)) SWIG_fail; arg9 = (npy_clongdouble_wrapper*) array_data(temp9); } - coo_tocsc(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(npy_clongdouble_wrapper const (*))arg6,arg7,arg8,arg9); + coo_tocsc< int,npy_clongdouble_wrapper >(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(npy_clongdouble_wrapper const (*))arg6,arg7,arg8,arg9); resultobj = SWIG_Py_Void(); { if (is_new_object4 && array4) Py_DECREF(array4); @@ -29782,7 +29965,22 @@ } fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'coo_tocsc'.\n Possible C/C++ prototypes are:\n"" coo_tocsc<(int,signed char)>(int const,int const,int const,int const [],int const [],signed char const [],int [],int [],signed char [])\n"" coo_tocsc<(int,unsigned char)>(int const,int const,int const,int const [],int const [],unsigned char const [],int [],int [],unsigned char [])\n"" coo_tocsc<(int,short)>(int const,int const,int const,int const [],int const [],short const [],int [],int [],short [])\n"" coo_tocsc<(int,unsigned short)>(int const,int const,int const,int const [],int const [],unsigned short const [],int [],int [],unsigned short [])\n"" coo_tocsc<(int,int)>(int const,int const,int const,int const [],int const [],int const [],int [],int [],int [])\n"" coo_tocsc<(int,unsigned int)>(int const,int const,int const,int const [],int const [],unsigned int const [],int [],int [],unsigned int [])\n"" coo_tocsc<(int,long long)>(int const,int const,int const,int const [],int const [],long long const [],int [],int [],long long [])\n"" coo_tocsc<(int,unsigned long long)>(int const,int const,int const,int const [],int const [],unsigned long long const [],int [],int [],unsigned long long [])\n"" coo_tocsc<(int,float)>(int const,int const,int const,int const [],int const [],float const [],int [],int [],float [])\n"" coo_tocsc<(int,double)>(int const,int const,int const,int const [],int const [],double const [],int [],int [],double [])\n"" coo_tocsc<(int,long double)>(int const,int const,int const,int const [],int const [],long double const [],int [],int [],long double [])\n"" coo_tocsc<(int,npy_cfloat_wrapper)>(int const,int const,int const,int const [],int const [],npy_cfloat_wrapper const [],int [],int [],npy_cfloat_wrapper [])\n"" coo_tocsc<(int,npy_cdouble_wrapper)>(int const,int const,int const,int const [],int const [],npy_cdouble_wrapper const [],int [],int [],npy_cdouble_wrapper [])\n"" coo_tocsc<(int,npy_clongdouble_wrapper)>(int const,int const,int const,int const [],int const [],npy_clongdouble_wrapper const [],int [],int [],npy_clongdouble_wrapper [])\n"); + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'coo_tocsc'.\n" + " Possible C/C++ prototypes are:\n" + " coo_tocsc< int,signed char >(int const,int const,int const,int const [],int const [],signed char const [],int [],int [],signed char [])\n" + " coo_tocsc< int,unsigned char >(int const,int const,int const,int const [],int const [],unsigned char const [],int [],int [],unsigned char [])\n" + " coo_tocsc< int,short >(int const,int const,int const,int const [],int const [],short const [],int [],int [],short [])\n" + " coo_tocsc< int,unsigned short >(int const,int const,int const,int const [],int const [],unsigned short const [],int [],int [],unsigned short [])\n" + " coo_tocsc< int,int >(int const,int const,int const,int const [],int const [],int const [],int [],int [],int [])\n" + " coo_tocsc< int,unsigned int >(int const,int const,int const,int const [],int const [],unsigned int const [],int [],int [],unsigned int [])\n" + " coo_tocsc< int,long long >(int const,int const,int const,int const [],int const [],long long const [],int [],int [],long long [])\n" + " coo_tocsc< int,unsigned long long >(int const,int const,int const,int const [],int const [],unsigned long long const [],int [],int [],unsigned long long [])\n" + " coo_tocsc< int,float >(int const,int const,int const,int const [],int const [],float const [],int [],int [],float [])\n" + " coo_tocsc< int,double >(int const,int const,int const,int const [],int const [],double const [],int [],int [],double [])\n" + " coo_tocsc< int,long double >(int const,int const,int const,int const [],int const [],long double const [],int [],int [],long double [])\n" + " coo_tocsc< int,npy_cfloat_wrapper >(int const,int const,int const,int const [],int const [],npy_cfloat_wrapper const [],int [],int [],npy_cfloat_wrapper [])\n" + " coo_tocsc< int,npy_cdouble_wrapper >(int const,int const,int const,int const [],int const [],npy_cdouble_wrapper const [],int [],int [],npy_cdouble_wrapper [])\n" + " coo_tocsc< int,npy_clongdouble_wrapper >(int const,int const,int const,int const [],int const [],npy_clongdouble_wrapper const [],int [],int [],npy_clongdouble_wrapper [])\n"); return NULL; } @@ -29856,7 +30054,7 @@ arg6 = (int*) array6->data; } - result = (int)csr_count_blocks(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6); + result = (int)csr_count_blocks< int >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6); resultobj = SWIG_From_int(static_cast< int >(result)); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -29962,7 +30160,7 @@ if (!temp7 || !require_contiguous(temp7) || !require_native(temp7)) SWIG_fail; arg7 = (int*) array_data(temp7); } - csr_matmat_pass1(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(int const (*))arg5,(int const (*))arg6,arg7); + csr_matmat_pass1< int >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(int const (*))arg5,(int const (*))arg6,arg7); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -30080,7 +30278,7 @@ if (!temp7 || !require_contiguous(temp7) || !require_native(temp7)) SWIG_fail; arg7 = (int*) array_data(temp7); } - csc_matmat_pass1(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(int const (*))arg5,(int const (*))arg6,arg7); + csc_matmat_pass1< int >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(int const (*))arg5,(int const (*))arg6,arg7); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -30242,7 +30440,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (signed char*) array_data(temp11); } - csr_matmat_pass2(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(signed char const (*))arg5,(int const (*))arg6,(int const (*))arg7,(signed char const (*))arg8,arg9,arg10,arg11); + csr_matmat_pass2< int,signed char >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(signed char const (*))arg5,(int const (*))arg6,(int const (*))arg7,(signed char const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -30416,7 +30614,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (unsigned char*) array_data(temp11); } - csr_matmat_pass2(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned char const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned char const (*))arg8,arg9,arg10,arg11); + csr_matmat_pass2< int,unsigned char >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned char const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned char const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -30590,7 +30788,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (short*) array_data(temp11); } - csr_matmat_pass2(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(short const (*))arg5,(int const (*))arg6,(int const (*))arg7,(short const (*))arg8,arg9,arg10,arg11); + csr_matmat_pass2< int,short >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(short const (*))arg5,(int const (*))arg6,(int const (*))arg7,(short const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -30764,7 +30962,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (unsigned short*) array_data(temp11); } - csr_matmat_pass2(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned short const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned short const (*))arg8,arg9,arg10,arg11); + csr_matmat_pass2< int,unsigned short >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned short const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned short const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -30938,7 +31136,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (int*) array_data(temp11); } - csr_matmat_pass2(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(int const (*))arg5,(int const (*))arg6,(int const (*))arg7,(int const (*))arg8,arg9,arg10,arg11); + csr_matmat_pass2< int,int >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(int const (*))arg5,(int const (*))arg6,(int const (*))arg7,(int const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -31112,7 +31310,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (unsigned int*) array_data(temp11); } - csr_matmat_pass2(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned int const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned int const (*))arg8,arg9,arg10,arg11); + csr_matmat_pass2< int,unsigned int >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned int const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned int const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -31286,7 +31484,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (long long*) array_data(temp11); } - csr_matmat_pass2(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long long const (*))arg5,(int const (*))arg6,(int const (*))arg7,(long long const (*))arg8,arg9,arg10,arg11); + csr_matmat_pass2< int,long long >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long long const (*))arg5,(int const (*))arg6,(int const (*))arg7,(long long const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -31460,7 +31658,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (unsigned long long*) array_data(temp11); } - csr_matmat_pass2(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned long long const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned long long const (*))arg8,arg9,arg10,arg11); + csr_matmat_pass2< int,unsigned long long >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned long long const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned long long const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -31634,7 +31832,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (float*) array_data(temp11); } - csr_matmat_pass2(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(float const (*))arg5,(int const (*))arg6,(int const (*))arg7,(float const (*))arg8,arg9,arg10,arg11); + csr_matmat_pass2< int,float >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(float const (*))arg5,(int const (*))arg6,(int const (*))arg7,(float const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -31808,7 +32006,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (double*) array_data(temp11); } - csr_matmat_pass2(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(double const (*))arg5,(int const (*))arg6,(int const (*))arg7,(double const (*))arg8,arg9,arg10,arg11); + csr_matmat_pass2< int,double >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(double const (*))arg5,(int const (*))arg6,(int const (*))arg7,(double const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -31982,7 +32180,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (long double*) array_data(temp11); } - csr_matmat_pass2(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long double const (*))arg5,(int const (*))arg6,(int const (*))arg7,(long double const (*))arg8,arg9,arg10,arg11); + csr_matmat_pass2< int,long double >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long double const (*))arg5,(int const (*))arg6,(int const (*))arg7,(long double const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -32156,7 +32354,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (npy_cfloat_wrapper*) array_data(temp11); } - csr_matmat_pass2(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cfloat_wrapper const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_cfloat_wrapper const (*))arg8,arg9,arg10,arg11); + csr_matmat_pass2< int,npy_cfloat_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cfloat_wrapper const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_cfloat_wrapper const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -32330,7 +32528,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (npy_cdouble_wrapper*) array_data(temp11); } - csr_matmat_pass2(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cdouble_wrapper const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_cdouble_wrapper const (*))arg8,arg9,arg10,arg11); + csr_matmat_pass2< int,npy_cdouble_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cdouble_wrapper const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_cdouble_wrapper const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -32504,7 +32702,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (npy_clongdouble_wrapper*) array_data(temp11); } - csr_matmat_pass2(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_clongdouble_wrapper const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_clongdouble_wrapper const (*))arg8,arg9,arg10,arg11); + csr_matmat_pass2< int,npy_clongdouble_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_clongdouble_wrapper const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_clongdouble_wrapper const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -33414,7 +33612,22 @@ } fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'csr_matmat_pass2'.\n Possible C/C++ prototypes are:\n"" csr_matmat_pass2<(int,signed char)>(int const,int const,int const [],int const [],signed char const [],int const [],int const [],signed char const [],int [],int [],signed char [])\n"" csr_matmat_pass2<(int,unsigned char)>(int const,int const,int const [],int const [],unsigned char const [],int const [],int const [],unsigned char const [],int [],int [],unsigned char [])\n"" csr_matmat_pass2<(int,short)>(int const,int const,int const [],int const [],short const [],int const [],int const [],short const [],int [],int [],short [])\n"" csr_matmat_pass2<(int,unsigned short)>(int const,int const,int const [],int const [],unsigned short const [],int const [],int const [],unsigned short const [],int [],int [],unsigned short [])\n"" csr_matmat_pass2<(int,int)>(int const,int const,int const [],int const [],int const [],int const [],int const [],int const [],int [],int [],int [])\n"" csr_matmat_pass2<(int,unsigned int)>(int const,int const,int const [],int const [],unsigned int const [],int const [],int const [],unsigned int const [],int [],int [],unsigned int [])\n"" csr_matmat_pass2<(int,long long)>(int const,int const,int const [],int const [],long long const [],int const [],int const [],long long const [],int [],int [],long long [])\n"" csr_matmat_pass2<(int,unsigned long long)>(int const,int const,int const [],int const [],unsigned long long const [],int const [],int const [],unsigned long long const [],int [],int [],unsigned long long [])\n"" csr_matmat_pass2<(int,float)>(int const,int const,int const [],int const [],float const [],int const [],int const [],float const [],int [],int [],float [])\n"" csr_matmat_pass2<(int,double)>(int const,int const,int const [],int const [],double const [],int const [],int const [],double const [],int [],int [],double [])\n"" csr_matmat_pass2<(int,long double)>(int const,int const,int const [],int const [],long double const [],int const [],int const [],long double const [],int [],int [],long double [])\n"" csr_matmat_pass2<(int,npy_cfloat_wrapper)>(int const,int const,int const [],int const [],npy_cfloat_wrapper const [],int const [],int const [],npy_cfloat_wrapper const [],int [],int [],npy_cfloat_wrapper [])\n"" csr_matmat_pass2<(int,npy_cdouble_wrapper)>(int const,int const,int const [],int const [],npy_cdouble_wrapper const [],int const [],int const [],npy_cdouble_wrapper const [],int [],int [],npy_cdouble_wrapper [])\n"" csr_matmat_pass2<(int,npy_clongdouble_wrapper)>(int const,int const,int const [],int const [],npy_clongdouble_wrapper const [],int const [],int const [],npy_clongdouble_wrapper const [],int [],int [],npy_clongdouble_wrapper [])\n"); + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'csr_matmat_pass2'.\n" + " Possible C/C++ prototypes are:\n" + " csr_matmat_pass2< int,signed char >(int const,int const,int const [],int const [],signed char const [],int const [],int const [],signed char const [],int [],int [],signed char [])\n" + " csr_matmat_pass2< int,unsigned char >(int const,int const,int const [],int const [],unsigned char const [],int const [],int const [],unsigned char const [],int [],int [],unsigned char [])\n" + " csr_matmat_pass2< int,short >(int const,int const,int const [],int const [],short const [],int const [],int const [],short const [],int [],int [],short [])\n" + " csr_matmat_pass2< int,unsigned short >(int const,int const,int const [],int const [],unsigned short const [],int const [],int const [],unsigned short const [],int [],int [],unsigned short [])\n" + " csr_matmat_pass2< int,int >(int const,int const,int const [],int const [],int const [],int const [],int const [],int const [],int [],int [],int [])\n" + " csr_matmat_pass2< int,unsigned int >(int const,int const,int const [],int const [],unsigned int const [],int const [],int const [],unsigned int const [],int [],int [],unsigned int [])\n" + " csr_matmat_pass2< int,long long >(int const,int const,int const [],int const [],long long const [],int const [],int const [],long long const [],int [],int [],long long [])\n" + " csr_matmat_pass2< int,unsigned long long >(int const,int const,int const [],int const [],unsigned long long const [],int const [],int const [],unsigned long long const [],int [],int [],unsigned long long [])\n" + " csr_matmat_pass2< int,float >(int const,int const,int const [],int const [],float const [],int const [],int const [],float const [],int [],int [],float [])\n" + " csr_matmat_pass2< int,double >(int const,int const,int const [],int const [],double const [],int const [],int const [],double const [],int [],int [],double [])\n" + " csr_matmat_pass2< int,long double >(int const,int const,int const [],int const [],long double const [],int const [],int const [],long double const [],int [],int [],long double [])\n" + " csr_matmat_pass2< int,npy_cfloat_wrapper >(int const,int const,int const [],int const [],npy_cfloat_wrapper const [],int const [],int const [],npy_cfloat_wrapper const [],int [],int [],npy_cfloat_wrapper [])\n" + " csr_matmat_pass2< int,npy_cdouble_wrapper >(int const,int const,int const [],int const [],npy_cdouble_wrapper const [],int const [],int const [],npy_cdouble_wrapper const [],int [],int [],npy_cdouble_wrapper [])\n" + " csr_matmat_pass2< int,npy_clongdouble_wrapper >(int const,int const,int const [],int const [],npy_clongdouble_wrapper const [],int const [],int const [],npy_clongdouble_wrapper const [],int [],int [],npy_clongdouble_wrapper [])\n"); return NULL; } @@ -33549,7 +33762,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (signed char*) array_data(temp11); } - csc_matmat_pass2(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(signed char const (*))arg5,(int const (*))arg6,(int const (*))arg7,(signed char const (*))arg8,arg9,arg10,arg11); + csc_matmat_pass2< int,signed char >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(signed char const (*))arg5,(int const (*))arg6,(int const (*))arg7,(signed char const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -33723,7 +33936,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (unsigned char*) array_data(temp11); } - csc_matmat_pass2(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned char const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned char const (*))arg8,arg9,arg10,arg11); + csc_matmat_pass2< int,unsigned char >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned char const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned char const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -33897,7 +34110,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (short*) array_data(temp11); } - csc_matmat_pass2(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(short const (*))arg5,(int const (*))arg6,(int const (*))arg7,(short const (*))arg8,arg9,arg10,arg11); + csc_matmat_pass2< int,short >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(short const (*))arg5,(int const (*))arg6,(int const (*))arg7,(short const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -34071,7 +34284,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (unsigned short*) array_data(temp11); } - csc_matmat_pass2(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned short const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned short const (*))arg8,arg9,arg10,arg11); + csc_matmat_pass2< int,unsigned short >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned short const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned short const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -34245,7 +34458,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (int*) array_data(temp11); } - csc_matmat_pass2(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(int const (*))arg5,(int const (*))arg6,(int const (*))arg7,(int const (*))arg8,arg9,arg10,arg11); + csc_matmat_pass2< int,int >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(int const (*))arg5,(int const (*))arg6,(int const (*))arg7,(int const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -34419,7 +34632,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (unsigned int*) array_data(temp11); } - csc_matmat_pass2(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned int const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned int const (*))arg8,arg9,arg10,arg11); + csc_matmat_pass2< int,unsigned int >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned int const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned int const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -34593,7 +34806,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (long long*) array_data(temp11); } - csc_matmat_pass2(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long long const (*))arg5,(int const (*))arg6,(int const (*))arg7,(long long const (*))arg8,arg9,arg10,arg11); + csc_matmat_pass2< int,long long >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long long const (*))arg5,(int const (*))arg6,(int const (*))arg7,(long long const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -34767,7 +34980,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (unsigned long long*) array_data(temp11); } - csc_matmat_pass2(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned long long const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned long long const (*))arg8,arg9,arg10,arg11); + csc_matmat_pass2< int,unsigned long long >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned long long const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned long long const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -34941,7 +35154,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (float*) array_data(temp11); } - csc_matmat_pass2(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(float const (*))arg5,(int const (*))arg6,(int const (*))arg7,(float const (*))arg8,arg9,arg10,arg11); + csc_matmat_pass2< int,float >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(float const (*))arg5,(int const (*))arg6,(int const (*))arg7,(float const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -35115,7 +35328,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (double*) array_data(temp11); } - csc_matmat_pass2(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(double const (*))arg5,(int const (*))arg6,(int const (*))arg7,(double const (*))arg8,arg9,arg10,arg11); + csc_matmat_pass2< int,double >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(double const (*))arg5,(int const (*))arg6,(int const (*))arg7,(double const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -35289,7 +35502,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (long double*) array_data(temp11); } - csc_matmat_pass2(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long double const (*))arg5,(int const (*))arg6,(int const (*))arg7,(long double const (*))arg8,arg9,arg10,arg11); + csc_matmat_pass2< int,long double >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long double const (*))arg5,(int const (*))arg6,(int const (*))arg7,(long double const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -35463,7 +35676,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (npy_cfloat_wrapper*) array_data(temp11); } - csc_matmat_pass2(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cfloat_wrapper const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_cfloat_wrapper const (*))arg8,arg9,arg10,arg11); + csc_matmat_pass2< int,npy_cfloat_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cfloat_wrapper const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_cfloat_wrapper const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -35637,7 +35850,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (npy_cdouble_wrapper*) array_data(temp11); } - csc_matmat_pass2(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cdouble_wrapper const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_cdouble_wrapper const (*))arg8,arg9,arg10,arg11); + csc_matmat_pass2< int,npy_cdouble_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cdouble_wrapper const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_cdouble_wrapper const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -35811,7 +36024,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (npy_clongdouble_wrapper*) array_data(temp11); } - csc_matmat_pass2(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_clongdouble_wrapper const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_clongdouble_wrapper const (*))arg8,arg9,arg10,arg11); + csc_matmat_pass2< int,npy_clongdouble_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_clongdouble_wrapper const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_clongdouble_wrapper const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -36721,7 +36934,22 @@ } fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'csc_matmat_pass2'.\n Possible C/C++ prototypes are:\n"" csc_matmat_pass2<(int,signed char)>(int const,int const,int const [],int const [],signed char const [],int const [],int const [],signed char const [],int [],int [],signed char [])\n"" csc_matmat_pass2<(int,unsigned char)>(int const,int const,int const [],int const [],unsigned char const [],int const [],int const [],unsigned char const [],int [],int [],unsigned char [])\n"" csc_matmat_pass2<(int,short)>(int const,int const,int const [],int const [],short const [],int const [],int const [],short const [],int [],int [],short [])\n"" csc_matmat_pass2<(int,unsigned short)>(int const,int const,int const [],int const [],unsigned short const [],int const [],int const [],unsigned short const [],int [],int [],unsigned short [])\n"" csc_matmat_pass2<(int,int)>(int const,int const,int const [],int const [],int const [],int const [],int const [],int const [],int [],int [],int [])\n"" csc_matmat_pass2<(int,unsigned int)>(int const,int const,int const [],int const [],unsigned int const [],int const [],int const [],unsigned int const [],int [],int [],unsigned int [])\n"" csc_matmat_pass2<(int,long long)>(int const,int const,int const [],int const [],long long const [],int const [],int const [],long long const [],int [],int [],long long [])\n"" csc_matmat_pass2<(int,unsigned long long)>(int const,int const,int const [],int const [],unsigned long long const [],int const [],int const [],unsigned long long const [],int [],int [],unsigned long long [])\n"" csc_matmat_pass2<(int,float)>(int const,int const,int const [],int const [],float const [],int const [],int const [],float const [],int [],int [],float [])\n"" csc_matmat_pass2<(int,double)>(int const,int const,int const [],int const [],double const [],int const [],int const [],double const [],int [],int [],double [])\n"" csc_matmat_pass2<(int,long double)>(int const,int const,int const [],int const [],long double const [],int const [],int const [],long double const [],int [],int [],long double [])\n"" csc_matmat_pass2<(int,npy_cfloat_wrapper)>(int const,int const,int const [],int const [],npy_cfloat_wrapper const [],int const [],int const [],npy_cfloat_wrapper const [],int [],int [],npy_cfloat_wrapper [])\n"" csc_matmat_pass2<(int,npy_cdouble_wrapper)>(int const,int const,int const [],int const [],npy_cdouble_wrapper const [],int const [],int const [],npy_cdouble_wrapper const [],int [],int [],npy_cdouble_wrapper [])\n"" csc_matmat_pass2<(int,npy_clongdouble_wrapper)>(int const,int const,int const [],int const [],npy_clongdouble_wrapper const [],int const [],int const [],npy_clongdouble_wrapper const [],int [],int [],npy_clongdouble_wrapper [])\n"); + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'csc_matmat_pass2'.\n" + " Possible C/C++ prototypes are:\n" + " csc_matmat_pass2< int,signed char >(int const,int const,int const [],int const [],signed char const [],int const [],int const [],signed char const [],int [],int [],signed char [])\n" + " csc_matmat_pass2< int,unsigned char >(int const,int const,int const [],int const [],unsigned char const [],int const [],int const [],unsigned char const [],int [],int [],unsigned char [])\n" + " csc_matmat_pass2< int,short >(int const,int const,int const [],int const [],short const [],int const [],int const [],short const [],int [],int [],short [])\n" + " csc_matmat_pass2< int,unsigned short >(int const,int const,int const [],int const [],unsigned short const [],int const [],int const [],unsigned short const [],int [],int [],unsigned short [])\n" + " csc_matmat_pass2< int,int >(int const,int const,int const [],int const [],int const [],int const [],int const [],int const [],int [],int [],int [])\n" + " csc_matmat_pass2< int,unsigned int >(int const,int const,int const [],int const [],unsigned int const [],int const [],int const [],unsigned int const [],int [],int [],unsigned int [])\n" + " csc_matmat_pass2< int,long long >(int const,int const,int const [],int const [],long long const [],int const [],int const [],long long const [],int [],int [],long long [])\n" + " csc_matmat_pass2< int,unsigned long long >(int const,int const,int const [],int const [],unsigned long long const [],int const [],int const [],unsigned long long const [],int [],int [],unsigned long long [])\n" + " csc_matmat_pass2< int,float >(int const,int const,int const [],int const [],float const [],int const [],int const [],float const [],int [],int [],float [])\n" + " csc_matmat_pass2< int,double >(int const,int const,int const [],int const [],double const [],int const [],int const [],double const [],int [],int [],double [])\n" + " csc_matmat_pass2< int,long double >(int const,int const,int const [],int const [],long double const [],int const [],int const [],long double const [],int [],int [],long double [])\n" + " csc_matmat_pass2< int,npy_cfloat_wrapper >(int const,int const,int const [],int const [],npy_cfloat_wrapper const [],int const [],int const [],npy_cfloat_wrapper const [],int [],int [],npy_cfloat_wrapper [])\n" + " csc_matmat_pass2< int,npy_cdouble_wrapper >(int const,int const,int const [],int const [],npy_cdouble_wrapper const [],int const [],int const [],npy_cdouble_wrapper const [],int [],int [],npy_cdouble_wrapper [])\n" + " csc_matmat_pass2< int,npy_clongdouble_wrapper >(int const,int const,int const [],int const [],npy_clongdouble_wrapper const [],int const [],int const [],npy_clongdouble_wrapper const [],int [],int [],npy_clongdouble_wrapper [])\n"); return NULL; } @@ -36883,7 +37111,7 @@ if (!temp14 || !require_contiguous(temp14) || !require_native(temp14)) SWIG_fail; arg14 = (signed char*) array_data(temp14); } - bsr_matmat_pass2(arg1,arg2,arg3,arg4,arg5,(int const (*))arg6,(int const (*))arg7,(signed char const (*))arg8,(int const (*))arg9,(int const (*))arg10,(signed char const (*))arg11,arg12,arg13,arg14); + bsr_matmat_pass2< int,signed char >(arg1,arg2,arg3,arg4,arg5,(int const (*))arg6,(int const (*))arg7,(signed char const (*))arg8,(int const (*))arg9,(int const (*))arg10,(signed char const (*))arg11,arg12,arg13,arg14); resultobj = SWIG_Py_Void(); { if (is_new_object6 && array6) Py_DECREF(array6); @@ -37084,7 +37312,7 @@ if (!temp14 || !require_contiguous(temp14) || !require_native(temp14)) SWIG_fail; arg14 = (unsigned char*) array_data(temp14); } - bsr_matmat_pass2(arg1,arg2,arg3,arg4,arg5,(int const (*))arg6,(int const (*))arg7,(unsigned char const (*))arg8,(int const (*))arg9,(int const (*))arg10,(unsigned char const (*))arg11,arg12,arg13,arg14); + bsr_matmat_pass2< int,unsigned char >(arg1,arg2,arg3,arg4,arg5,(int const (*))arg6,(int const (*))arg7,(unsigned char const (*))arg8,(int const (*))arg9,(int const (*))arg10,(unsigned char const (*))arg11,arg12,arg13,arg14); resultobj = SWIG_Py_Void(); { if (is_new_object6 && array6) Py_DECREF(array6); @@ -37285,7 +37513,7 @@ if (!temp14 || !require_contiguous(temp14) || !require_native(temp14)) SWIG_fail; arg14 = (short*) array_data(temp14); } - bsr_matmat_pass2(arg1,arg2,arg3,arg4,arg5,(int const (*))arg6,(int const (*))arg7,(short const (*))arg8,(int const (*))arg9,(int const (*))arg10,(short const (*))arg11,arg12,arg13,arg14); + bsr_matmat_pass2< int,short >(arg1,arg2,arg3,arg4,arg5,(int const (*))arg6,(int const (*))arg7,(short const (*))arg8,(int const (*))arg9,(int const (*))arg10,(short const (*))arg11,arg12,arg13,arg14); resultobj = SWIG_Py_Void(); { if (is_new_object6 && array6) Py_DECREF(array6); @@ -37486,7 +37714,7 @@ if (!temp14 || !require_contiguous(temp14) || !require_native(temp14)) SWIG_fail; arg14 = (unsigned short*) array_data(temp14); } - bsr_matmat_pass2(arg1,arg2,arg3,arg4,arg5,(int const (*))arg6,(int const (*))arg7,(unsigned short const (*))arg8,(int const (*))arg9,(int const (*))arg10,(unsigned short const (*))arg11,arg12,arg13,arg14); + bsr_matmat_pass2< int,unsigned short >(arg1,arg2,arg3,arg4,arg5,(int const (*))arg6,(int const (*))arg7,(unsigned short const (*))arg8,(int const (*))arg9,(int const (*))arg10,(unsigned short const (*))arg11,arg12,arg13,arg14); resultobj = SWIG_Py_Void(); { if (is_new_object6 && array6) Py_DECREF(array6); @@ -37687,7 +37915,7 @@ if (!temp14 || !require_contiguous(temp14) || !require_native(temp14)) SWIG_fail; arg14 = (int*) array_data(temp14); } - bsr_matmat_pass2(arg1,arg2,arg3,arg4,arg5,(int const (*))arg6,(int const (*))arg7,(int const (*))arg8,(int const (*))arg9,(int const (*))arg10,(int const (*))arg11,arg12,arg13,arg14); + bsr_matmat_pass2< int,int >(arg1,arg2,arg3,arg4,arg5,(int const (*))arg6,(int const (*))arg7,(int const (*))arg8,(int const (*))arg9,(int const (*))arg10,(int const (*))arg11,arg12,arg13,arg14); resultobj = SWIG_Py_Void(); { if (is_new_object6 && array6) Py_DECREF(array6); @@ -37888,7 +38116,7 @@ if (!temp14 || !require_contiguous(temp14) || !require_native(temp14)) SWIG_fail; arg14 = (unsigned int*) array_data(temp14); } - bsr_matmat_pass2(arg1,arg2,arg3,arg4,arg5,(int const (*))arg6,(int const (*))arg7,(unsigned int const (*))arg8,(int const (*))arg9,(int const (*))arg10,(unsigned int const (*))arg11,arg12,arg13,arg14); + bsr_matmat_pass2< int,unsigned int >(arg1,arg2,arg3,arg4,arg5,(int const (*))arg6,(int const (*))arg7,(unsigned int const (*))arg8,(int const (*))arg9,(int const (*))arg10,(unsigned int const (*))arg11,arg12,arg13,arg14); resultobj = SWIG_Py_Void(); { if (is_new_object6 && array6) Py_DECREF(array6); @@ -38089,7 +38317,7 @@ if (!temp14 || !require_contiguous(temp14) || !require_native(temp14)) SWIG_fail; arg14 = (long long*) array_data(temp14); } - bsr_matmat_pass2(arg1,arg2,arg3,arg4,arg5,(int const (*))arg6,(int const (*))arg7,(long long const (*))arg8,(int const (*))arg9,(int const (*))arg10,(long long const (*))arg11,arg12,arg13,arg14); + bsr_matmat_pass2< int,long long >(arg1,arg2,arg3,arg4,arg5,(int const (*))arg6,(int const (*))arg7,(long long const (*))arg8,(int const (*))arg9,(int const (*))arg10,(long long const (*))arg11,arg12,arg13,arg14); resultobj = SWIG_Py_Void(); { if (is_new_object6 && array6) Py_DECREF(array6); @@ -38290,7 +38518,7 @@ if (!temp14 || !require_contiguous(temp14) || !require_native(temp14)) SWIG_fail; arg14 = (unsigned long long*) array_data(temp14); } - bsr_matmat_pass2(arg1,arg2,arg3,arg4,arg5,(int const (*))arg6,(int const (*))arg7,(unsigned long long const (*))arg8,(int const (*))arg9,(int const (*))arg10,(unsigned long long const (*))arg11,arg12,arg13,arg14); + bsr_matmat_pass2< int,unsigned long long >(arg1,arg2,arg3,arg4,arg5,(int const (*))arg6,(int const (*))arg7,(unsigned long long const (*))arg8,(int const (*))arg9,(int const (*))arg10,(unsigned long long const (*))arg11,arg12,arg13,arg14); resultobj = SWIG_Py_Void(); { if (is_new_object6 && array6) Py_DECREF(array6); @@ -38491,7 +38719,7 @@ if (!temp14 || !require_contiguous(temp14) || !require_native(temp14)) SWIG_fail; arg14 = (float*) array_data(temp14); } - bsr_matmat_pass2(arg1,arg2,arg3,arg4,arg5,(int const (*))arg6,(int const (*))arg7,(float const (*))arg8,(int const (*))arg9,(int const (*))arg10,(float const (*))arg11,arg12,arg13,arg14); + bsr_matmat_pass2< int,float >(arg1,arg2,arg3,arg4,arg5,(int const (*))arg6,(int const (*))arg7,(float const (*))arg8,(int const (*))arg9,(int const (*))arg10,(float const (*))arg11,arg12,arg13,arg14); resultobj = SWIG_Py_Void(); { if (is_new_object6 && array6) Py_DECREF(array6); @@ -38692,7 +38920,7 @@ if (!temp14 || !require_contiguous(temp14) || !require_native(temp14)) SWIG_fail; arg14 = (double*) array_data(temp14); } - bsr_matmat_pass2(arg1,arg2,arg3,arg4,arg5,(int const (*))arg6,(int const (*))arg7,(double const (*))arg8,(int const (*))arg9,(int const (*))arg10,(double const (*))arg11,arg12,arg13,arg14); + bsr_matmat_pass2< int,double >(arg1,arg2,arg3,arg4,arg5,(int const (*))arg6,(int const (*))arg7,(double const (*))arg8,(int const (*))arg9,(int const (*))arg10,(double const (*))arg11,arg12,arg13,arg14); resultobj = SWIG_Py_Void(); { if (is_new_object6 && array6) Py_DECREF(array6); @@ -38893,7 +39121,7 @@ if (!temp14 || !require_contiguous(temp14) || !require_native(temp14)) SWIG_fail; arg14 = (long double*) array_data(temp14); } - bsr_matmat_pass2(arg1,arg2,arg3,arg4,arg5,(int const (*))arg6,(int const (*))arg7,(long double const (*))arg8,(int const (*))arg9,(int const (*))arg10,(long double const (*))arg11,arg12,arg13,arg14); + bsr_matmat_pass2< int,long double >(arg1,arg2,arg3,arg4,arg5,(int const (*))arg6,(int const (*))arg7,(long double const (*))arg8,(int const (*))arg9,(int const (*))arg10,(long double const (*))arg11,arg12,arg13,arg14); resultobj = SWIG_Py_Void(); { if (is_new_object6 && array6) Py_DECREF(array6); @@ -39094,7 +39322,7 @@ if (!temp14 || !require_contiguous(temp14) || !require_native(temp14)) SWIG_fail; arg14 = (npy_cfloat_wrapper*) array_data(temp14); } - bsr_matmat_pass2(arg1,arg2,arg3,arg4,arg5,(int const (*))arg6,(int const (*))arg7,(npy_cfloat_wrapper const (*))arg8,(int const (*))arg9,(int const (*))arg10,(npy_cfloat_wrapper const (*))arg11,arg12,arg13,arg14); + bsr_matmat_pass2< int,npy_cfloat_wrapper >(arg1,arg2,arg3,arg4,arg5,(int const (*))arg6,(int const (*))arg7,(npy_cfloat_wrapper const (*))arg8,(int const (*))arg9,(int const (*))arg10,(npy_cfloat_wrapper const (*))arg11,arg12,arg13,arg14); resultobj = SWIG_Py_Void(); { if (is_new_object6 && array6) Py_DECREF(array6); @@ -39295,7 +39523,7 @@ if (!temp14 || !require_contiguous(temp14) || !require_native(temp14)) SWIG_fail; arg14 = (npy_cdouble_wrapper*) array_data(temp14); } - bsr_matmat_pass2(arg1,arg2,arg3,arg4,arg5,(int const (*))arg6,(int const (*))arg7,(npy_cdouble_wrapper const (*))arg8,(int const (*))arg9,(int const (*))arg10,(npy_cdouble_wrapper const (*))arg11,arg12,arg13,arg14); + bsr_matmat_pass2< int,npy_cdouble_wrapper >(arg1,arg2,arg3,arg4,arg5,(int const (*))arg6,(int const (*))arg7,(npy_cdouble_wrapper const (*))arg8,(int const (*))arg9,(int const (*))arg10,(npy_cdouble_wrapper const (*))arg11,arg12,arg13,arg14); resultobj = SWIG_Py_Void(); { if (is_new_object6 && array6) Py_DECREF(array6); @@ -39496,7 +39724,7 @@ if (!temp14 || !require_contiguous(temp14) || !require_native(temp14)) SWIG_fail; arg14 = (npy_clongdouble_wrapper*) array_data(temp14); } - bsr_matmat_pass2(arg1,arg2,arg3,arg4,arg5,(int const (*))arg6,(int const (*))arg7,(npy_clongdouble_wrapper const (*))arg8,(int const (*))arg9,(int const (*))arg10,(npy_clongdouble_wrapper const (*))arg11,arg12,arg13,arg14); + bsr_matmat_pass2< int,npy_clongdouble_wrapper >(arg1,arg2,arg3,arg4,arg5,(int const (*))arg6,(int const (*))arg7,(npy_clongdouble_wrapper const (*))arg8,(int const (*))arg9,(int const (*))arg10,(npy_clongdouble_wrapper const (*))arg11,arg12,arg13,arg14); resultobj = SWIG_Py_Void(); { if (is_new_object6 && array6) Py_DECREF(array6); @@ -40658,7 +40886,22 @@ } fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'bsr_matmat_pass2'.\n Possible C/C++ prototypes are:\n"" bsr_matmat_pass2<(int,signed char)>(int const,int const,int const,int const,int const,int const [],int const [],signed char const [],int const [],int const [],signed char const [],int [],int [],signed char [])\n"" bsr_matmat_pass2<(int,unsigned char)>(int const,int const,int const,int const,int const,int const [],int const [],unsigned char const [],int const [],int const [],unsigned char const [],int [],int [],unsigned char [])\n"" bsr_matmat_pass2<(int,short)>(int const,int const,int const,int const,int const,int const [],int const [],short const [],int const [],int const [],short const [],int [],int [],short [])\n"" bsr_matmat_pass2<(int,unsigned short)>(int const,int const,int const,int const,int const,int const [],int const [],unsigned short const [],int const [],int const [],unsigned short const [],int [],int [],unsigned short [])\n"" bsr_matmat_pass2<(int,int)>(int const,int const,int const,int const,int const,int const [],int const [],int const [],int const [],int const [],int const [],int [],int [],int [])\n"" bsr_matmat_pass2<(int,unsigned int)>(int const,int const,int const,int const,int const,int const [],int const [],unsigned int const [],int const [],int const [],unsigned int const [],int [],int [],unsigned int [])\n"" bsr_matmat_pass2<(int,long long)>(int const,int const,int const,int const,int const,int const [],int const [],long long const [],int const [],int const [],long long const [],int [],int [],long long [])\n"" bsr_matmat_pass2<(int,unsigned long long)>(int const,int const,int const,int const,int const,int const [],int const [],unsigned long long const [],int const [],int const [],unsigned long long const [],int [],int [],unsigned long long [])\n"" bsr_matmat_pass2<(int,float)>(int const,int const,int const,int const,int const,int const [],int const [],float const [],int const [],int const [],float const [],int [],int [],float [])\n"" bsr_matmat_pass2<(int,double)>(int const,int const,int const,int const,int const,int const [],int const [],double const [],int const [],int const [],double const [],int [],int [],double [])\n"" bsr_matmat_pass2<(int,long double)>(int const,int const,int const,int const,int const,int const [],int const [],long double const [],int const [],int const [],long double const [],int [],int [],long double [])\n"" bsr_matmat_pass2<(int,npy_cfloat_wrapper)>(int const,int const,int const,int const,int const,int const [],int const [],npy_cfloat_wrapper const [],int const [],int const [],npy_cfloat_wrapper const [],int [],int [],npy_cfloat_wrapper [])\n"" bsr_matmat_pass2<(int,npy_cdouble_wrapper)>(int const,int const,int const,int const,int const,int const [],int const [],npy_cdouble_wrapper const [],int const [],int const [],npy_cdouble_wrapper const [],int [],int [],npy_cdouble_wrapper [])\n"" bsr_matmat_pass2<(int,npy_clongdouble_wrapper)>(int const,int const,int const,int const,int const,int const [],int const [],npy_clongdouble_wrapper const [],int const [],int const [],npy_clongdouble_wrapper const [],int [],int [],npy_clongdouble_wrapper [])\n"); + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'bsr_matmat_pass2'.\n" + " Possible C/C++ prototypes are:\n" + " bsr_matmat_pass2< int,signed char >(int const,int const,int const,int const,int const,int const [],int const [],signed char const [],int const [],int const [],signed char const [],int [],int [],signed char [])\n" + " bsr_matmat_pass2< int,unsigned char >(int const,int const,int const,int const,int const,int const [],int const [],unsigned char const [],int const [],int const [],unsigned char const [],int [],int [],unsigned char [])\n" + " bsr_matmat_pass2< int,short >(int const,int const,int const,int const,int const,int const [],int const [],short const [],int const [],int const [],short const [],int [],int [],short [])\n" + " bsr_matmat_pass2< int,unsigned short >(int const,int const,int const,int const,int const,int const [],int const [],unsigned short const [],int const [],int const [],unsigned short const [],int [],int [],unsigned short [])\n" + " bsr_matmat_pass2< int,int >(int const,int const,int const,int const,int const,int const [],int const [],int const [],int const [],int const [],int const [],int [],int [],int [])\n" + " bsr_matmat_pass2< int,unsigned int >(int const,int const,int const,int const,int const,int const [],int const [],unsigned int const [],int const [],int const [],unsigned int const [],int [],int [],unsigned int [])\n" + " bsr_matmat_pass2< int,long long >(int const,int const,int const,int const,int const,int const [],int const [],long long const [],int const [],int const [],long long const [],int [],int [],long long [])\n" + " bsr_matmat_pass2< int,unsigned long long >(int const,int const,int const,int const,int const,int const [],int const [],unsigned long long const [],int const [],int const [],unsigned long long const [],int [],int [],unsigned long long [])\n" + " bsr_matmat_pass2< int,float >(int const,int const,int const,int const,int const,int const [],int const [],float const [],int const [],int const [],float const [],int [],int [],float [])\n" + " bsr_matmat_pass2< int,double >(int const,int const,int const,int const,int const,int const [],int const [],double const [],int const [],int const [],double const [],int [],int [],double [])\n" + " bsr_matmat_pass2< int,long double >(int const,int const,int const,int const,int const,int const [],int const [],long double const [],int const [],int const [],long double const [],int [],int [],long double [])\n" + " bsr_matmat_pass2< int,npy_cfloat_wrapper >(int const,int const,int const,int const,int const,int const [],int const [],npy_cfloat_wrapper const [],int const [],int const [],npy_cfloat_wrapper const [],int [],int [],npy_cfloat_wrapper [])\n" + " bsr_matmat_pass2< int,npy_cdouble_wrapper >(int const,int const,int const,int const,int const,int const [],int const [],npy_cdouble_wrapper const [],int const [],int const [],npy_cdouble_wrapper const [],int [],int [],npy_cdouble_wrapper [])\n" + " bsr_matmat_pass2< int,npy_clongdouble_wrapper >(int const,int const,int const,int const,int const,int const [],int const [],npy_clongdouble_wrapper const [],int const [],int const [],npy_clongdouble_wrapper const [],int [],int [],npy_clongdouble_wrapper [])\n"); return NULL; } @@ -40749,7 +40992,7 @@ if (!temp7 || !require_contiguous(temp7) || !require_native(temp7)) SWIG_fail; arg7 = (signed char*) array_data(temp7); } - csr_matvec(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(signed char const (*))arg5,(signed char const (*))arg6,arg7); + csr_matvec< int,signed char >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(signed char const (*))arg5,(signed char const (*))arg6,arg7); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -40867,7 +41110,7 @@ if (!temp7 || !require_contiguous(temp7) || !require_native(temp7)) SWIG_fail; arg7 = (unsigned char*) array_data(temp7); } - csr_matvec(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned char const (*))arg5,(unsigned char const (*))arg6,arg7); + csr_matvec< int,unsigned char >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned char const (*))arg5,(unsigned char const (*))arg6,arg7); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -40985,7 +41228,7 @@ if (!temp7 || !require_contiguous(temp7) || !require_native(temp7)) SWIG_fail; arg7 = (short*) array_data(temp7); } - csr_matvec(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(short const (*))arg5,(short const (*))arg6,arg7); + csr_matvec< int,short >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(short const (*))arg5,(short const (*))arg6,arg7); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -41103,7 +41346,7 @@ if (!temp7 || !require_contiguous(temp7) || !require_native(temp7)) SWIG_fail; arg7 = (unsigned short*) array_data(temp7); } - csr_matvec(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned short const (*))arg5,(unsigned short const (*))arg6,arg7); + csr_matvec< int,unsigned short >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned short const (*))arg5,(unsigned short const (*))arg6,arg7); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -41221,7 +41464,7 @@ if (!temp7 || !require_contiguous(temp7) || !require_native(temp7)) SWIG_fail; arg7 = (int*) array_data(temp7); } - csr_matvec(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(int const (*))arg5,(int const (*))arg6,arg7); + csr_matvec< int,int >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(int const (*))arg5,(int const (*))arg6,arg7); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -41339,7 +41582,7 @@ if (!temp7 || !require_contiguous(temp7) || !require_native(temp7)) SWIG_fail; arg7 = (unsigned int*) array_data(temp7); } - csr_matvec(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned int const (*))arg5,(unsigned int const (*))arg6,arg7); + csr_matvec< int,unsigned int >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned int const (*))arg5,(unsigned int const (*))arg6,arg7); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -41457,7 +41700,7 @@ if (!temp7 || !require_contiguous(temp7) || !require_native(temp7)) SWIG_fail; arg7 = (long long*) array_data(temp7); } - csr_matvec(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long long const (*))arg5,(long long const (*))arg6,arg7); + csr_matvec< int,long long >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long long const (*))arg5,(long long const (*))arg6,arg7); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -41575,7 +41818,7 @@ if (!temp7 || !require_contiguous(temp7) || !require_native(temp7)) SWIG_fail; arg7 = (unsigned long long*) array_data(temp7); } - csr_matvec(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned long long const (*))arg5,(unsigned long long const (*))arg6,arg7); + csr_matvec< int,unsigned long long >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned long long const (*))arg5,(unsigned long long const (*))arg6,arg7); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -41693,7 +41936,7 @@ if (!temp7 || !require_contiguous(temp7) || !require_native(temp7)) SWIG_fail; arg7 = (float*) array_data(temp7); } - csr_matvec(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(float const (*))arg5,(float const (*))arg6,arg7); + csr_matvec< int,float >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(float const (*))arg5,(float const (*))arg6,arg7); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -41811,7 +42054,7 @@ if (!temp7 || !require_contiguous(temp7) || !require_native(temp7)) SWIG_fail; arg7 = (double*) array_data(temp7); } - csr_matvec(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(double const (*))arg5,(double const (*))arg6,arg7); + csr_matvec< int,double >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(double const (*))arg5,(double const (*))arg6,arg7); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -41929,7 +42172,7 @@ if (!temp7 || !require_contiguous(temp7) || !require_native(temp7)) SWIG_fail; arg7 = (long double*) array_data(temp7); } - csr_matvec(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long double const (*))arg5,(long double const (*))arg6,arg7); + csr_matvec< int,long double >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long double const (*))arg5,(long double const (*))arg6,arg7); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -42047,7 +42290,7 @@ if (!temp7 || !require_contiguous(temp7) || !require_native(temp7)) SWIG_fail; arg7 = (npy_cfloat_wrapper*) array_data(temp7); } - csr_matvec(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cfloat_wrapper const (*))arg5,(npy_cfloat_wrapper const (*))arg6,arg7); + csr_matvec< int,npy_cfloat_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cfloat_wrapper const (*))arg5,(npy_cfloat_wrapper const (*))arg6,arg7); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -42165,7 +42408,7 @@ if (!temp7 || !require_contiguous(temp7) || !require_native(temp7)) SWIG_fail; arg7 = (npy_cdouble_wrapper*) array_data(temp7); } - csr_matvec(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cdouble_wrapper const (*))arg5,(npy_cdouble_wrapper const (*))arg6,arg7); + csr_matvec< int,npy_cdouble_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cdouble_wrapper const (*))arg5,(npy_cdouble_wrapper const (*))arg6,arg7); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -42283,7 +42526,7 @@ if (!temp7 || !require_contiguous(temp7) || !require_native(temp7)) SWIG_fail; arg7 = (npy_clongdouble_wrapper*) array_data(temp7); } - csr_matvec(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_clongdouble_wrapper const (*))arg5,(npy_clongdouble_wrapper const (*))arg6,arg7); + csr_matvec< int,npy_clongdouble_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_clongdouble_wrapper const (*))arg5,(npy_clongdouble_wrapper const (*))arg6,arg7); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -42901,7 +43144,22 @@ } fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'csr_matvec'.\n Possible C/C++ prototypes are:\n"" csr_matvec<(int,signed char)>(int const,int const,int const [],int const [],signed char const [],signed char const [],signed char [])\n"" csr_matvec<(int,unsigned char)>(int const,int const,int const [],int const [],unsigned char const [],unsigned char const [],unsigned char [])\n"" csr_matvec<(int,short)>(int const,int const,int const [],int const [],short const [],short const [],short [])\n"" csr_matvec<(int,unsigned short)>(int const,int const,int const [],int const [],unsigned short const [],unsigned short const [],unsigned short [])\n"" csr_matvec<(int,int)>(int const,int const,int const [],int const [],int const [],int const [],int [])\n"" csr_matvec<(int,unsigned int)>(int const,int const,int const [],int const [],unsigned int const [],unsigned int const [],unsigned int [])\n"" csr_matvec<(int,long long)>(int const,int const,int const [],int const [],long long const [],long long const [],long long [])\n"" csr_matvec<(int,unsigned long long)>(int const,int const,int const [],int const [],unsigned long long const [],unsigned long long const [],unsigned long long [])\n"" csr_matvec<(int,float)>(int const,int const,int const [],int const [],float const [],float const [],float [])\n"" csr_matvec<(int,double)>(int const,int const,int const [],int const [],double const [],double const [],double [])\n"" csr_matvec<(int,long double)>(int const,int const,int const [],int const [],long double const [],long double const [],long double [])\n"" csr_matvec<(int,npy_cfloat_wrapper)>(int const,int const,int const [],int const [],npy_cfloat_wrapper const [],npy_cfloat_wrapper const [],npy_cfloat_wrapper [])\n"" csr_matvec<(int,npy_cdouble_wrapper)>(int const,int const,int const [],int const [],npy_cdouble_wrapper const [],npy_cdouble_wrapper const [],npy_cdouble_wrapper [])\n"" csr_matvec<(int,npy_clongdouble_wrapper)>(int const,int const,int const [],int const [],npy_clongdouble_wrapper const [],npy_clongdouble_wrapper const [],npy_clongdouble_wrapper [])\n"); + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'csr_matvec'.\n" + " Possible C/C++ prototypes are:\n" + " csr_matvec< int,signed char >(int const,int const,int const [],int const [],signed char const [],signed char const [],signed char [])\n" + " csr_matvec< int,unsigned char >(int const,int const,int const [],int const [],unsigned char const [],unsigned char const [],unsigned char [])\n" + " csr_matvec< int,short >(int const,int const,int const [],int const [],short const [],short const [],short [])\n" + " csr_matvec< int,unsigned short >(int const,int const,int const [],int const [],unsigned short const [],unsigned short const [],unsigned short [])\n" + " csr_matvec< int,int >(int const,int const,int const [],int const [],int const [],int const [],int [])\n" + " csr_matvec< int,unsigned int >(int const,int const,int const [],int const [],unsigned int const [],unsigned int const [],unsigned int [])\n" + " csr_matvec< int,long long >(int const,int const,int const [],int const [],long long const [],long long const [],long long [])\n" + " csr_matvec< int,unsigned long long >(int const,int const,int const [],int const [],unsigned long long const [],unsigned long long const [],unsigned long long [])\n" + " csr_matvec< int,float >(int const,int const,int const [],int const [],float const [],float const [],float [])\n" + " csr_matvec< int,double >(int const,int const,int const [],int const [],double const [],double const [],double [])\n" + " csr_matvec< int,long double >(int const,int const,int const [],int const [],long double const [],long double const [],long double [])\n" + " csr_matvec< int,npy_cfloat_wrapper >(int const,int const,int const [],int const [],npy_cfloat_wrapper const [],npy_cfloat_wrapper const [],npy_cfloat_wrapper [])\n" + " csr_matvec< int,npy_cdouble_wrapper >(int const,int const,int const [],int const [],npy_cdouble_wrapper const [],npy_cdouble_wrapper const [],npy_cdouble_wrapper [])\n" + " csr_matvec< int,npy_clongdouble_wrapper >(int const,int const,int const [],int const [],npy_clongdouble_wrapper const [],npy_clongdouble_wrapper const [],npy_clongdouble_wrapper [])\n"); return NULL; } @@ -42992,7 +43250,7 @@ if (!temp7 || !require_contiguous(temp7) || !require_native(temp7)) SWIG_fail; arg7 = (signed char*) array_data(temp7); } - csc_matvec(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(signed char const (*))arg5,(signed char const (*))arg6,arg7); + csc_matvec< int,signed char >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(signed char const (*))arg5,(signed char const (*))arg6,arg7); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -43110,7 +43368,7 @@ if (!temp7 || !require_contiguous(temp7) || !require_native(temp7)) SWIG_fail; arg7 = (unsigned char*) array_data(temp7); } - csc_matvec(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned char const (*))arg5,(unsigned char const (*))arg6,arg7); + csc_matvec< int,unsigned char >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned char const (*))arg5,(unsigned char const (*))arg6,arg7); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -43228,7 +43486,7 @@ if (!temp7 || !require_contiguous(temp7) || !require_native(temp7)) SWIG_fail; arg7 = (short*) array_data(temp7); } - csc_matvec(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(short const (*))arg5,(short const (*))arg6,arg7); + csc_matvec< int,short >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(short const (*))arg5,(short const (*))arg6,arg7); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -43346,7 +43604,7 @@ if (!temp7 || !require_contiguous(temp7) || !require_native(temp7)) SWIG_fail; arg7 = (unsigned short*) array_data(temp7); } - csc_matvec(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned short const (*))arg5,(unsigned short const (*))arg6,arg7); + csc_matvec< int,unsigned short >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned short const (*))arg5,(unsigned short const (*))arg6,arg7); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -43464,7 +43722,7 @@ if (!temp7 || !require_contiguous(temp7) || !require_native(temp7)) SWIG_fail; arg7 = (int*) array_data(temp7); } - csc_matvec(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(int const (*))arg5,(int const (*))arg6,arg7); + csc_matvec< int,int >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(int const (*))arg5,(int const (*))arg6,arg7); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -43582,7 +43840,7 @@ if (!temp7 || !require_contiguous(temp7) || !require_native(temp7)) SWIG_fail; arg7 = (unsigned int*) array_data(temp7); } - csc_matvec(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned int const (*))arg5,(unsigned int const (*))arg6,arg7); + csc_matvec< int,unsigned int >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned int const (*))arg5,(unsigned int const (*))arg6,arg7); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -43700,7 +43958,7 @@ if (!temp7 || !require_contiguous(temp7) || !require_native(temp7)) SWIG_fail; arg7 = (long long*) array_data(temp7); } - csc_matvec(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long long const (*))arg5,(long long const (*))arg6,arg7); + csc_matvec< int,long long >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long long const (*))arg5,(long long const (*))arg6,arg7); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -43818,7 +44076,7 @@ if (!temp7 || !require_contiguous(temp7) || !require_native(temp7)) SWIG_fail; arg7 = (unsigned long long*) array_data(temp7); } - csc_matvec(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned long long const (*))arg5,(unsigned long long const (*))arg6,arg7); + csc_matvec< int,unsigned long long >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned long long const (*))arg5,(unsigned long long const (*))arg6,arg7); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -43936,7 +44194,7 @@ if (!temp7 || !require_contiguous(temp7) || !require_native(temp7)) SWIG_fail; arg7 = (float*) array_data(temp7); } - csc_matvec(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(float const (*))arg5,(float const (*))arg6,arg7); + csc_matvec< int,float >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(float const (*))arg5,(float const (*))arg6,arg7); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -44054,7 +44312,7 @@ if (!temp7 || !require_contiguous(temp7) || !require_native(temp7)) SWIG_fail; arg7 = (double*) array_data(temp7); } - csc_matvec(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(double const (*))arg5,(double const (*))arg6,arg7); + csc_matvec< int,double >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(double const (*))arg5,(double const (*))arg6,arg7); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -44172,7 +44430,7 @@ if (!temp7 || !require_contiguous(temp7) || !require_native(temp7)) SWIG_fail; arg7 = (long double*) array_data(temp7); } - csc_matvec(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long double const (*))arg5,(long double const (*))arg6,arg7); + csc_matvec< int,long double >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long double const (*))arg5,(long double const (*))arg6,arg7); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -44290,7 +44548,7 @@ if (!temp7 || !require_contiguous(temp7) || !require_native(temp7)) SWIG_fail; arg7 = (npy_cfloat_wrapper*) array_data(temp7); } - csc_matvec(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cfloat_wrapper const (*))arg5,(npy_cfloat_wrapper const (*))arg6,arg7); + csc_matvec< int,npy_cfloat_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cfloat_wrapper const (*))arg5,(npy_cfloat_wrapper const (*))arg6,arg7); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -44408,7 +44666,7 @@ if (!temp7 || !require_contiguous(temp7) || !require_native(temp7)) SWIG_fail; arg7 = (npy_cdouble_wrapper*) array_data(temp7); } - csc_matvec(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cdouble_wrapper const (*))arg5,(npy_cdouble_wrapper const (*))arg6,arg7); + csc_matvec< int,npy_cdouble_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cdouble_wrapper const (*))arg5,(npy_cdouble_wrapper const (*))arg6,arg7); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -44526,7 +44784,7 @@ if (!temp7 || !require_contiguous(temp7) || !require_native(temp7)) SWIG_fail; arg7 = (npy_clongdouble_wrapper*) array_data(temp7); } - csc_matvec(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_clongdouble_wrapper const (*))arg5,(npy_clongdouble_wrapper const (*))arg6,arg7); + csc_matvec< int,npy_clongdouble_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_clongdouble_wrapper const (*))arg5,(npy_clongdouble_wrapper const (*))arg6,arg7); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -45144,7 +45402,22 @@ } fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'csc_matvec'.\n Possible C/C++ prototypes are:\n"" csc_matvec<(int,signed char)>(int const,int const,int const [],int const [],signed char const [],signed char const [],signed char [])\n"" csc_matvec<(int,unsigned char)>(int const,int const,int const [],int const [],unsigned char const [],unsigned char const [],unsigned char [])\n"" csc_matvec<(int,short)>(int const,int const,int const [],int const [],short const [],short const [],short [])\n"" csc_matvec<(int,unsigned short)>(int const,int const,int const [],int const [],unsigned short const [],unsigned short const [],unsigned short [])\n"" csc_matvec<(int,int)>(int const,int const,int const [],int const [],int const [],int const [],int [])\n"" csc_matvec<(int,unsigned int)>(int const,int const,int const [],int const [],unsigned int const [],unsigned int const [],unsigned int [])\n"" csc_matvec<(int,long long)>(int const,int const,int const [],int const [],long long const [],long long const [],long long [])\n"" csc_matvec<(int,unsigned long long)>(int const,int const,int const [],int const [],unsigned long long const [],unsigned long long const [],unsigned long long [])\n"" csc_matvec<(int,float)>(int const,int const,int const [],int const [],float const [],float const [],float [])\n"" csc_matvec<(int,double)>(int const,int const,int const [],int const [],double const [],double const [],double [])\n"" csc_matvec<(int,long double)>(int const,int const,int const [],int const [],long double const [],long double const [],long double [])\n"" csc_matvec<(int,npy_cfloat_wrapper)>(int const,int const,int const [],int const [],npy_cfloat_wrapper const [],npy_cfloat_wrapper const [],npy_cfloat_wrapper [])\n"" csc_matvec<(int,npy_cdouble_wrapper)>(int const,int const,int const [],int const [],npy_cdouble_wrapper const [],npy_cdouble_wrapper const [],npy_cdouble_wrapper [])\n"" csc_matvec<(int,npy_clongdouble_wrapper)>(int const,int const,int const [],int const [],npy_clongdouble_wrapper const [],npy_clongdouble_wrapper const [],npy_clongdouble_wrapper [])\n"); + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'csc_matvec'.\n" + " Possible C/C++ prototypes are:\n" + " csc_matvec< int,signed char >(int const,int const,int const [],int const [],signed char const [],signed char const [],signed char [])\n" + " csc_matvec< int,unsigned char >(int const,int const,int const [],int const [],unsigned char const [],unsigned char const [],unsigned char [])\n" + " csc_matvec< int,short >(int const,int const,int const [],int const [],short const [],short const [],short [])\n" + " csc_matvec< int,unsigned short >(int const,int const,int const [],int const [],unsigned short const [],unsigned short const [],unsigned short [])\n" + " csc_matvec< int,int >(int const,int const,int const [],int const [],int const [],int const [],int [])\n" + " csc_matvec< int,unsigned int >(int const,int const,int const [],int const [],unsigned int const [],unsigned int const [],unsigned int [])\n" + " csc_matvec< int,long long >(int const,int const,int const [],int const [],long long const [],long long const [],long long [])\n" + " csc_matvec< int,unsigned long long >(int const,int const,int const [],int const [],unsigned long long const [],unsigned long long const [],unsigned long long [])\n" + " csc_matvec< int,float >(int const,int const,int const [],int const [],float const [],float const [],float [])\n" + " csc_matvec< int,double >(int const,int const,int const [],int const [],double const [],double const [],double [])\n" + " csc_matvec< int,long double >(int const,int const,int const [],int const [],long double const [],long double const [],long double [])\n" + " csc_matvec< int,npy_cfloat_wrapper >(int const,int const,int const [],int const [],npy_cfloat_wrapper const [],npy_cfloat_wrapper const [],npy_cfloat_wrapper [])\n" + " csc_matvec< int,npy_cdouble_wrapper >(int const,int const,int const [],int const [],npy_cdouble_wrapper const [],npy_cdouble_wrapper const [],npy_cdouble_wrapper [])\n" + " csc_matvec< int,npy_clongdouble_wrapper >(int const,int const,int const [],int const [],npy_clongdouble_wrapper const [],npy_clongdouble_wrapper const [],npy_clongdouble_wrapper [])\n"); return NULL; } @@ -45253,7 +45526,7 @@ if (!temp9 || !require_contiguous(temp9) || !require_native(temp9)) SWIG_fail; arg9 = (signed char*) array_data(temp9); } - bsr_matvec(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(signed char const (*))arg7,(signed char const (*))arg8,arg9); + bsr_matvec< int,signed char >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(signed char const (*))arg7,(signed char const (*))arg8,arg9); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -45389,7 +45662,7 @@ if (!temp9 || !require_contiguous(temp9) || !require_native(temp9)) SWIG_fail; arg9 = (unsigned char*) array_data(temp9); } - bsr_matvec(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(unsigned char const (*))arg7,(unsigned char const (*))arg8,arg9); + bsr_matvec< int,unsigned char >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(unsigned char const (*))arg7,(unsigned char const (*))arg8,arg9); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -45525,7 +45798,7 @@ if (!temp9 || !require_contiguous(temp9) || !require_native(temp9)) SWIG_fail; arg9 = (short*) array_data(temp9); } - bsr_matvec(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(short const (*))arg7,(short const (*))arg8,arg9); + bsr_matvec< int,short >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(short const (*))arg7,(short const (*))arg8,arg9); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -45661,7 +45934,7 @@ if (!temp9 || !require_contiguous(temp9) || !require_native(temp9)) SWIG_fail; arg9 = (unsigned short*) array_data(temp9); } - bsr_matvec(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(unsigned short const (*))arg7,(unsigned short const (*))arg8,arg9); + bsr_matvec< int,unsigned short >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(unsigned short const (*))arg7,(unsigned short const (*))arg8,arg9); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -45797,7 +46070,7 @@ if (!temp9 || !require_contiguous(temp9) || !require_native(temp9)) SWIG_fail; arg9 = (int*) array_data(temp9); } - bsr_matvec(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(int const (*))arg7,(int const (*))arg8,arg9); + bsr_matvec< int,int >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(int const (*))arg7,(int const (*))arg8,arg9); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -45933,7 +46206,7 @@ if (!temp9 || !require_contiguous(temp9) || !require_native(temp9)) SWIG_fail; arg9 = (unsigned int*) array_data(temp9); } - bsr_matvec(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(unsigned int const (*))arg7,(unsigned int const (*))arg8,arg9); + bsr_matvec< int,unsigned int >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(unsigned int const (*))arg7,(unsigned int const (*))arg8,arg9); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -46069,7 +46342,7 @@ if (!temp9 || !require_contiguous(temp9) || !require_native(temp9)) SWIG_fail; arg9 = (long long*) array_data(temp9); } - bsr_matvec(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(long long const (*))arg7,(long long const (*))arg8,arg9); + bsr_matvec< int,long long >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(long long const (*))arg7,(long long const (*))arg8,arg9); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -46205,7 +46478,7 @@ if (!temp9 || !require_contiguous(temp9) || !require_native(temp9)) SWIG_fail; arg9 = (unsigned long long*) array_data(temp9); } - bsr_matvec(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(unsigned long long const (*))arg7,(unsigned long long const (*))arg8,arg9); + bsr_matvec< int,unsigned long long >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(unsigned long long const (*))arg7,(unsigned long long const (*))arg8,arg9); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -46341,7 +46614,7 @@ if (!temp9 || !require_contiguous(temp9) || !require_native(temp9)) SWIG_fail; arg9 = (float*) array_data(temp9); } - bsr_matvec(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(float const (*))arg7,(float const (*))arg8,arg9); + bsr_matvec< int,float >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(float const (*))arg7,(float const (*))arg8,arg9); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -46477,7 +46750,7 @@ if (!temp9 || !require_contiguous(temp9) || !require_native(temp9)) SWIG_fail; arg9 = (double*) array_data(temp9); } - bsr_matvec(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(double const (*))arg7,(double const (*))arg8,arg9); + bsr_matvec< int,double >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(double const (*))arg7,(double const (*))arg8,arg9); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -46613,7 +46886,7 @@ if (!temp9 || !require_contiguous(temp9) || !require_native(temp9)) SWIG_fail; arg9 = (long double*) array_data(temp9); } - bsr_matvec(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(long double const (*))arg7,(long double const (*))arg8,arg9); + bsr_matvec< int,long double >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(long double const (*))arg7,(long double const (*))arg8,arg9); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -46749,7 +47022,7 @@ if (!temp9 || !require_contiguous(temp9) || !require_native(temp9)) SWIG_fail; arg9 = (npy_cfloat_wrapper*) array_data(temp9); } - bsr_matvec(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(npy_cfloat_wrapper const (*))arg7,(npy_cfloat_wrapper const (*))arg8,arg9); + bsr_matvec< int,npy_cfloat_wrapper >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(npy_cfloat_wrapper const (*))arg7,(npy_cfloat_wrapper const (*))arg8,arg9); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -46885,7 +47158,7 @@ if (!temp9 || !require_contiguous(temp9) || !require_native(temp9)) SWIG_fail; arg9 = (npy_cdouble_wrapper*) array_data(temp9); } - bsr_matvec(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(npy_cdouble_wrapper const (*))arg7,(npy_cdouble_wrapper const (*))arg8,arg9); + bsr_matvec< int,npy_cdouble_wrapper >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(npy_cdouble_wrapper const (*))arg7,(npy_cdouble_wrapper const (*))arg8,arg9); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -47021,7 +47294,7 @@ if (!temp9 || !require_contiguous(temp9) || !require_native(temp9)) SWIG_fail; arg9 = (npy_clongdouble_wrapper*) array_data(temp9); } - bsr_matvec(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(npy_clongdouble_wrapper const (*))arg7,(npy_clongdouble_wrapper const (*))arg8,arg9); + bsr_matvec< int,npy_clongdouble_wrapper >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(npy_clongdouble_wrapper const (*))arg7,(npy_clongdouble_wrapper const (*))arg8,arg9); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -47807,7 +48080,22 @@ } fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'bsr_matvec'.\n Possible C/C++ prototypes are:\n"" bsr_matvec<(int,signed char)>(int const,int const,int const,int const,int const [],int const [],signed char const [],signed char const [],signed char [])\n"" bsr_matvec<(int,unsigned char)>(int const,int const,int const,int const,int const [],int const [],unsigned char const [],unsigned char const [],unsigned char [])\n"" bsr_matvec<(int,short)>(int const,int const,int const,int const,int const [],int const [],short const [],short const [],short [])\n"" bsr_matvec<(int,unsigned short)>(int const,int const,int const,int const,int const [],int const [],unsigned short const [],unsigned short const [],unsigned short [])\n"" bsr_matvec<(int,int)>(int const,int const,int const,int const,int const [],int const [],int const [],int const [],int [])\n"" bsr_matvec<(int,unsigned int)>(int const,int const,int const,int const,int const [],int const [],unsigned int const [],unsigned int const [],unsigned int [])\n"" bsr_matvec<(int,long long)>(int const,int const,int const,int const,int const [],int const [],long long const [],long long const [],long long [])\n"" bsr_matvec<(int,unsigned long long)>(int const,int const,int const,int const,int const [],int const [],unsigned long long const [],unsigned long long const [],unsigned long long [])\n"" bsr_matvec<(int,float)>(int const,int const,int const,int const,int const [],int const [],float const [],float const [],float [])\n"" bsr_matvec<(int,double)>(int const,int const,int const,int const,int const [],int const [],double const [],double const [],double [])\n"" bsr_matvec<(int,long double)>(int const,int const,int const,int const,int const [],int const [],long double const [],long double const [],long double [])\n"" bsr_matvec<(int,npy_cfloat_wrapper)>(int const,int const,int const,int const,int const [],int const [],npy_cfloat_wrapper const [],npy_cfloat_wrapper const [],npy_cfloat_wrapper [])\n"" bsr_matvec<(int,npy_cdouble_wrapper)>(int const,int const,int const,int const,int const [],int const [],npy_cdouble_wrapper const [],npy_cdouble_wrapper const [],npy_cdouble_wrapper [])\n"" bsr_matvec<(int,npy_clongdouble_wrapper)>(int const,int const,int const,int const,int const [],int const [],npy_clongdouble_wrapper const [],npy_clongdouble_wrapper const [],npy_clongdouble_wrapper [])\n"); + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'bsr_matvec'.\n" + " Possible C/C++ prototypes are:\n" + " bsr_matvec< int,signed char >(int const,int const,int const,int const,int const [],int const [],signed char const [],signed char const [],signed char [])\n" + " bsr_matvec< int,unsigned char >(int const,int const,int const,int const,int const [],int const [],unsigned char const [],unsigned char const [],unsigned char [])\n" + " bsr_matvec< int,short >(int const,int const,int const,int const,int const [],int const [],short const [],short const [],short [])\n" + " bsr_matvec< int,unsigned short >(int const,int const,int const,int const,int const [],int const [],unsigned short const [],unsigned short const [],unsigned short [])\n" + " bsr_matvec< int,int >(int const,int const,int const,int const,int const [],int const [],int const [],int const [],int [])\n" + " bsr_matvec< int,unsigned int >(int const,int const,int const,int const,int const [],int const [],unsigned int const [],unsigned int const [],unsigned int [])\n" + " bsr_matvec< int,long long >(int const,int const,int const,int const,int const [],int const [],long long const [],long long const [],long long [])\n" + " bsr_matvec< int,unsigned long long >(int const,int const,int const,int const,int const [],int const [],unsigned long long const [],unsigned long long const [],unsigned long long [])\n" + " bsr_matvec< int,float >(int const,int const,int const,int const,int const [],int const [],float const [],float const [],float [])\n" + " bsr_matvec< int,double >(int const,int const,int const,int const,int const [],int const [],double const [],double const [],double [])\n" + " bsr_matvec< int,long double >(int const,int const,int const,int const,int const [],int const [],long double const [],long double const [],long double [])\n" + " bsr_matvec< int,npy_cfloat_wrapper >(int const,int const,int const,int const,int const [],int const [],npy_cfloat_wrapper const [],npy_cfloat_wrapper const [],npy_cfloat_wrapper [])\n" + " bsr_matvec< int,npy_cdouble_wrapper >(int const,int const,int const,int const,int const [],int const [],npy_cdouble_wrapper const [],npy_cdouble_wrapper const [],npy_cdouble_wrapper [])\n" + " bsr_matvec< int,npy_clongdouble_wrapper >(int const,int const,int const,int const,int const [],int const [],npy_clongdouble_wrapper const [],npy_clongdouble_wrapper const [],npy_clongdouble_wrapper [])\n"); return NULL; } @@ -47942,7 +48230,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (signed char*) array_data(temp11); } - csr_elmul_csr(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(signed char const (*))arg5,(int const (*))arg6,(int const (*))arg7,(signed char const (*))arg8,arg9,arg10,arg11); + csr_elmul_csr< int,signed char >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(signed char const (*))arg5,(int const (*))arg6,(int const (*))arg7,(signed char const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -48116,7 +48404,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (unsigned char*) array_data(temp11); } - csr_elmul_csr(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned char const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned char const (*))arg8,arg9,arg10,arg11); + csr_elmul_csr< int,unsigned char >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned char const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned char const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -48290,7 +48578,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (short*) array_data(temp11); } - csr_elmul_csr(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(short const (*))arg5,(int const (*))arg6,(int const (*))arg7,(short const (*))arg8,arg9,arg10,arg11); + csr_elmul_csr< int,short >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(short const (*))arg5,(int const (*))arg6,(int const (*))arg7,(short const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -48464,7 +48752,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (unsigned short*) array_data(temp11); } - csr_elmul_csr(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned short const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned short const (*))arg8,arg9,arg10,arg11); + csr_elmul_csr< int,unsigned short >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned short const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned short const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -48638,7 +48926,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (int*) array_data(temp11); } - csr_elmul_csr(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(int const (*))arg5,(int const (*))arg6,(int const (*))arg7,(int const (*))arg8,arg9,arg10,arg11); + csr_elmul_csr< int,int >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(int const (*))arg5,(int const (*))arg6,(int const (*))arg7,(int const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -48812,7 +49100,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (unsigned int*) array_data(temp11); } - csr_elmul_csr(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned int const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned int const (*))arg8,arg9,arg10,arg11); + csr_elmul_csr< int,unsigned int >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned int const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned int const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -48986,7 +49274,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (long long*) array_data(temp11); } - csr_elmul_csr(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long long const (*))arg5,(int const (*))arg6,(int const (*))arg7,(long long const (*))arg8,arg9,arg10,arg11); + csr_elmul_csr< int,long long >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long long const (*))arg5,(int const (*))arg6,(int const (*))arg7,(long long const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -49160,7 +49448,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (unsigned long long*) array_data(temp11); } - csr_elmul_csr(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned long long const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned long long const (*))arg8,arg9,arg10,arg11); + csr_elmul_csr< int,unsigned long long >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned long long const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned long long const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -49334,7 +49622,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (float*) array_data(temp11); } - csr_elmul_csr(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(float const (*))arg5,(int const (*))arg6,(int const (*))arg7,(float const (*))arg8,arg9,arg10,arg11); + csr_elmul_csr< int,float >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(float const (*))arg5,(int const (*))arg6,(int const (*))arg7,(float const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -49508,7 +49796,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (double*) array_data(temp11); } - csr_elmul_csr(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(double const (*))arg5,(int const (*))arg6,(int const (*))arg7,(double const (*))arg8,arg9,arg10,arg11); + csr_elmul_csr< int,double >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(double const (*))arg5,(int const (*))arg6,(int const (*))arg7,(double const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -49682,7 +49970,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (long double*) array_data(temp11); } - csr_elmul_csr(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long double const (*))arg5,(int const (*))arg6,(int const (*))arg7,(long double const (*))arg8,arg9,arg10,arg11); + csr_elmul_csr< int,long double >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long double const (*))arg5,(int const (*))arg6,(int const (*))arg7,(long double const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -49856,7 +50144,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (npy_cfloat_wrapper*) array_data(temp11); } - csr_elmul_csr(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cfloat_wrapper const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_cfloat_wrapper const (*))arg8,arg9,arg10,arg11); + csr_elmul_csr< int,npy_cfloat_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cfloat_wrapper const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_cfloat_wrapper const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -50030,7 +50318,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (npy_cdouble_wrapper*) array_data(temp11); } - csr_elmul_csr(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cdouble_wrapper const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_cdouble_wrapper const (*))arg8,arg9,arg10,arg11); + csr_elmul_csr< int,npy_cdouble_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cdouble_wrapper const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_cdouble_wrapper const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -50204,7 +50492,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (npy_clongdouble_wrapper*) array_data(temp11); } - csr_elmul_csr(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_clongdouble_wrapper const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_clongdouble_wrapper const (*))arg8,arg9,arg10,arg11); + csr_elmul_csr< int,npy_clongdouble_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_clongdouble_wrapper const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_clongdouble_wrapper const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -51114,7 +51402,22 @@ } fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'csr_elmul_csr'.\n Possible C/C++ prototypes are:\n"" csr_elmul_csr<(int,signed char)>(int const,int const,int const [],int const [],signed char const [],int const [],int const [],signed char const [],int [],int [],signed char [])\n"" csr_elmul_csr<(int,unsigned char)>(int const,int const,int const [],int const [],unsigned char const [],int const [],int const [],unsigned char const [],int [],int [],unsigned char [])\n"" csr_elmul_csr<(int,short)>(int const,int const,int const [],int const [],short const [],int const [],int const [],short const [],int [],int [],short [])\n"" csr_elmul_csr<(int,unsigned short)>(int const,int const,int const [],int const [],unsigned short const [],int const [],int const [],unsigned short const [],int [],int [],unsigned short [])\n"" csr_elmul_csr<(int,int)>(int const,int const,int const [],int const [],int const [],int const [],int const [],int const [],int [],int [],int [])\n"" csr_elmul_csr<(int,unsigned int)>(int const,int const,int const [],int const [],unsigned int const [],int const [],int const [],unsigned int const [],int [],int [],unsigned int [])\n"" csr_elmul_csr<(int,long long)>(int const,int const,int const [],int const [],long long const [],int const [],int const [],long long const [],int [],int [],long long [])\n"" csr_elmul_csr<(int,unsigned long long)>(int const,int const,int const [],int const [],unsigned long long const [],int const [],int const [],unsigned long long const [],int [],int [],unsigned long long [])\n"" csr_elmul_csr<(int,float)>(int const,int const,int const [],int const [],float const [],int const [],int const [],float const [],int [],int [],float [])\n"" csr_elmul_csr<(int,double)>(int const,int const,int const [],int const [],double const [],int const [],int const [],double const [],int [],int [],double [])\n"" csr_elmul_csr<(int,long double)>(int const,int const,int const [],int const [],long double const [],int const [],int const [],long double const [],int [],int [],long double [])\n"" csr_elmul_csr<(int,npy_cfloat_wrapper)>(int const,int const,int const [],int const [],npy_cfloat_wrapper const [],int const [],int const [],npy_cfloat_wrapper const [],int [],int [],npy_cfloat_wrapper [])\n"" csr_elmul_csr<(int,npy_cdouble_wrapper)>(int const,int const,int const [],int const [],npy_cdouble_wrapper const [],int const [],int const [],npy_cdouble_wrapper const [],int [],int [],npy_cdouble_wrapper [])\n"" csr_elmul_csr<(int,npy_clongdouble_wrapper)>(int const,int const,int const [],int const [],npy_clongdouble_wrapper const [],int const [],int const [],npy_clongdouble_wrapper const [],int [],int [],npy_clongdouble_wrapper [])\n"); + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'csr_elmul_csr'.\n" + " Possible C/C++ prototypes are:\n" + " csr_elmul_csr< int,signed char >(int const,int const,int const [],int const [],signed char const [],int const [],int const [],signed char const [],int [],int [],signed char [])\n" + " csr_elmul_csr< int,unsigned char >(int const,int const,int const [],int const [],unsigned char const [],int const [],int const [],unsigned char const [],int [],int [],unsigned char [])\n" + " csr_elmul_csr< int,short >(int const,int const,int const [],int const [],short const [],int const [],int const [],short const [],int [],int [],short [])\n" + " csr_elmul_csr< int,unsigned short >(int const,int const,int const [],int const [],unsigned short const [],int const [],int const [],unsigned short const [],int [],int [],unsigned short [])\n" + " csr_elmul_csr< int,int >(int const,int const,int const [],int const [],int const [],int const [],int const [],int const [],int [],int [],int [])\n" + " csr_elmul_csr< int,unsigned int >(int const,int const,int const [],int const [],unsigned int const [],int const [],int const [],unsigned int const [],int [],int [],unsigned int [])\n" + " csr_elmul_csr< int,long long >(int const,int const,int const [],int const [],long long const [],int const [],int const [],long long const [],int [],int [],long long [])\n" + " csr_elmul_csr< int,unsigned long long >(int const,int const,int const [],int const [],unsigned long long const [],int const [],int const [],unsigned long long const [],int [],int [],unsigned long long [])\n" + " csr_elmul_csr< int,float >(int const,int const,int const [],int const [],float const [],int const [],int const [],float const [],int [],int [],float [])\n" + " csr_elmul_csr< int,double >(int const,int const,int const [],int const [],double const [],int const [],int const [],double const [],int [],int [],double [])\n" + " csr_elmul_csr< int,long double >(int const,int const,int const [],int const [],long double const [],int const [],int const [],long double const [],int [],int [],long double [])\n" + " csr_elmul_csr< int,npy_cfloat_wrapper >(int const,int const,int const [],int const [],npy_cfloat_wrapper const [],int const [],int const [],npy_cfloat_wrapper const [],int [],int [],npy_cfloat_wrapper [])\n" + " csr_elmul_csr< int,npy_cdouble_wrapper >(int const,int const,int const [],int const [],npy_cdouble_wrapper const [],int const [],int const [],npy_cdouble_wrapper const [],int [],int [],npy_cdouble_wrapper [])\n" + " csr_elmul_csr< int,npy_clongdouble_wrapper >(int const,int const,int const [],int const [],npy_clongdouble_wrapper const [],int const [],int const [],npy_clongdouble_wrapper const [],int [],int [],npy_clongdouble_wrapper [])\n"); return NULL; } @@ -51249,7 +51552,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (signed char*) array_data(temp11); } - csr_eldiv_csr(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(signed char const (*))arg5,(int const (*))arg6,(int const (*))arg7,(signed char const (*))arg8,arg9,arg10,arg11); + csr_eldiv_csr< int,signed char >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(signed char const (*))arg5,(int const (*))arg6,(int const (*))arg7,(signed char const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -51423,7 +51726,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (unsigned char*) array_data(temp11); } - csr_eldiv_csr(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned char const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned char const (*))arg8,arg9,arg10,arg11); + csr_eldiv_csr< int,unsigned char >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned char const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned char const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -51597,7 +51900,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (short*) array_data(temp11); } - csr_eldiv_csr(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(short const (*))arg5,(int const (*))arg6,(int const (*))arg7,(short const (*))arg8,arg9,arg10,arg11); + csr_eldiv_csr< int,short >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(short const (*))arg5,(int const (*))arg6,(int const (*))arg7,(short const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -51771,7 +52074,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (unsigned short*) array_data(temp11); } - csr_eldiv_csr(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned short const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned short const (*))arg8,arg9,arg10,arg11); + csr_eldiv_csr< int,unsigned short >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned short const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned short const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -51945,7 +52248,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (int*) array_data(temp11); } - csr_eldiv_csr(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(int const (*))arg5,(int const (*))arg6,(int const (*))arg7,(int const (*))arg8,arg9,arg10,arg11); + csr_eldiv_csr< int,int >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(int const (*))arg5,(int const (*))arg6,(int const (*))arg7,(int const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -52119,7 +52422,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (unsigned int*) array_data(temp11); } - csr_eldiv_csr(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned int const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned int const (*))arg8,arg9,arg10,arg11); + csr_eldiv_csr< int,unsigned int >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned int const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned int const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -52293,7 +52596,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (long long*) array_data(temp11); } - csr_eldiv_csr(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long long const (*))arg5,(int const (*))arg6,(int const (*))arg7,(long long const (*))arg8,arg9,arg10,arg11); + csr_eldiv_csr< int,long long >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long long const (*))arg5,(int const (*))arg6,(int const (*))arg7,(long long const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -52467,7 +52770,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (unsigned long long*) array_data(temp11); } - csr_eldiv_csr(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned long long const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned long long const (*))arg8,arg9,arg10,arg11); + csr_eldiv_csr< int,unsigned long long >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned long long const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned long long const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -52641,7 +52944,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (float*) array_data(temp11); } - csr_eldiv_csr(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(float const (*))arg5,(int const (*))arg6,(int const (*))arg7,(float const (*))arg8,arg9,arg10,arg11); + csr_eldiv_csr< int,float >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(float const (*))arg5,(int const (*))arg6,(int const (*))arg7,(float const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -52815,7 +53118,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (double*) array_data(temp11); } - csr_eldiv_csr(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(double const (*))arg5,(int const (*))arg6,(int const (*))arg7,(double const (*))arg8,arg9,arg10,arg11); + csr_eldiv_csr< int,double >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(double const (*))arg5,(int const (*))arg6,(int const (*))arg7,(double const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -52989,7 +53292,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (long double*) array_data(temp11); } - csr_eldiv_csr(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long double const (*))arg5,(int const (*))arg6,(int const (*))arg7,(long double const (*))arg8,arg9,arg10,arg11); + csr_eldiv_csr< int,long double >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long double const (*))arg5,(int const (*))arg6,(int const (*))arg7,(long double const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -53163,7 +53466,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (npy_cfloat_wrapper*) array_data(temp11); } - csr_eldiv_csr(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cfloat_wrapper const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_cfloat_wrapper const (*))arg8,arg9,arg10,arg11); + csr_eldiv_csr< int,npy_cfloat_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cfloat_wrapper const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_cfloat_wrapper const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -53337,7 +53640,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (npy_cdouble_wrapper*) array_data(temp11); } - csr_eldiv_csr(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cdouble_wrapper const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_cdouble_wrapper const (*))arg8,arg9,arg10,arg11); + csr_eldiv_csr< int,npy_cdouble_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cdouble_wrapper const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_cdouble_wrapper const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -53511,7 +53814,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (npy_clongdouble_wrapper*) array_data(temp11); } - csr_eldiv_csr(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_clongdouble_wrapper const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_clongdouble_wrapper const (*))arg8,arg9,arg10,arg11); + csr_eldiv_csr< int,npy_clongdouble_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_clongdouble_wrapper const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_clongdouble_wrapper const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -54421,7 +54724,22 @@ } fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'csr_eldiv_csr'.\n Possible C/C++ prototypes are:\n"" csr_eldiv_csr<(int,signed char)>(int const,int const,int const [],int const [],signed char const [],int const [],int const [],signed char const [],int [],int [],signed char [])\n"" csr_eldiv_csr<(int,unsigned char)>(int const,int const,int const [],int const [],unsigned char const [],int const [],int const [],unsigned char const [],int [],int [],unsigned char [])\n"" csr_eldiv_csr<(int,short)>(int const,int const,int const [],int const [],short const [],int const [],int const [],short const [],int [],int [],short [])\n"" csr_eldiv_csr<(int,unsigned short)>(int const,int const,int const [],int const [],unsigned short const [],int const [],int const [],unsigned short const [],int [],int [],unsigned short [])\n"" csr_eldiv_csr<(int,int)>(int const,int const,int const [],int const [],int const [],int const [],int const [],int const [],int [],int [],int [])\n"" csr_eldiv_csr<(int,unsigned int)>(int const,int const,int const [],int const [],unsigned int const [],int const [],int const [],unsigned int const [],int [],int [],unsigned int [])\n"" csr_eldiv_csr<(int,long long)>(int const,int const,int const [],int const [],long long const [],int const [],int const [],long long const [],int [],int [],long long [])\n"" csr_eldiv_csr<(int,unsigned long long)>(int const,int const,int const [],int const [],unsigned long long const [],int const [],int const [],unsigned long long const [],int [],int [],unsigned long long [])\n"" csr_eldiv_csr<(int,float)>(int const,int const,int const [],int const [],float const [],int const [],int const [],float const [],int [],int [],float [])\n"" csr_eldiv_csr<(int,double)>(int const,int const,int const [],int const [],double const [],int const [],int const [],double const [],int [],int [],double [])\n"" csr_eldiv_csr<(int,long double)>(int const,int const,int const [],int const [],long double const [],int const [],int const [],long double const [],int [],int [],long double [])\n"" csr_eldiv_csr<(int,npy_cfloat_wrapper)>(int const,int const,int const [],int const [],npy_cfloat_wrapper const [],int const [],int const [],npy_cfloat_wrapper const [],int [],int [],npy_cfloat_wrapper [])\n"" csr_eldiv_csr<(int,npy_cdouble_wrapper)>(int const,int const,int const [],int const [],npy_cdouble_wrapper const [],int const [],int const [],npy_cdouble_wrapper const [],int [],int [],npy_cdouble_wrapper [])\n"" csr_eldiv_csr<(int,npy_clongdouble_wrapper)>(int const,int const,int const [],int const [],npy_clongdouble_wrapper const [],int const [],int const [],npy_clongdouble_wrapper const [],int [],int [],npy_clongdouble_wrapper [])\n"); + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'csr_eldiv_csr'.\n" + " Possible C/C++ prototypes are:\n" + " csr_eldiv_csr< int,signed char >(int const,int const,int const [],int const [],signed char const [],int const [],int const [],signed char const [],int [],int [],signed char [])\n" + " csr_eldiv_csr< int,unsigned char >(int const,int const,int const [],int const [],unsigned char const [],int const [],int const [],unsigned char const [],int [],int [],unsigned char [])\n" + " csr_eldiv_csr< int,short >(int const,int const,int const [],int const [],short const [],int const [],int const [],short const [],int [],int [],short [])\n" + " csr_eldiv_csr< int,unsigned short >(int const,int const,int const [],int const [],unsigned short const [],int const [],int const [],unsigned short const [],int [],int [],unsigned short [])\n" + " csr_eldiv_csr< int,int >(int const,int const,int const [],int const [],int const [],int const [],int const [],int const [],int [],int [],int [])\n" + " csr_eldiv_csr< int,unsigned int >(int const,int const,int const [],int const [],unsigned int const [],int const [],int const [],unsigned int const [],int [],int [],unsigned int [])\n" + " csr_eldiv_csr< int,long long >(int const,int const,int const [],int const [],long long const [],int const [],int const [],long long const [],int [],int [],long long [])\n" + " csr_eldiv_csr< int,unsigned long long >(int const,int const,int const [],int const [],unsigned long long const [],int const [],int const [],unsigned long long const [],int [],int [],unsigned long long [])\n" + " csr_eldiv_csr< int,float >(int const,int const,int const [],int const [],float const [],int const [],int const [],float const [],int [],int [],float [])\n" + " csr_eldiv_csr< int,double >(int const,int const,int const [],int const [],double const [],int const [],int const [],double const [],int [],int [],double [])\n" + " csr_eldiv_csr< int,long double >(int const,int const,int const [],int const [],long double const [],int const [],int const [],long double const [],int [],int [],long double [])\n" + " csr_eldiv_csr< int,npy_cfloat_wrapper >(int const,int const,int const [],int const [],npy_cfloat_wrapper const [],int const [],int const [],npy_cfloat_wrapper const [],int [],int [],npy_cfloat_wrapper [])\n" + " csr_eldiv_csr< int,npy_cdouble_wrapper >(int const,int const,int const [],int const [],npy_cdouble_wrapper const [],int const [],int const [],npy_cdouble_wrapper const [],int [],int [],npy_cdouble_wrapper [])\n" + " csr_eldiv_csr< int,npy_clongdouble_wrapper >(int const,int const,int const [],int const [],npy_clongdouble_wrapper const [],int const [],int const [],npy_clongdouble_wrapper const [],int [],int [],npy_clongdouble_wrapper [])\n"); return NULL; } @@ -54556,7 +54874,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (signed char*) array_data(temp11); } - csr_plus_csr(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(signed char const (*))arg5,(int const (*))arg6,(int const (*))arg7,(signed char const (*))arg8,arg9,arg10,arg11); + csr_plus_csr< int,signed char >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(signed char const (*))arg5,(int const (*))arg6,(int const (*))arg7,(signed char const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -54730,7 +55048,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (unsigned char*) array_data(temp11); } - csr_plus_csr(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned char const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned char const (*))arg8,arg9,arg10,arg11); + csr_plus_csr< int,unsigned char >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned char const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned char const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -54904,7 +55222,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (short*) array_data(temp11); } - csr_plus_csr(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(short const (*))arg5,(int const (*))arg6,(int const (*))arg7,(short const (*))arg8,arg9,arg10,arg11); + csr_plus_csr< int,short >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(short const (*))arg5,(int const (*))arg6,(int const (*))arg7,(short const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -55078,7 +55396,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (unsigned short*) array_data(temp11); } - csr_plus_csr(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned short const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned short const (*))arg8,arg9,arg10,arg11); + csr_plus_csr< int,unsigned short >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned short const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned short const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -55252,7 +55570,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (int*) array_data(temp11); } - csr_plus_csr(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(int const (*))arg5,(int const (*))arg6,(int const (*))arg7,(int const (*))arg8,arg9,arg10,arg11); + csr_plus_csr< int,int >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(int const (*))arg5,(int const (*))arg6,(int const (*))arg7,(int const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -55426,7 +55744,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (unsigned int*) array_data(temp11); } - csr_plus_csr(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned int const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned int const (*))arg8,arg9,arg10,arg11); + csr_plus_csr< int,unsigned int >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned int const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned int const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -55600,7 +55918,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (long long*) array_data(temp11); } - csr_plus_csr(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long long const (*))arg5,(int const (*))arg6,(int const (*))arg7,(long long const (*))arg8,arg9,arg10,arg11); + csr_plus_csr< int,long long >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long long const (*))arg5,(int const (*))arg6,(int const (*))arg7,(long long const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -55774,7 +56092,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (unsigned long long*) array_data(temp11); } - csr_plus_csr(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned long long const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned long long const (*))arg8,arg9,arg10,arg11); + csr_plus_csr< int,unsigned long long >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned long long const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned long long const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -55948,7 +56266,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (float*) array_data(temp11); } - csr_plus_csr(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(float const (*))arg5,(int const (*))arg6,(int const (*))arg7,(float const (*))arg8,arg9,arg10,arg11); + csr_plus_csr< int,float >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(float const (*))arg5,(int const (*))arg6,(int const (*))arg7,(float const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -56122,7 +56440,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (double*) array_data(temp11); } - csr_plus_csr(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(double const (*))arg5,(int const (*))arg6,(int const (*))arg7,(double const (*))arg8,arg9,arg10,arg11); + csr_plus_csr< int,double >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(double const (*))arg5,(int const (*))arg6,(int const (*))arg7,(double const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -56296,7 +56614,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (long double*) array_data(temp11); } - csr_plus_csr(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long double const (*))arg5,(int const (*))arg6,(int const (*))arg7,(long double const (*))arg8,arg9,arg10,arg11); + csr_plus_csr< int,long double >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long double const (*))arg5,(int const (*))arg6,(int const (*))arg7,(long double const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -56470,7 +56788,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (npy_cfloat_wrapper*) array_data(temp11); } - csr_plus_csr(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cfloat_wrapper const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_cfloat_wrapper const (*))arg8,arg9,arg10,arg11); + csr_plus_csr< int,npy_cfloat_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cfloat_wrapper const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_cfloat_wrapper const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -56644,7 +56962,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (npy_cdouble_wrapper*) array_data(temp11); } - csr_plus_csr(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cdouble_wrapper const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_cdouble_wrapper const (*))arg8,arg9,arg10,arg11); + csr_plus_csr< int,npy_cdouble_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cdouble_wrapper const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_cdouble_wrapper const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -56818,7 +57136,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (npy_clongdouble_wrapper*) array_data(temp11); } - csr_plus_csr(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_clongdouble_wrapper const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_clongdouble_wrapper const (*))arg8,arg9,arg10,arg11); + csr_plus_csr< int,npy_clongdouble_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_clongdouble_wrapper const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_clongdouble_wrapper const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -57728,7 +58046,22 @@ } fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'csr_plus_csr'.\n Possible C/C++ prototypes are:\n"" csr_plus_csr<(int,signed char)>(int const,int const,int const [],int const [],signed char const [],int const [],int const [],signed char const [],int [],int [],signed char [])\n"" csr_plus_csr<(int,unsigned char)>(int const,int const,int const [],int const [],unsigned char const [],int const [],int const [],unsigned char const [],int [],int [],unsigned char [])\n"" csr_plus_csr<(int,short)>(int const,int const,int const [],int const [],short const [],int const [],int const [],short const [],int [],int [],short [])\n"" csr_plus_csr<(int,unsigned short)>(int const,int const,int const [],int const [],unsigned short const [],int const [],int const [],unsigned short const [],int [],int [],unsigned short [])\n"" csr_plus_csr<(int,int)>(int const,int const,int const [],int const [],int const [],int const [],int const [],int const [],int [],int [],int [])\n"" csr_plus_csr<(int,unsigned int)>(int const,int const,int const [],int const [],unsigned int const [],int const [],int const [],unsigned int const [],int [],int [],unsigned int [])\n"" csr_plus_csr<(int,long long)>(int const,int const,int const [],int const [],long long const [],int const [],int const [],long long const [],int [],int [],long long [])\n"" csr_plus_csr<(int,unsigned long long)>(int const,int const,int const [],int const [],unsigned long long const [],int const [],int const [],unsigned long long const [],int [],int [],unsigned long long [])\n"" csr_plus_csr<(int,float)>(int const,int const,int const [],int const [],float const [],int const [],int const [],float const [],int [],int [],float [])\n"" csr_plus_csr<(int,double)>(int const,int const,int const [],int const [],double const [],int const [],int const [],double const [],int [],int [],double [])\n"" csr_plus_csr<(int,long double)>(int const,int const,int const [],int const [],long double const [],int const [],int const [],long double const [],int [],int [],long double [])\n"" csr_plus_csr<(int,npy_cfloat_wrapper)>(int const,int const,int const [],int const [],npy_cfloat_wrapper const [],int const [],int const [],npy_cfloat_wrapper const [],int [],int [],npy_cfloat_wrapper [])\n"" csr_plus_csr<(int,npy_cdouble_wrapper)>(int const,int const,int const [],int const [],npy_cdouble_wrapper const [],int const [],int const [],npy_cdouble_wrapper const [],int [],int [],npy_cdouble_wrapper [])\n"" csr_plus_csr<(int,npy_clongdouble_wrapper)>(int const,int const,int const [],int const [],npy_clongdouble_wrapper const [],int const [],int const [],npy_clongdouble_wrapper const [],int [],int [],npy_clongdouble_wrapper [])\n"); + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'csr_plus_csr'.\n" + " Possible C/C++ prototypes are:\n" + " csr_plus_csr< int,signed char >(int const,int const,int const [],int const [],signed char const [],int const [],int const [],signed char const [],int [],int [],signed char [])\n" + " csr_plus_csr< int,unsigned char >(int const,int const,int const [],int const [],unsigned char const [],int const [],int const [],unsigned char const [],int [],int [],unsigned char [])\n" + " csr_plus_csr< int,short >(int const,int const,int const [],int const [],short const [],int const [],int const [],short const [],int [],int [],short [])\n" + " csr_plus_csr< int,unsigned short >(int const,int const,int const [],int const [],unsigned short const [],int const [],int const [],unsigned short const [],int [],int [],unsigned short [])\n" + " csr_plus_csr< int,int >(int const,int const,int const [],int const [],int const [],int const [],int const [],int const [],int [],int [],int [])\n" + " csr_plus_csr< int,unsigned int >(int const,int const,int const [],int const [],unsigned int const [],int const [],int const [],unsigned int const [],int [],int [],unsigned int [])\n" + " csr_plus_csr< int,long long >(int const,int const,int const [],int const [],long long const [],int const [],int const [],long long const [],int [],int [],long long [])\n" + " csr_plus_csr< int,unsigned long long >(int const,int const,int const [],int const [],unsigned long long const [],int const [],int const [],unsigned long long const [],int [],int [],unsigned long long [])\n" + " csr_plus_csr< int,float >(int const,int const,int const [],int const [],float const [],int const [],int const [],float const [],int [],int [],float [])\n" + " csr_plus_csr< int,double >(int const,int const,int const [],int const [],double const [],int const [],int const [],double const [],int [],int [],double [])\n" + " csr_plus_csr< int,long double >(int const,int const,int const [],int const [],long double const [],int const [],int const [],long double const [],int [],int [],long double [])\n" + " csr_plus_csr< int,npy_cfloat_wrapper >(int const,int const,int const [],int const [],npy_cfloat_wrapper const [],int const [],int const [],npy_cfloat_wrapper const [],int [],int [],npy_cfloat_wrapper [])\n" + " csr_plus_csr< int,npy_cdouble_wrapper >(int const,int const,int const [],int const [],npy_cdouble_wrapper const [],int const [],int const [],npy_cdouble_wrapper const [],int [],int [],npy_cdouble_wrapper [])\n" + " csr_plus_csr< int,npy_clongdouble_wrapper >(int const,int const,int const [],int const [],npy_clongdouble_wrapper const [],int const [],int const [],npy_clongdouble_wrapper const [],int [],int [],npy_clongdouble_wrapper [])\n"); return NULL; } @@ -57863,7 +58196,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (signed char*) array_data(temp11); } - csr_minus_csr(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(signed char const (*))arg5,(int const (*))arg6,(int const (*))arg7,(signed char const (*))arg8,arg9,arg10,arg11); + csr_minus_csr< int,signed char >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(signed char const (*))arg5,(int const (*))arg6,(int const (*))arg7,(signed char const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -58037,7 +58370,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (unsigned char*) array_data(temp11); } - csr_minus_csr(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned char const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned char const (*))arg8,arg9,arg10,arg11); + csr_minus_csr< int,unsigned char >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned char const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned char const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -58211,7 +58544,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (short*) array_data(temp11); } - csr_minus_csr(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(short const (*))arg5,(int const (*))arg6,(int const (*))arg7,(short const (*))arg8,arg9,arg10,arg11); + csr_minus_csr< int,short >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(short const (*))arg5,(int const (*))arg6,(int const (*))arg7,(short const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -58385,7 +58718,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (unsigned short*) array_data(temp11); } - csr_minus_csr(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned short const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned short const (*))arg8,arg9,arg10,arg11); + csr_minus_csr< int,unsigned short >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned short const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned short const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -58559,7 +58892,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (int*) array_data(temp11); } - csr_minus_csr(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(int const (*))arg5,(int const (*))arg6,(int const (*))arg7,(int const (*))arg8,arg9,arg10,arg11); + csr_minus_csr< int,int >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(int const (*))arg5,(int const (*))arg6,(int const (*))arg7,(int const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -58733,7 +59066,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (unsigned int*) array_data(temp11); } - csr_minus_csr(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned int const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned int const (*))arg8,arg9,arg10,arg11); + csr_minus_csr< int,unsigned int >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned int const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned int const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -58907,7 +59240,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (long long*) array_data(temp11); } - csr_minus_csr(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long long const (*))arg5,(int const (*))arg6,(int const (*))arg7,(long long const (*))arg8,arg9,arg10,arg11); + csr_minus_csr< int,long long >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long long const (*))arg5,(int const (*))arg6,(int const (*))arg7,(long long const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -59081,7 +59414,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (unsigned long long*) array_data(temp11); } - csr_minus_csr(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned long long const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned long long const (*))arg8,arg9,arg10,arg11); + csr_minus_csr< int,unsigned long long >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned long long const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned long long const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -59255,7 +59588,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (float*) array_data(temp11); } - csr_minus_csr(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(float const (*))arg5,(int const (*))arg6,(int const (*))arg7,(float const (*))arg8,arg9,arg10,arg11); + csr_minus_csr< int,float >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(float const (*))arg5,(int const (*))arg6,(int const (*))arg7,(float const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -59429,7 +59762,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (double*) array_data(temp11); } - csr_minus_csr(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(double const (*))arg5,(int const (*))arg6,(int const (*))arg7,(double const (*))arg8,arg9,arg10,arg11); + csr_minus_csr< int,double >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(double const (*))arg5,(int const (*))arg6,(int const (*))arg7,(double const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -59603,7 +59936,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (long double*) array_data(temp11); } - csr_minus_csr(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long double const (*))arg5,(int const (*))arg6,(int const (*))arg7,(long double const (*))arg8,arg9,arg10,arg11); + csr_minus_csr< int,long double >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long double const (*))arg5,(int const (*))arg6,(int const (*))arg7,(long double const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -59777,7 +60110,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (npy_cfloat_wrapper*) array_data(temp11); } - csr_minus_csr(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cfloat_wrapper const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_cfloat_wrapper const (*))arg8,arg9,arg10,arg11); + csr_minus_csr< int,npy_cfloat_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cfloat_wrapper const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_cfloat_wrapper const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -59951,7 +60284,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (npy_cdouble_wrapper*) array_data(temp11); } - csr_minus_csr(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cdouble_wrapper const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_cdouble_wrapper const (*))arg8,arg9,arg10,arg11); + csr_minus_csr< int,npy_cdouble_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cdouble_wrapper const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_cdouble_wrapper const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -60125,7 +60458,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (npy_clongdouble_wrapper*) array_data(temp11); } - csr_minus_csr(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_clongdouble_wrapper const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_clongdouble_wrapper const (*))arg8,arg9,arg10,arg11); + csr_minus_csr< int,npy_clongdouble_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_clongdouble_wrapper const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_clongdouble_wrapper const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -61035,7 +61368,22 @@ } fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'csr_minus_csr'.\n Possible C/C++ prototypes are:\n"" csr_minus_csr<(int,signed char)>(int const,int const,int const [],int const [],signed char const [],int const [],int const [],signed char const [],int [],int [],signed char [])\n"" csr_minus_csr<(int,unsigned char)>(int const,int const,int const [],int const [],unsigned char const [],int const [],int const [],unsigned char const [],int [],int [],unsigned char [])\n"" csr_minus_csr<(int,short)>(int const,int const,int const [],int const [],short const [],int const [],int const [],short const [],int [],int [],short [])\n"" csr_minus_csr<(int,unsigned short)>(int const,int const,int const [],int const [],unsigned short const [],int const [],int const [],unsigned short const [],int [],int [],unsigned short [])\n"" csr_minus_csr<(int,int)>(int const,int const,int const [],int const [],int const [],int const [],int const [],int const [],int [],int [],int [])\n"" csr_minus_csr<(int,unsigned int)>(int const,int const,int const [],int const [],unsigned int const [],int const [],int const [],unsigned int const [],int [],int [],unsigned int [])\n"" csr_minus_csr<(int,long long)>(int const,int const,int const [],int const [],long long const [],int const [],int const [],long long const [],int [],int [],long long [])\n"" csr_minus_csr<(int,unsigned long long)>(int const,int const,int const [],int const [],unsigned long long const [],int const [],int const [],unsigned long long const [],int [],int [],unsigned long long [])\n"" csr_minus_csr<(int,float)>(int const,int const,int const [],int const [],float const [],int const [],int const [],float const [],int [],int [],float [])\n"" csr_minus_csr<(int,double)>(int const,int const,int const [],int const [],double const [],int const [],int const [],double const [],int [],int [],double [])\n"" csr_minus_csr<(int,long double)>(int const,int const,int const [],int const [],long double const [],int const [],int const [],long double const [],int [],int [],long double [])\n"" csr_minus_csr<(int,npy_cfloat_wrapper)>(int const,int const,int const [],int const [],npy_cfloat_wrapper const [],int const [],int const [],npy_cfloat_wrapper const [],int [],int [],npy_cfloat_wrapper [])\n"" csr_minus_csr<(int,npy_cdouble_wrapper)>(int const,int const,int const [],int const [],npy_cdouble_wrapper const [],int const [],int const [],npy_cdouble_wrapper const [],int [],int [],npy_cdouble_wrapper [])\n"" csr_minus_csr<(int,npy_clongdouble_wrapper)>(int const,int const,int const [],int const [],npy_clongdouble_wrapper const [],int const [],int const [],npy_clongdouble_wrapper const [],int [],int [],npy_clongdouble_wrapper [])\n"); + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'csr_minus_csr'.\n" + " Possible C/C++ prototypes are:\n" + " csr_minus_csr< int,signed char >(int const,int const,int const [],int const [],signed char const [],int const [],int const [],signed char const [],int [],int [],signed char [])\n" + " csr_minus_csr< int,unsigned char >(int const,int const,int const [],int const [],unsigned char const [],int const [],int const [],unsigned char const [],int [],int [],unsigned char [])\n" + " csr_minus_csr< int,short >(int const,int const,int const [],int const [],short const [],int const [],int const [],short const [],int [],int [],short [])\n" + " csr_minus_csr< int,unsigned short >(int const,int const,int const [],int const [],unsigned short const [],int const [],int const [],unsigned short const [],int [],int [],unsigned short [])\n" + " csr_minus_csr< int,int >(int const,int const,int const [],int const [],int const [],int const [],int const [],int const [],int [],int [],int [])\n" + " csr_minus_csr< int,unsigned int >(int const,int const,int const [],int const [],unsigned int const [],int const [],int const [],unsigned int const [],int [],int [],unsigned int [])\n" + " csr_minus_csr< int,long long >(int const,int const,int const [],int const [],long long const [],int const [],int const [],long long const [],int [],int [],long long [])\n" + " csr_minus_csr< int,unsigned long long >(int const,int const,int const [],int const [],unsigned long long const [],int const [],int const [],unsigned long long const [],int [],int [],unsigned long long [])\n" + " csr_minus_csr< int,float >(int const,int const,int const [],int const [],float const [],int const [],int const [],float const [],int [],int [],float [])\n" + " csr_minus_csr< int,double >(int const,int const,int const [],int const [],double const [],int const [],int const [],double const [],int [],int [],double [])\n" + " csr_minus_csr< int,long double >(int const,int const,int const [],int const [],long double const [],int const [],int const [],long double const [],int [],int [],long double [])\n" + " csr_minus_csr< int,npy_cfloat_wrapper >(int const,int const,int const [],int const [],npy_cfloat_wrapper const [],int const [],int const [],npy_cfloat_wrapper const [],int [],int [],npy_cfloat_wrapper [])\n" + " csr_minus_csr< int,npy_cdouble_wrapper >(int const,int const,int const [],int const [],npy_cdouble_wrapper const [],int const [],int const [],npy_cdouble_wrapper const [],int [],int [],npy_cdouble_wrapper [])\n" + " csr_minus_csr< int,npy_clongdouble_wrapper >(int const,int const,int const [],int const [],npy_clongdouble_wrapper const [],int const [],int const [],npy_clongdouble_wrapper const [],int [],int [],npy_clongdouble_wrapper [])\n"); return NULL; } @@ -61170,7 +61518,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (signed char*) array_data(temp11); } - csc_elmul_csc(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(signed char const (*))arg5,(int const (*))arg6,(int const (*))arg7,(signed char const (*))arg8,arg9,arg10,arg11); + csc_elmul_csc< int,signed char >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(signed char const (*))arg5,(int const (*))arg6,(int const (*))arg7,(signed char const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -61344,7 +61692,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (unsigned char*) array_data(temp11); } - csc_elmul_csc(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned char const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned char const (*))arg8,arg9,arg10,arg11); + csc_elmul_csc< int,unsigned char >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned char const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned char const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -61518,7 +61866,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (short*) array_data(temp11); } - csc_elmul_csc(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(short const (*))arg5,(int const (*))arg6,(int const (*))arg7,(short const (*))arg8,arg9,arg10,arg11); + csc_elmul_csc< int,short >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(short const (*))arg5,(int const (*))arg6,(int const (*))arg7,(short const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -61692,7 +62040,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (unsigned short*) array_data(temp11); } - csc_elmul_csc(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned short const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned short const (*))arg8,arg9,arg10,arg11); + csc_elmul_csc< int,unsigned short >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned short const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned short const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -61866,7 +62214,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (int*) array_data(temp11); } - csc_elmul_csc(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(int const (*))arg5,(int const (*))arg6,(int const (*))arg7,(int const (*))arg8,arg9,arg10,arg11); + csc_elmul_csc< int,int >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(int const (*))arg5,(int const (*))arg6,(int const (*))arg7,(int const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -62040,7 +62388,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (unsigned int*) array_data(temp11); } - csc_elmul_csc(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned int const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned int const (*))arg8,arg9,arg10,arg11); + csc_elmul_csc< int,unsigned int >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned int const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned int const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -62214,7 +62562,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (long long*) array_data(temp11); } - csc_elmul_csc(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long long const (*))arg5,(int const (*))arg6,(int const (*))arg7,(long long const (*))arg8,arg9,arg10,arg11); + csc_elmul_csc< int,long long >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long long const (*))arg5,(int const (*))arg6,(int const (*))arg7,(long long const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -62388,7 +62736,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (unsigned long long*) array_data(temp11); } - csc_elmul_csc(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned long long const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned long long const (*))arg8,arg9,arg10,arg11); + csc_elmul_csc< int,unsigned long long >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned long long const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned long long const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -62562,7 +62910,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (float*) array_data(temp11); } - csc_elmul_csc(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(float const (*))arg5,(int const (*))arg6,(int const (*))arg7,(float const (*))arg8,arg9,arg10,arg11); + csc_elmul_csc< int,float >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(float const (*))arg5,(int const (*))arg6,(int const (*))arg7,(float const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -62736,7 +63084,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (double*) array_data(temp11); } - csc_elmul_csc(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(double const (*))arg5,(int const (*))arg6,(int const (*))arg7,(double const (*))arg8,arg9,arg10,arg11); + csc_elmul_csc< int,double >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(double const (*))arg5,(int const (*))arg6,(int const (*))arg7,(double const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -62910,7 +63258,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (long double*) array_data(temp11); } - csc_elmul_csc(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long double const (*))arg5,(int const (*))arg6,(int const (*))arg7,(long double const (*))arg8,arg9,arg10,arg11); + csc_elmul_csc< int,long double >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long double const (*))arg5,(int const (*))arg6,(int const (*))arg7,(long double const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -63084,7 +63432,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (npy_cfloat_wrapper*) array_data(temp11); } - csc_elmul_csc(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cfloat_wrapper const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_cfloat_wrapper const (*))arg8,arg9,arg10,arg11); + csc_elmul_csc< int,npy_cfloat_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cfloat_wrapper const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_cfloat_wrapper const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -63258,7 +63606,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (npy_cdouble_wrapper*) array_data(temp11); } - csc_elmul_csc(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cdouble_wrapper const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_cdouble_wrapper const (*))arg8,arg9,arg10,arg11); + csc_elmul_csc< int,npy_cdouble_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cdouble_wrapper const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_cdouble_wrapper const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -63432,7 +63780,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (npy_clongdouble_wrapper*) array_data(temp11); } - csc_elmul_csc(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_clongdouble_wrapper const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_clongdouble_wrapper const (*))arg8,arg9,arg10,arg11); + csc_elmul_csc< int,npy_clongdouble_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_clongdouble_wrapper const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_clongdouble_wrapper const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -64342,7 +64690,22 @@ } fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'csc_elmul_csc'.\n Possible C/C++ prototypes are:\n"" csc_elmul_csc<(int,signed char)>(int const,int const,int const [],int const [],signed char const [],int const [],int const [],signed char const [],int [],int [],signed char [])\n"" csc_elmul_csc<(int,unsigned char)>(int const,int const,int const [],int const [],unsigned char const [],int const [],int const [],unsigned char const [],int [],int [],unsigned char [])\n"" csc_elmul_csc<(int,short)>(int const,int const,int const [],int const [],short const [],int const [],int const [],short const [],int [],int [],short [])\n"" csc_elmul_csc<(int,unsigned short)>(int const,int const,int const [],int const [],unsigned short const [],int const [],int const [],unsigned short const [],int [],int [],unsigned short [])\n"" csc_elmul_csc<(int,int)>(int const,int const,int const [],int const [],int const [],int const [],int const [],int const [],int [],int [],int [])\n"" csc_elmul_csc<(int,unsigned int)>(int const,int const,int const [],int const [],unsigned int const [],int const [],int const [],unsigned int const [],int [],int [],unsigned int [])\n"" csc_elmul_csc<(int,long long)>(int const,int const,int const [],int const [],long long const [],int const [],int const [],long long const [],int [],int [],long long [])\n"" csc_elmul_csc<(int,unsigned long long)>(int const,int const,int const [],int const [],unsigned long long const [],int const [],int const [],unsigned long long const [],int [],int [],unsigned long long [])\n"" csc_elmul_csc<(int,float)>(int const,int const,int const [],int const [],float const [],int const [],int const [],float const [],int [],int [],float [])\n"" csc_elmul_csc<(int,double)>(int const,int const,int const [],int const [],double const [],int const [],int const [],double const [],int [],int [],double [])\n"" csc_elmul_csc<(int,long double)>(int const,int const,int const [],int const [],long double const [],int const [],int const [],long double const [],int [],int [],long double [])\n"" csc_elmul_csc<(int,npy_cfloat_wrapper)>(int const,int const,int const [],int const [],npy_cfloat_wrapper const [],int const [],int const [],npy_cfloat_wrapper const [],int [],int [],npy_cfloat_wrapper [])\n"" csc_elmul_csc<(int,npy_cdouble_wrapper)>(int const,int const,int const [],int const [],npy_cdouble_wrapper const [],int const [],int const [],npy_cdouble_wrapper const [],int [],int [],npy_cdouble_wrapper [])\n"" csc_elmul_csc<(int,npy_clongdouble_wrapper)>(int const,int const,int const [],int const [],npy_clongdouble_wrapper const [],int const [],int const [],npy_clongdouble_wrapper const [],int [],int [],npy_clongdouble_wrapper [])\n"); + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'csc_elmul_csc'.\n" + " Possible C/C++ prototypes are:\n" + " csc_elmul_csc< int,signed char >(int const,int const,int const [],int const [],signed char const [],int const [],int const [],signed char const [],int [],int [],signed char [])\n" + " csc_elmul_csc< int,unsigned char >(int const,int const,int const [],int const [],unsigned char const [],int const [],int const [],unsigned char const [],int [],int [],unsigned char [])\n" + " csc_elmul_csc< int,short >(int const,int const,int const [],int const [],short const [],int const [],int const [],short const [],int [],int [],short [])\n" + " csc_elmul_csc< int,unsigned short >(int const,int const,int const [],int const [],unsigned short const [],int const [],int const [],unsigned short const [],int [],int [],unsigned short [])\n" + " csc_elmul_csc< int,int >(int const,int const,int const [],int const [],int const [],int const [],int const [],int const [],int [],int [],int [])\n" + " csc_elmul_csc< int,unsigned int >(int const,int const,int const [],int const [],unsigned int const [],int const [],int const [],unsigned int const [],int [],int [],unsigned int [])\n" + " csc_elmul_csc< int,long long >(int const,int const,int const [],int const [],long long const [],int const [],int const [],long long const [],int [],int [],long long [])\n" + " csc_elmul_csc< int,unsigned long long >(int const,int const,int const [],int const [],unsigned long long const [],int const [],int const [],unsigned long long const [],int [],int [],unsigned long long [])\n" + " csc_elmul_csc< int,float >(int const,int const,int const [],int const [],float const [],int const [],int const [],float const [],int [],int [],float [])\n" + " csc_elmul_csc< int,double >(int const,int const,int const [],int const [],double const [],int const [],int const [],double const [],int [],int [],double [])\n" + " csc_elmul_csc< int,long double >(int const,int const,int const [],int const [],long double const [],int const [],int const [],long double const [],int [],int [],long double [])\n" + " csc_elmul_csc< int,npy_cfloat_wrapper >(int const,int const,int const [],int const [],npy_cfloat_wrapper const [],int const [],int const [],npy_cfloat_wrapper const [],int [],int [],npy_cfloat_wrapper [])\n" + " csc_elmul_csc< int,npy_cdouble_wrapper >(int const,int const,int const [],int const [],npy_cdouble_wrapper const [],int const [],int const [],npy_cdouble_wrapper const [],int [],int [],npy_cdouble_wrapper [])\n" + " csc_elmul_csc< int,npy_clongdouble_wrapper >(int const,int const,int const [],int const [],npy_clongdouble_wrapper const [],int const [],int const [],npy_clongdouble_wrapper const [],int [],int [],npy_clongdouble_wrapper [])\n"); return NULL; } @@ -64477,7 +64840,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (signed char*) array_data(temp11); } - csc_eldiv_csc(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(signed char const (*))arg5,(int const (*))arg6,(int const (*))arg7,(signed char const (*))arg8,arg9,arg10,arg11); + csc_eldiv_csc< int,signed char >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(signed char const (*))arg5,(int const (*))arg6,(int const (*))arg7,(signed char const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -64651,7 +65014,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (unsigned char*) array_data(temp11); } - csc_eldiv_csc(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned char const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned char const (*))arg8,arg9,arg10,arg11); + csc_eldiv_csc< int,unsigned char >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned char const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned char const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -64825,7 +65188,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (short*) array_data(temp11); } - csc_eldiv_csc(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(short const (*))arg5,(int const (*))arg6,(int const (*))arg7,(short const (*))arg8,arg9,arg10,arg11); + csc_eldiv_csc< int,short >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(short const (*))arg5,(int const (*))arg6,(int const (*))arg7,(short const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -64999,7 +65362,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (unsigned short*) array_data(temp11); } - csc_eldiv_csc(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned short const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned short const (*))arg8,arg9,arg10,arg11); + csc_eldiv_csc< int,unsigned short >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned short const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned short const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -65173,7 +65536,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (int*) array_data(temp11); } - csc_eldiv_csc(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(int const (*))arg5,(int const (*))arg6,(int const (*))arg7,(int const (*))arg8,arg9,arg10,arg11); + csc_eldiv_csc< int,int >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(int const (*))arg5,(int const (*))arg6,(int const (*))arg7,(int const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -65347,7 +65710,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (unsigned int*) array_data(temp11); } - csc_eldiv_csc(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned int const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned int const (*))arg8,arg9,arg10,arg11); + csc_eldiv_csc< int,unsigned int >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned int const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned int const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -65521,7 +65884,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (long long*) array_data(temp11); } - csc_eldiv_csc(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long long const (*))arg5,(int const (*))arg6,(int const (*))arg7,(long long const (*))arg8,arg9,arg10,arg11); + csc_eldiv_csc< int,long long >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long long const (*))arg5,(int const (*))arg6,(int const (*))arg7,(long long const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -65695,7 +66058,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (unsigned long long*) array_data(temp11); } - csc_eldiv_csc(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned long long const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned long long const (*))arg8,arg9,arg10,arg11); + csc_eldiv_csc< int,unsigned long long >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned long long const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned long long const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -65869,7 +66232,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (float*) array_data(temp11); } - csc_eldiv_csc(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(float const (*))arg5,(int const (*))arg6,(int const (*))arg7,(float const (*))arg8,arg9,arg10,arg11); + csc_eldiv_csc< int,float >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(float const (*))arg5,(int const (*))arg6,(int const (*))arg7,(float const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -66043,7 +66406,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (double*) array_data(temp11); } - csc_eldiv_csc(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(double const (*))arg5,(int const (*))arg6,(int const (*))arg7,(double const (*))arg8,arg9,arg10,arg11); + csc_eldiv_csc< int,double >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(double const (*))arg5,(int const (*))arg6,(int const (*))arg7,(double const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -66217,7 +66580,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (long double*) array_data(temp11); } - csc_eldiv_csc(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long double const (*))arg5,(int const (*))arg6,(int const (*))arg7,(long double const (*))arg8,arg9,arg10,arg11); + csc_eldiv_csc< int,long double >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long double const (*))arg5,(int const (*))arg6,(int const (*))arg7,(long double const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -66391,7 +66754,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (npy_cfloat_wrapper*) array_data(temp11); } - csc_eldiv_csc(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cfloat_wrapper const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_cfloat_wrapper const (*))arg8,arg9,arg10,arg11); + csc_eldiv_csc< int,npy_cfloat_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cfloat_wrapper const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_cfloat_wrapper const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -66565,7 +66928,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (npy_cdouble_wrapper*) array_data(temp11); } - csc_eldiv_csc(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cdouble_wrapper const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_cdouble_wrapper const (*))arg8,arg9,arg10,arg11); + csc_eldiv_csc< int,npy_cdouble_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cdouble_wrapper const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_cdouble_wrapper const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -66739,7 +67102,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (npy_clongdouble_wrapper*) array_data(temp11); } - csc_eldiv_csc(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_clongdouble_wrapper const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_clongdouble_wrapper const (*))arg8,arg9,arg10,arg11); + csc_eldiv_csc< int,npy_clongdouble_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_clongdouble_wrapper const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_clongdouble_wrapper const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -67649,7 +68012,22 @@ } fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'csc_eldiv_csc'.\n Possible C/C++ prototypes are:\n"" csc_eldiv_csc<(int,signed char)>(int const,int const,int const [],int const [],signed char const [],int const [],int const [],signed char const [],int [],int [],signed char [])\n"" csc_eldiv_csc<(int,unsigned char)>(int const,int const,int const [],int const [],unsigned char const [],int const [],int const [],unsigned char const [],int [],int [],unsigned char [])\n"" csc_eldiv_csc<(int,short)>(int const,int const,int const [],int const [],short const [],int const [],int const [],short const [],int [],int [],short [])\n"" csc_eldiv_csc<(int,unsigned short)>(int const,int const,int const [],int const [],unsigned short const [],int const [],int const [],unsigned short const [],int [],int [],unsigned short [])\n"" csc_eldiv_csc<(int,int)>(int const,int const,int const [],int const [],int const [],int const [],int const [],int const [],int [],int [],int [])\n"" csc_eldiv_csc<(int,unsigned int)>(int const,int const,int const [],int const [],unsigned int const [],int const [],int const [],unsigned int const [],int [],int [],unsigned int [])\n"" csc_eldiv_csc<(int,long long)>(int const,int const,int const [],int const [],long long const [],int const [],int const [],long long const [],int [],int [],long long [])\n"" csc_eldiv_csc<(int,unsigned long long)>(int const,int const,int const [],int const [],unsigned long long const [],int const [],int const [],unsigned long long const [],int [],int [],unsigned long long [])\n"" csc_eldiv_csc<(int,float)>(int const,int const,int const [],int const [],float const [],int const [],int const [],float const [],int [],int [],float [])\n"" csc_eldiv_csc<(int,double)>(int const,int const,int const [],int const [],double const [],int const [],int const [],double const [],int [],int [],double [])\n"" csc_eldiv_csc<(int,long double)>(int const,int const,int const [],int const [],long double const [],int const [],int const [],long double const [],int [],int [],long double [])\n"" csc_eldiv_csc<(int,npy_cfloat_wrapper)>(int const,int const,int const [],int const [],npy_cfloat_wrapper const [],int const [],int const [],npy_cfloat_wrapper const [],int [],int [],npy_cfloat_wrapper [])\n"" csc_eldiv_csc<(int,npy_cdouble_wrapper)>(int const,int const,int const [],int const [],npy_cdouble_wrapper const [],int const [],int const [],npy_cdouble_wrapper const [],int [],int [],npy_cdouble_wrapper [])\n"" csc_eldiv_csc<(int,npy_clongdouble_wrapper)>(int const,int const,int const [],int const [],npy_clongdouble_wrapper const [],int const [],int const [],npy_clongdouble_wrapper const [],int [],int [],npy_clongdouble_wrapper [])\n"); + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'csc_eldiv_csc'.\n" + " Possible C/C++ prototypes are:\n" + " csc_eldiv_csc< int,signed char >(int const,int const,int const [],int const [],signed char const [],int const [],int const [],signed char const [],int [],int [],signed char [])\n" + " csc_eldiv_csc< int,unsigned char >(int const,int const,int const [],int const [],unsigned char const [],int const [],int const [],unsigned char const [],int [],int [],unsigned char [])\n" + " csc_eldiv_csc< int,short >(int const,int const,int const [],int const [],short const [],int const [],int const [],short const [],int [],int [],short [])\n" + " csc_eldiv_csc< int,unsigned short >(int const,int const,int const [],int const [],unsigned short const [],int const [],int const [],unsigned short const [],int [],int [],unsigned short [])\n" + " csc_eldiv_csc< int,int >(int const,int const,int const [],int const [],int const [],int const [],int const [],int const [],int [],int [],int [])\n" + " csc_eldiv_csc< int,unsigned int >(int const,int const,int const [],int const [],unsigned int const [],int const [],int const [],unsigned int const [],int [],int [],unsigned int [])\n" + " csc_eldiv_csc< int,long long >(int const,int const,int const [],int const [],long long const [],int const [],int const [],long long const [],int [],int [],long long [])\n" + " csc_eldiv_csc< int,unsigned long long >(int const,int const,int const [],int const [],unsigned long long const [],int const [],int const [],unsigned long long const [],int [],int [],unsigned long long [])\n" + " csc_eldiv_csc< int,float >(int const,int const,int const [],int const [],float const [],int const [],int const [],float const [],int [],int [],float [])\n" + " csc_eldiv_csc< int,double >(int const,int const,int const [],int const [],double const [],int const [],int const [],double const [],int [],int [],double [])\n" + " csc_eldiv_csc< int,long double >(int const,int const,int const [],int const [],long double const [],int const [],int const [],long double const [],int [],int [],long double [])\n" + " csc_eldiv_csc< int,npy_cfloat_wrapper >(int const,int const,int const [],int const [],npy_cfloat_wrapper const [],int const [],int const [],npy_cfloat_wrapper const [],int [],int [],npy_cfloat_wrapper [])\n" + " csc_eldiv_csc< int,npy_cdouble_wrapper >(int const,int const,int const [],int const [],npy_cdouble_wrapper const [],int const [],int const [],npy_cdouble_wrapper const [],int [],int [],npy_cdouble_wrapper [])\n" + " csc_eldiv_csc< int,npy_clongdouble_wrapper >(int const,int const,int const [],int const [],npy_clongdouble_wrapper const [],int const [],int const [],npy_clongdouble_wrapper const [],int [],int [],npy_clongdouble_wrapper [])\n"); return NULL; } @@ -67784,7 +68162,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (signed char*) array_data(temp11); } - csc_plus_csc(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(signed char const (*))arg5,(int const (*))arg6,(int const (*))arg7,(signed char const (*))arg8,arg9,arg10,arg11); + csc_plus_csc< int,signed char >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(signed char const (*))arg5,(int const (*))arg6,(int const (*))arg7,(signed char const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -67958,7 +68336,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (unsigned char*) array_data(temp11); } - csc_plus_csc(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned char const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned char const (*))arg8,arg9,arg10,arg11); + csc_plus_csc< int,unsigned char >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned char const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned char const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -68132,7 +68510,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (short*) array_data(temp11); } - csc_plus_csc(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(short const (*))arg5,(int const (*))arg6,(int const (*))arg7,(short const (*))arg8,arg9,arg10,arg11); + csc_plus_csc< int,short >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(short const (*))arg5,(int const (*))arg6,(int const (*))arg7,(short const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -68306,7 +68684,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (unsigned short*) array_data(temp11); } - csc_plus_csc(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned short const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned short const (*))arg8,arg9,arg10,arg11); + csc_plus_csc< int,unsigned short >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned short const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned short const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -68480,7 +68858,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (int*) array_data(temp11); } - csc_plus_csc(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(int const (*))arg5,(int const (*))arg6,(int const (*))arg7,(int const (*))arg8,arg9,arg10,arg11); + csc_plus_csc< int,int >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(int const (*))arg5,(int const (*))arg6,(int const (*))arg7,(int const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -68654,7 +69032,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (unsigned int*) array_data(temp11); } - csc_plus_csc(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned int const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned int const (*))arg8,arg9,arg10,arg11); + csc_plus_csc< int,unsigned int >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned int const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned int const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -68828,7 +69206,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (long long*) array_data(temp11); } - csc_plus_csc(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long long const (*))arg5,(int const (*))arg6,(int const (*))arg7,(long long const (*))arg8,arg9,arg10,arg11); + csc_plus_csc< int,long long >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long long const (*))arg5,(int const (*))arg6,(int const (*))arg7,(long long const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -69002,7 +69380,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (unsigned long long*) array_data(temp11); } - csc_plus_csc(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned long long const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned long long const (*))arg8,arg9,arg10,arg11); + csc_plus_csc< int,unsigned long long >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned long long const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned long long const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -69176,7 +69554,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (float*) array_data(temp11); } - csc_plus_csc(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(float const (*))arg5,(int const (*))arg6,(int const (*))arg7,(float const (*))arg8,arg9,arg10,arg11); + csc_plus_csc< int,float >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(float const (*))arg5,(int const (*))arg6,(int const (*))arg7,(float const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -69350,7 +69728,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (double*) array_data(temp11); } - csc_plus_csc(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(double const (*))arg5,(int const (*))arg6,(int const (*))arg7,(double const (*))arg8,arg9,arg10,arg11); + csc_plus_csc< int,double >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(double const (*))arg5,(int const (*))arg6,(int const (*))arg7,(double const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -69524,7 +69902,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (long double*) array_data(temp11); } - csc_plus_csc(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long double const (*))arg5,(int const (*))arg6,(int const (*))arg7,(long double const (*))arg8,arg9,arg10,arg11); + csc_plus_csc< int,long double >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long double const (*))arg5,(int const (*))arg6,(int const (*))arg7,(long double const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -69698,7 +70076,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (npy_cfloat_wrapper*) array_data(temp11); } - csc_plus_csc(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cfloat_wrapper const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_cfloat_wrapper const (*))arg8,arg9,arg10,arg11); + csc_plus_csc< int,npy_cfloat_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cfloat_wrapper const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_cfloat_wrapper const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -69872,7 +70250,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (npy_cdouble_wrapper*) array_data(temp11); } - csc_plus_csc(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cdouble_wrapper const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_cdouble_wrapper const (*))arg8,arg9,arg10,arg11); + csc_plus_csc< int,npy_cdouble_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cdouble_wrapper const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_cdouble_wrapper const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -70046,7 +70424,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (npy_clongdouble_wrapper*) array_data(temp11); } - csc_plus_csc(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_clongdouble_wrapper const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_clongdouble_wrapper const (*))arg8,arg9,arg10,arg11); + csc_plus_csc< int,npy_clongdouble_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_clongdouble_wrapper const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_clongdouble_wrapper const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -70956,7 +71334,22 @@ } fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'csc_plus_csc'.\n Possible C/C++ prototypes are:\n"" csc_plus_csc<(int,signed char)>(int const,int const,int const [],int const [],signed char const [],int const [],int const [],signed char const [],int [],int [],signed char [])\n"" csc_plus_csc<(int,unsigned char)>(int const,int const,int const [],int const [],unsigned char const [],int const [],int const [],unsigned char const [],int [],int [],unsigned char [])\n"" csc_plus_csc<(int,short)>(int const,int const,int const [],int const [],short const [],int const [],int const [],short const [],int [],int [],short [])\n"" csc_plus_csc<(int,unsigned short)>(int const,int const,int const [],int const [],unsigned short const [],int const [],int const [],unsigned short const [],int [],int [],unsigned short [])\n"" csc_plus_csc<(int,int)>(int const,int const,int const [],int const [],int const [],int const [],int const [],int const [],int [],int [],int [])\n"" csc_plus_csc<(int,unsigned int)>(int const,int const,int const [],int const [],unsigned int const [],int const [],int const [],unsigned int const [],int [],int [],unsigned int [])\n"" csc_plus_csc<(int,long long)>(int const,int const,int const [],int const [],long long const [],int const [],int const [],long long const [],int [],int [],long long [])\n"" csc_plus_csc<(int,unsigned long long)>(int const,int const,int const [],int const [],unsigned long long const [],int const [],int const [],unsigned long long const [],int [],int [],unsigned long long [])\n"" csc_plus_csc<(int,float)>(int const,int const,int const [],int const [],float const [],int const [],int const [],float const [],int [],int [],float [])\n"" csc_plus_csc<(int,double)>(int const,int const,int const [],int const [],double const [],int const [],int const [],double const [],int [],int [],double [])\n"" csc_plus_csc<(int,long double)>(int const,int const,int const [],int const [],long double const [],int const [],int const [],long double const [],int [],int [],long double [])\n"" csc_plus_csc<(int,npy_cfloat_wrapper)>(int const,int const,int const [],int const [],npy_cfloat_wrapper const [],int const [],int const [],npy_cfloat_wrapper const [],int [],int [],npy_cfloat_wrapper [])\n"" csc_plus_csc<(int,npy_cdouble_wrapper)>(int const,int const,int const [],int const [],npy_cdouble_wrapper const [],int const [],int const [],npy_cdouble_wrapper const [],int [],int [],npy_cdouble_wrapper [])\n"" csc_plus_csc<(int,npy_clongdouble_wrapper)>(int const,int const,int const [],int const [],npy_clongdouble_wrapper const [],int const [],int const [],npy_clongdouble_wrapper const [],int [],int [],npy_clongdouble_wrapper [])\n"); + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'csc_plus_csc'.\n" + " Possible C/C++ prototypes are:\n" + " csc_plus_csc< int,signed char >(int const,int const,int const [],int const [],signed char const [],int const [],int const [],signed char const [],int [],int [],signed char [])\n" + " csc_plus_csc< int,unsigned char >(int const,int const,int const [],int const [],unsigned char const [],int const [],int const [],unsigned char const [],int [],int [],unsigned char [])\n" + " csc_plus_csc< int,short >(int const,int const,int const [],int const [],short const [],int const [],int const [],short const [],int [],int [],short [])\n" + " csc_plus_csc< int,unsigned short >(int const,int const,int const [],int const [],unsigned short const [],int const [],int const [],unsigned short const [],int [],int [],unsigned short [])\n" + " csc_plus_csc< int,int >(int const,int const,int const [],int const [],int const [],int const [],int const [],int const [],int [],int [],int [])\n" + " csc_plus_csc< int,unsigned int >(int const,int const,int const [],int const [],unsigned int const [],int const [],int const [],unsigned int const [],int [],int [],unsigned int [])\n" + " csc_plus_csc< int,long long >(int const,int const,int const [],int const [],long long const [],int const [],int const [],long long const [],int [],int [],long long [])\n" + " csc_plus_csc< int,unsigned long long >(int const,int const,int const [],int const [],unsigned long long const [],int const [],int const [],unsigned long long const [],int [],int [],unsigned long long [])\n" + " csc_plus_csc< int,float >(int const,int const,int const [],int const [],float const [],int const [],int const [],float const [],int [],int [],float [])\n" + " csc_plus_csc< int,double >(int const,int const,int const [],int const [],double const [],int const [],int const [],double const [],int [],int [],double [])\n" + " csc_plus_csc< int,long double >(int const,int const,int const [],int const [],long double const [],int const [],int const [],long double const [],int [],int [],long double [])\n" + " csc_plus_csc< int,npy_cfloat_wrapper >(int const,int const,int const [],int const [],npy_cfloat_wrapper const [],int const [],int const [],npy_cfloat_wrapper const [],int [],int [],npy_cfloat_wrapper [])\n" + " csc_plus_csc< int,npy_cdouble_wrapper >(int const,int const,int const [],int const [],npy_cdouble_wrapper const [],int const [],int const [],npy_cdouble_wrapper const [],int [],int [],npy_cdouble_wrapper [])\n" + " csc_plus_csc< int,npy_clongdouble_wrapper >(int const,int const,int const [],int const [],npy_clongdouble_wrapper const [],int const [],int const [],npy_clongdouble_wrapper const [],int [],int [],npy_clongdouble_wrapper [])\n"); return NULL; } @@ -71091,7 +71484,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (signed char*) array_data(temp11); } - csc_minus_csc(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(signed char const (*))arg5,(int const (*))arg6,(int const (*))arg7,(signed char const (*))arg8,arg9,arg10,arg11); + csc_minus_csc< int,signed char >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(signed char const (*))arg5,(int const (*))arg6,(int const (*))arg7,(signed char const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -71265,7 +71658,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (unsigned char*) array_data(temp11); } - csc_minus_csc(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned char const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned char const (*))arg8,arg9,arg10,arg11); + csc_minus_csc< int,unsigned char >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned char const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned char const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -71439,7 +71832,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (short*) array_data(temp11); } - csc_minus_csc(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(short const (*))arg5,(int const (*))arg6,(int const (*))arg7,(short const (*))arg8,arg9,arg10,arg11); + csc_minus_csc< int,short >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(short const (*))arg5,(int const (*))arg6,(int const (*))arg7,(short const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -71613,7 +72006,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (unsigned short*) array_data(temp11); } - csc_minus_csc(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned short const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned short const (*))arg8,arg9,arg10,arg11); + csc_minus_csc< int,unsigned short >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned short const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned short const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -71787,7 +72180,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (int*) array_data(temp11); } - csc_minus_csc(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(int const (*))arg5,(int const (*))arg6,(int const (*))arg7,(int const (*))arg8,arg9,arg10,arg11); + csc_minus_csc< int,int >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(int const (*))arg5,(int const (*))arg6,(int const (*))arg7,(int const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -71961,7 +72354,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (unsigned int*) array_data(temp11); } - csc_minus_csc(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned int const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned int const (*))arg8,arg9,arg10,arg11); + csc_minus_csc< int,unsigned int >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned int const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned int const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -72135,7 +72528,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (long long*) array_data(temp11); } - csc_minus_csc(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long long const (*))arg5,(int const (*))arg6,(int const (*))arg7,(long long const (*))arg8,arg9,arg10,arg11); + csc_minus_csc< int,long long >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long long const (*))arg5,(int const (*))arg6,(int const (*))arg7,(long long const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -72309,7 +72702,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (unsigned long long*) array_data(temp11); } - csc_minus_csc(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned long long const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned long long const (*))arg8,arg9,arg10,arg11); + csc_minus_csc< int,unsigned long long >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned long long const (*))arg5,(int const (*))arg6,(int const (*))arg7,(unsigned long long const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -72483,7 +72876,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (float*) array_data(temp11); } - csc_minus_csc(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(float const (*))arg5,(int const (*))arg6,(int const (*))arg7,(float const (*))arg8,arg9,arg10,arg11); + csc_minus_csc< int,float >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(float const (*))arg5,(int const (*))arg6,(int const (*))arg7,(float const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -72657,7 +73050,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (double*) array_data(temp11); } - csc_minus_csc(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(double const (*))arg5,(int const (*))arg6,(int const (*))arg7,(double const (*))arg8,arg9,arg10,arg11); + csc_minus_csc< int,double >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(double const (*))arg5,(int const (*))arg6,(int const (*))arg7,(double const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -72831,7 +73224,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (long double*) array_data(temp11); } - csc_minus_csc(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long double const (*))arg5,(int const (*))arg6,(int const (*))arg7,(long double const (*))arg8,arg9,arg10,arg11); + csc_minus_csc< int,long double >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long double const (*))arg5,(int const (*))arg6,(int const (*))arg7,(long double const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -73005,7 +73398,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (npy_cfloat_wrapper*) array_data(temp11); } - csc_minus_csc(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cfloat_wrapper const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_cfloat_wrapper const (*))arg8,arg9,arg10,arg11); + csc_minus_csc< int,npy_cfloat_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cfloat_wrapper const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_cfloat_wrapper const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -73179,7 +73572,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (npy_cdouble_wrapper*) array_data(temp11); } - csc_minus_csc(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cdouble_wrapper const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_cdouble_wrapper const (*))arg8,arg9,arg10,arg11); + csc_minus_csc< int,npy_cdouble_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cdouble_wrapper const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_cdouble_wrapper const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -73353,7 +73746,7 @@ if (!temp11 || !require_contiguous(temp11) || !require_native(temp11)) SWIG_fail; arg11 = (npy_clongdouble_wrapper*) array_data(temp11); } - csc_minus_csc(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_clongdouble_wrapper const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_clongdouble_wrapper const (*))arg8,arg9,arg10,arg11); + csc_minus_csc< int,npy_clongdouble_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_clongdouble_wrapper const (*))arg5,(int const (*))arg6,(int const (*))arg7,(npy_clongdouble_wrapper const (*))arg8,arg9,arg10,arg11); resultobj = SWIG_Py_Void(); { if (is_new_object3 && array3) Py_DECREF(array3); @@ -74263,7 +74656,22 @@ } fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'csc_minus_csc'.\n Possible C/C++ prototypes are:\n"" csc_minus_csc<(int,signed char)>(int const,int const,int const [],int const [],signed char const [],int const [],int const [],signed char const [],int [],int [],signed char [])\n"" csc_minus_csc<(int,unsigned char)>(int const,int const,int const [],int const [],unsigned char const [],int const [],int const [],unsigned char const [],int [],int [],unsigned char [])\n"" csc_minus_csc<(int,short)>(int const,int const,int const [],int const [],short const [],int const [],int const [],short const [],int [],int [],short [])\n"" csc_minus_csc<(int,unsigned short)>(int const,int const,int const [],int const [],unsigned short const [],int const [],int const [],unsigned short const [],int [],int [],unsigned short [])\n"" csc_minus_csc<(int,int)>(int const,int const,int const [],int const [],int const [],int const [],int const [],int const [],int [],int [],int [])\n"" csc_minus_csc<(int,unsigned int)>(int const,int const,int const [],int const [],unsigned int const [],int const [],int const [],unsigned int const [],int [],int [],unsigned int [])\n"" csc_minus_csc<(int,long long)>(int const,int const,int const [],int const [],long long const [],int const [],int const [],long long const [],int [],int [],long long [])\n"" csc_minus_csc<(int,unsigned long long)>(int const,int const,int const [],int const [],unsigned long long const [],int const [],int const [],unsigned long long const [],int [],int [],unsigned long long [])\n"" csc_minus_csc<(int,float)>(int const,int const,int const [],int const [],float const [],int const [],int const [],float const [],int [],int [],float [])\n"" csc_minus_csc<(int,double)>(int const,int const,int const [],int const [],double const [],int const [],int const [],double const [],int [],int [],double [])\n"" csc_minus_csc<(int,long double)>(int const,int const,int const [],int const [],long double const [],int const [],int const [],long double const [],int [],int [],long double [])\n"" csc_minus_csc<(int,npy_cfloat_wrapper)>(int const,int const,int const [],int const [],npy_cfloat_wrapper const [],int const [],int const [],npy_cfloat_wrapper const [],int [],int [],npy_cfloat_wrapper [])\n"" csc_minus_csc<(int,npy_cdouble_wrapper)>(int const,int const,int const [],int const [],npy_cdouble_wrapper const [],int const [],int const [],npy_cdouble_wrapper const [],int [],int [],npy_cdouble_wrapper [])\n"" csc_minus_csc<(int,npy_clongdouble_wrapper)>(int const,int const,int const [],int const [],npy_clongdouble_wrapper const [],int const [],int const [],npy_clongdouble_wrapper const [],int [],int [],npy_clongdouble_wrapper [])\n"); + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'csc_minus_csc'.\n" + " Possible C/C++ prototypes are:\n" + " csc_minus_csc< int,signed char >(int const,int const,int const [],int const [],signed char const [],int const [],int const [],signed char const [],int [],int [],signed char [])\n" + " csc_minus_csc< int,unsigned char >(int const,int const,int const [],int const [],unsigned char const [],int const [],int const [],unsigned char const [],int [],int [],unsigned char [])\n" + " csc_minus_csc< int,short >(int const,int const,int const [],int const [],short const [],int const [],int const [],short const [],int [],int [],short [])\n" + " csc_minus_csc< int,unsigned short >(int const,int const,int const [],int const [],unsigned short const [],int const [],int const [],unsigned short const [],int [],int [],unsigned short [])\n" + " csc_minus_csc< int,int >(int const,int const,int const [],int const [],int const [],int const [],int const [],int const [],int [],int [],int [])\n" + " csc_minus_csc< int,unsigned int >(int const,int const,int const [],int const [],unsigned int const [],int const [],int const [],unsigned int const [],int [],int [],unsigned int [])\n" + " csc_minus_csc< int,long long >(int const,int const,int const [],int const [],long long const [],int const [],int const [],long long const [],int [],int [],long long [])\n" + " csc_minus_csc< int,unsigned long long >(int const,int const,int const [],int const [],unsigned long long const [],int const [],int const [],unsigned long long const [],int [],int [],unsigned long long [])\n" + " csc_minus_csc< int,float >(int const,int const,int const [],int const [],float const [],int const [],int const [],float const [],int [],int [],float [])\n" + " csc_minus_csc< int,double >(int const,int const,int const [],int const [],double const [],int const [],int const [],double const [],int [],int [],double [])\n" + " csc_minus_csc< int,long double >(int const,int const,int const [],int const [],long double const [],int const [],int const [],long double const [],int [],int [],long double [])\n" + " csc_minus_csc< int,npy_cfloat_wrapper >(int const,int const,int const [],int const [],npy_cfloat_wrapper const [],int const [],int const [],npy_cfloat_wrapper const [],int [],int [],npy_cfloat_wrapper [])\n" + " csc_minus_csc< int,npy_cdouble_wrapper >(int const,int const,int const [],int const [],npy_cdouble_wrapper const [],int const [],int const [],npy_cdouble_wrapper const [],int [],int [],npy_cdouble_wrapper [])\n" + " csc_minus_csc< int,npy_clongdouble_wrapper >(int const,int const,int const [],int const [],npy_clongdouble_wrapper const [],int const [],int const [],npy_clongdouble_wrapper const [],int [],int [],npy_clongdouble_wrapper [])\n"); return NULL; } @@ -74416,7 +74824,7 @@ if (!temp13 || !require_contiguous(temp13) || !require_native(temp13)) SWIG_fail; arg13 = (signed char*) array_data(temp13); } - bsr_elmul_bsr(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(signed char const (*))arg7,(int const (*))arg8,(int const (*))arg9,(signed char const (*))arg10,arg11,arg12,arg13); + bsr_elmul_bsr< int,signed char >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(signed char const (*))arg7,(int const (*))arg8,(int const (*))arg9,(signed char const (*))arg10,arg11,arg12,arg13); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -74608,7 +75016,7 @@ if (!temp13 || !require_contiguous(temp13) || !require_native(temp13)) SWIG_fail; arg13 = (unsigned char*) array_data(temp13); } - bsr_elmul_bsr(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(unsigned char const (*))arg7,(int const (*))arg8,(int const (*))arg9,(unsigned char const (*))arg10,arg11,arg12,arg13); + bsr_elmul_bsr< int,unsigned char >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(unsigned char const (*))arg7,(int const (*))arg8,(int const (*))arg9,(unsigned char const (*))arg10,arg11,arg12,arg13); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -74800,7 +75208,7 @@ if (!temp13 || !require_contiguous(temp13) || !require_native(temp13)) SWIG_fail; arg13 = (short*) array_data(temp13); } - bsr_elmul_bsr(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(short const (*))arg7,(int const (*))arg8,(int const (*))arg9,(short const (*))arg10,arg11,arg12,arg13); + bsr_elmul_bsr< int,short >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(short const (*))arg7,(int const (*))arg8,(int const (*))arg9,(short const (*))arg10,arg11,arg12,arg13); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -74992,7 +75400,7 @@ if (!temp13 || !require_contiguous(temp13) || !require_native(temp13)) SWIG_fail; arg13 = (unsigned short*) array_data(temp13); } - bsr_elmul_bsr(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(unsigned short const (*))arg7,(int const (*))arg8,(int const (*))arg9,(unsigned short const (*))arg10,arg11,arg12,arg13); + bsr_elmul_bsr< int,unsigned short >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(unsigned short const (*))arg7,(int const (*))arg8,(int const (*))arg9,(unsigned short const (*))arg10,arg11,arg12,arg13); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -75184,7 +75592,7 @@ if (!temp13 || !require_contiguous(temp13) || !require_native(temp13)) SWIG_fail; arg13 = (int*) array_data(temp13); } - bsr_elmul_bsr(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(int const (*))arg7,(int const (*))arg8,(int const (*))arg9,(int const (*))arg10,arg11,arg12,arg13); + bsr_elmul_bsr< int,int >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(int const (*))arg7,(int const (*))arg8,(int const (*))arg9,(int const (*))arg10,arg11,arg12,arg13); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -75376,7 +75784,7 @@ if (!temp13 || !require_contiguous(temp13) || !require_native(temp13)) SWIG_fail; arg13 = (unsigned int*) array_data(temp13); } - bsr_elmul_bsr(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(unsigned int const (*))arg7,(int const (*))arg8,(int const (*))arg9,(unsigned int const (*))arg10,arg11,arg12,arg13); + bsr_elmul_bsr< int,unsigned int >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(unsigned int const (*))arg7,(int const (*))arg8,(int const (*))arg9,(unsigned int const (*))arg10,arg11,arg12,arg13); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -75568,7 +75976,7 @@ if (!temp13 || !require_contiguous(temp13) || !require_native(temp13)) SWIG_fail; arg13 = (long long*) array_data(temp13); } - bsr_elmul_bsr(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(long long const (*))arg7,(int const (*))arg8,(int const (*))arg9,(long long const (*))arg10,arg11,arg12,arg13); + bsr_elmul_bsr< int,long long >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(long long const (*))arg7,(int const (*))arg8,(int const (*))arg9,(long long const (*))arg10,arg11,arg12,arg13); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -75760,7 +76168,7 @@ if (!temp13 || !require_contiguous(temp13) || !require_native(temp13)) SWIG_fail; arg13 = (unsigned long long*) array_data(temp13); } - bsr_elmul_bsr(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(unsigned long long const (*))arg7,(int const (*))arg8,(int const (*))arg9,(unsigned long long const (*))arg10,arg11,arg12,arg13); + bsr_elmul_bsr< int,unsigned long long >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(unsigned long long const (*))arg7,(int const (*))arg8,(int const (*))arg9,(unsigned long long const (*))arg10,arg11,arg12,arg13); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -75952,7 +76360,7 @@ if (!temp13 || !require_contiguous(temp13) || !require_native(temp13)) SWIG_fail; arg13 = (float*) array_data(temp13); } - bsr_elmul_bsr(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(float const (*))arg7,(int const (*))arg8,(int const (*))arg9,(float const (*))arg10,arg11,arg12,arg13); + bsr_elmul_bsr< int,float >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(float const (*))arg7,(int const (*))arg8,(int const (*))arg9,(float const (*))arg10,arg11,arg12,arg13); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -76144,7 +76552,7 @@ if (!temp13 || !require_contiguous(temp13) || !require_native(temp13)) SWIG_fail; arg13 = (double*) array_data(temp13); } - bsr_elmul_bsr(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(double const (*))arg7,(int const (*))arg8,(int const (*))arg9,(double const (*))arg10,arg11,arg12,arg13); + bsr_elmul_bsr< int,double >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(double const (*))arg7,(int const (*))arg8,(int const (*))arg9,(double const (*))arg10,arg11,arg12,arg13); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -76336,7 +76744,7 @@ if (!temp13 || !require_contiguous(temp13) || !require_native(temp13)) SWIG_fail; arg13 = (long double*) array_data(temp13); } - bsr_elmul_bsr(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(long double const (*))arg7,(int const (*))arg8,(int const (*))arg9,(long double const (*))arg10,arg11,arg12,arg13); + bsr_elmul_bsr< int,long double >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(long double const (*))arg7,(int const (*))arg8,(int const (*))arg9,(long double const (*))arg10,arg11,arg12,arg13); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -76528,7 +76936,7 @@ if (!temp13 || !require_contiguous(temp13) || !require_native(temp13)) SWIG_fail; arg13 = (npy_cfloat_wrapper*) array_data(temp13); } - bsr_elmul_bsr(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(npy_cfloat_wrapper const (*))arg7,(int const (*))arg8,(int const (*))arg9,(npy_cfloat_wrapper const (*))arg10,arg11,arg12,arg13); + bsr_elmul_bsr< int,npy_cfloat_wrapper >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(npy_cfloat_wrapper const (*))arg7,(int const (*))arg8,(int const (*))arg9,(npy_cfloat_wrapper const (*))arg10,arg11,arg12,arg13); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -76720,7 +77128,7 @@ if (!temp13 || !require_contiguous(temp13) || !require_native(temp13)) SWIG_fail; arg13 = (npy_cdouble_wrapper*) array_data(temp13); } - bsr_elmul_bsr(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(npy_cdouble_wrapper const (*))arg7,(int const (*))arg8,(int const (*))arg9,(npy_cdouble_wrapper const (*))arg10,arg11,arg12,arg13); + bsr_elmul_bsr< int,npy_cdouble_wrapper >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(npy_cdouble_wrapper const (*))arg7,(int const (*))arg8,(int const (*))arg9,(npy_cdouble_wrapper const (*))arg10,arg11,arg12,arg13); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -76912,7 +77320,7 @@ if (!temp13 || !require_contiguous(temp13) || !require_native(temp13)) SWIG_fail; arg13 = (npy_clongdouble_wrapper*) array_data(temp13); } - bsr_elmul_bsr(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(npy_clongdouble_wrapper const (*))arg7,(int const (*))arg8,(int const (*))arg9,(npy_clongdouble_wrapper const (*))arg10,arg11,arg12,arg13); + bsr_elmul_bsr< int,npy_clongdouble_wrapper >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(npy_clongdouble_wrapper const (*))arg7,(int const (*))arg8,(int const (*))arg9,(npy_clongdouble_wrapper const (*))arg10,arg11,arg12,arg13); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -77990,7 +78398,22 @@ } fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'bsr_elmul_bsr'.\n Possible C/C++ prototypes are:\n"" bsr_elmul_bsr<(int,signed char)>(int const,int const,int const,int const,int const [],int const [],signed char const [],int const [],int const [],signed char const [],int [],int [],signed char [])\n"" bsr_elmul_bsr<(int,unsigned char)>(int const,int const,int const,int const,int const [],int const [],unsigned char const [],int const [],int const [],unsigned char const [],int [],int [],unsigned char [])\n"" bsr_elmul_bsr<(int,short)>(int const,int const,int const,int const,int const [],int const [],short const [],int const [],int const [],short const [],int [],int [],short [])\n"" bsr_elmul_bsr<(int,unsigned short)>(int const,int const,int const,int const,int const [],int const [],unsigned short const [],int const [],int const [],unsigned short const [],int [],int [],unsigned short [])\n"" bsr_elmul_bsr<(int,int)>(int const,int const,int const,int const,int const [],int const [],int const [],int const [],int const [],int const [],int [],int [],int [])\n"" bsr_elmul_bsr<(int,unsigned int)>(int const,int const,int const,int const,int const [],int const [],unsigned int const [],int const [],int const [],unsigned int const [],int [],int [],unsigned int [])\n"" bsr_elmul_bsr<(int,long long)>(int const,int const,int const,int const,int const [],int const [],long long const [],int const [],int const [],long long const [],int [],int [],long long [])\n"" bsr_elmul_bsr<(int,unsigned long long)>(int const,int const,int const,int const,int const [],int const [],unsigned long long const [],int const [],int const [],unsigned long long const [],int [],int [],unsigned long long [])\n"" bsr_elmul_bsr<(int,float)>(int const,int const,int const,int const,int const [],int const [],float const [],int const [],int const [],float const [],int [],int [],float [])\n"" bsr_elmul_bsr<(int,double)>(int const,int const,int const,int const,int const [],int const [],double const [],int const [],int const [],double const [],int [],int [],double [])\n"" bsr_elmul_bsr<(int,long double)>(int const,int const,int const,int const,int const [],int const [],long double const [],int const [],int const [],long double const [],int [],int [],long double [])\n"" bsr_elmul_bsr<(int,npy_cfloat_wrapper)>(int const,int const,int const,int const,int const [],int const [],npy_cfloat_wrapper const [],int const [],int const [],npy_cfloat_wrapper const [],int [],int [],npy_cfloat_wrapper [])\n"" bsr_elmul_bsr<(int,npy_cdouble_wrapper)>(int const,int const,int const,int const,int const [],int const [],npy_cdouble_wrapper const [],int const [],int const [],npy_cdouble_wrapper const [],int [],int [],npy_cdouble_wrapper [])\n"" bsr_elmul_bsr<(int,npy_clongdouble_wrapper)>(int const,int const,int const,int const,int const [],int const [],npy_clongdouble_wrapper const [],int const [],int const [],npy_clongdouble_wrapper const [],int [],int [],npy_clongdouble_wrapper [])\n"); + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'bsr_elmul_bsr'.\n" + " Possible C/C++ prototypes are:\n" + " bsr_elmul_bsr< int,signed char >(int const,int const,int const,int const,int const [],int const [],signed char const [],int const [],int const [],signed char const [],int [],int [],signed char [])\n" + " bsr_elmul_bsr< int,unsigned char >(int const,int const,int const,int const,int const [],int const [],unsigned char const [],int const [],int const [],unsigned char const [],int [],int [],unsigned char [])\n" + " bsr_elmul_bsr< int,short >(int const,int const,int const,int const,int const [],int const [],short const [],int const [],int const [],short const [],int [],int [],short [])\n" + " bsr_elmul_bsr< int,unsigned short >(int const,int const,int const,int const,int const [],int const [],unsigned short const [],int const [],int const [],unsigned short const [],int [],int [],unsigned short [])\n" + " bsr_elmul_bsr< int,int >(int const,int const,int const,int const,int const [],int const [],int const [],int const [],int const [],int const [],int [],int [],int [])\n" + " bsr_elmul_bsr< int,unsigned int >(int const,int const,int const,int const,int const [],int const [],unsigned int const [],int const [],int const [],unsigned int const [],int [],int [],unsigned int [])\n" + " bsr_elmul_bsr< int,long long >(int const,int const,int const,int const,int const [],int const [],long long const [],int const [],int const [],long long const [],int [],int [],long long [])\n" + " bsr_elmul_bsr< int,unsigned long long >(int const,int const,int const,int const,int const [],int const [],unsigned long long const [],int const [],int const [],unsigned long long const [],int [],int [],unsigned long long [])\n" + " bsr_elmul_bsr< int,float >(int const,int const,int const,int const,int const [],int const [],float const [],int const [],int const [],float const [],int [],int [],float [])\n" + " bsr_elmul_bsr< int,double >(int const,int const,int const,int const,int const [],int const [],double const [],int const [],int const [],double const [],int [],int [],double [])\n" + " bsr_elmul_bsr< int,long double >(int const,int const,int const,int const,int const [],int const [],long double const [],int const [],int const [],long double const [],int [],int [],long double [])\n" + " bsr_elmul_bsr< int,npy_cfloat_wrapper >(int const,int const,int const,int const,int const [],int const [],npy_cfloat_wrapper const [],int const [],int const [],npy_cfloat_wrapper const [],int [],int [],npy_cfloat_wrapper [])\n" + " bsr_elmul_bsr< int,npy_cdouble_wrapper >(int const,int const,int const,int const,int const [],int const [],npy_cdouble_wrapper const [],int const [],int const [],npy_cdouble_wrapper const [],int [],int [],npy_cdouble_wrapper [])\n" + " bsr_elmul_bsr< int,npy_clongdouble_wrapper >(int const,int const,int const,int const,int const [],int const [],npy_clongdouble_wrapper const [],int const [],int const [],npy_clongdouble_wrapper const [],int [],int [],npy_clongdouble_wrapper [])\n"); return NULL; } @@ -78143,7 +78566,7 @@ if (!temp13 || !require_contiguous(temp13) || !require_native(temp13)) SWIG_fail; arg13 = (signed char*) array_data(temp13); } - bsr_eldiv_bsr(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(signed char const (*))arg7,(int const (*))arg8,(int const (*))arg9,(signed char const (*))arg10,arg11,arg12,arg13); + bsr_eldiv_bsr< int,signed char >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(signed char const (*))arg7,(int const (*))arg8,(int const (*))arg9,(signed char const (*))arg10,arg11,arg12,arg13); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -78335,7 +78758,7 @@ if (!temp13 || !require_contiguous(temp13) || !require_native(temp13)) SWIG_fail; arg13 = (unsigned char*) array_data(temp13); } - bsr_eldiv_bsr(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(unsigned char const (*))arg7,(int const (*))arg8,(int const (*))arg9,(unsigned char const (*))arg10,arg11,arg12,arg13); + bsr_eldiv_bsr< int,unsigned char >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(unsigned char const (*))arg7,(int const (*))arg8,(int const (*))arg9,(unsigned char const (*))arg10,arg11,arg12,arg13); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -78527,7 +78950,7 @@ if (!temp13 || !require_contiguous(temp13) || !require_native(temp13)) SWIG_fail; arg13 = (short*) array_data(temp13); } - bsr_eldiv_bsr(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(short const (*))arg7,(int const (*))arg8,(int const (*))arg9,(short const (*))arg10,arg11,arg12,arg13); + bsr_eldiv_bsr< int,short >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(short const (*))arg7,(int const (*))arg8,(int const (*))arg9,(short const (*))arg10,arg11,arg12,arg13); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -78719,7 +79142,7 @@ if (!temp13 || !require_contiguous(temp13) || !require_native(temp13)) SWIG_fail; arg13 = (unsigned short*) array_data(temp13); } - bsr_eldiv_bsr(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(unsigned short const (*))arg7,(int const (*))arg8,(int const (*))arg9,(unsigned short const (*))arg10,arg11,arg12,arg13); + bsr_eldiv_bsr< int,unsigned short >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(unsigned short const (*))arg7,(int const (*))arg8,(int const (*))arg9,(unsigned short const (*))arg10,arg11,arg12,arg13); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -78911,7 +79334,7 @@ if (!temp13 || !require_contiguous(temp13) || !require_native(temp13)) SWIG_fail; arg13 = (int*) array_data(temp13); } - bsr_eldiv_bsr(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(int const (*))arg7,(int const (*))arg8,(int const (*))arg9,(int const (*))arg10,arg11,arg12,arg13); + bsr_eldiv_bsr< int,int >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(int const (*))arg7,(int const (*))arg8,(int const (*))arg9,(int const (*))arg10,arg11,arg12,arg13); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -79103,7 +79526,7 @@ if (!temp13 || !require_contiguous(temp13) || !require_native(temp13)) SWIG_fail; arg13 = (unsigned int*) array_data(temp13); } - bsr_eldiv_bsr(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(unsigned int const (*))arg7,(int const (*))arg8,(int const (*))arg9,(unsigned int const (*))arg10,arg11,arg12,arg13); + bsr_eldiv_bsr< int,unsigned int >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(unsigned int const (*))arg7,(int const (*))arg8,(int const (*))arg9,(unsigned int const (*))arg10,arg11,arg12,arg13); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -79295,7 +79718,7 @@ if (!temp13 || !require_contiguous(temp13) || !require_native(temp13)) SWIG_fail; arg13 = (long long*) array_data(temp13); } - bsr_eldiv_bsr(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(long long const (*))arg7,(int const (*))arg8,(int const (*))arg9,(long long const (*))arg10,arg11,arg12,arg13); + bsr_eldiv_bsr< int,long long >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(long long const (*))arg7,(int const (*))arg8,(int const (*))arg9,(long long const (*))arg10,arg11,arg12,arg13); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -79487,7 +79910,7 @@ if (!temp13 || !require_contiguous(temp13) || !require_native(temp13)) SWIG_fail; arg13 = (unsigned long long*) array_data(temp13); } - bsr_eldiv_bsr(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(unsigned long long const (*))arg7,(int const (*))arg8,(int const (*))arg9,(unsigned long long const (*))arg10,arg11,arg12,arg13); + bsr_eldiv_bsr< int,unsigned long long >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(unsigned long long const (*))arg7,(int const (*))arg8,(int const (*))arg9,(unsigned long long const (*))arg10,arg11,arg12,arg13); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -79679,7 +80102,7 @@ if (!temp13 || !require_contiguous(temp13) || !require_native(temp13)) SWIG_fail; arg13 = (float*) array_data(temp13); } - bsr_eldiv_bsr(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(float const (*))arg7,(int const (*))arg8,(int const (*))arg9,(float const (*))arg10,arg11,arg12,arg13); + bsr_eldiv_bsr< int,float >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(float const (*))arg7,(int const (*))arg8,(int const (*))arg9,(float const (*))arg10,arg11,arg12,arg13); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -79871,7 +80294,7 @@ if (!temp13 || !require_contiguous(temp13) || !require_native(temp13)) SWIG_fail; arg13 = (double*) array_data(temp13); } - bsr_eldiv_bsr(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(double const (*))arg7,(int const (*))arg8,(int const (*))arg9,(double const (*))arg10,arg11,arg12,arg13); + bsr_eldiv_bsr< int,double >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(double const (*))arg7,(int const (*))arg8,(int const (*))arg9,(double const (*))arg10,arg11,arg12,arg13); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -80063,7 +80486,7 @@ if (!temp13 || !require_contiguous(temp13) || !require_native(temp13)) SWIG_fail; arg13 = (long double*) array_data(temp13); } - bsr_eldiv_bsr(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(long double const (*))arg7,(int const (*))arg8,(int const (*))arg9,(long double const (*))arg10,arg11,arg12,arg13); + bsr_eldiv_bsr< int,long double >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(long double const (*))arg7,(int const (*))arg8,(int const (*))arg9,(long double const (*))arg10,arg11,arg12,arg13); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -80255,7 +80678,7 @@ if (!temp13 || !require_contiguous(temp13) || !require_native(temp13)) SWIG_fail; arg13 = (npy_cfloat_wrapper*) array_data(temp13); } - bsr_eldiv_bsr(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(npy_cfloat_wrapper const (*))arg7,(int const (*))arg8,(int const (*))arg9,(npy_cfloat_wrapper const (*))arg10,arg11,arg12,arg13); + bsr_eldiv_bsr< int,npy_cfloat_wrapper >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(npy_cfloat_wrapper const (*))arg7,(int const (*))arg8,(int const (*))arg9,(npy_cfloat_wrapper const (*))arg10,arg11,arg12,arg13); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -80447,7 +80870,7 @@ if (!temp13 || !require_contiguous(temp13) || !require_native(temp13)) SWIG_fail; arg13 = (npy_cdouble_wrapper*) array_data(temp13); } - bsr_eldiv_bsr(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(npy_cdouble_wrapper const (*))arg7,(int const (*))arg8,(int const (*))arg9,(npy_cdouble_wrapper const (*))arg10,arg11,arg12,arg13); + bsr_eldiv_bsr< int,npy_cdouble_wrapper >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(npy_cdouble_wrapper const (*))arg7,(int const (*))arg8,(int const (*))arg9,(npy_cdouble_wrapper const (*))arg10,arg11,arg12,arg13); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -80639,7 +81062,7 @@ if (!temp13 || !require_contiguous(temp13) || !require_native(temp13)) SWIG_fail; arg13 = (npy_clongdouble_wrapper*) array_data(temp13); } - bsr_eldiv_bsr(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(npy_clongdouble_wrapper const (*))arg7,(int const (*))arg8,(int const (*))arg9,(npy_clongdouble_wrapper const (*))arg10,arg11,arg12,arg13); + bsr_eldiv_bsr< int,npy_clongdouble_wrapper >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(npy_clongdouble_wrapper const (*))arg7,(int const (*))arg8,(int const (*))arg9,(npy_clongdouble_wrapper const (*))arg10,arg11,arg12,arg13); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -81717,7 +82140,22 @@ } fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'bsr_eldiv_bsr'.\n Possible C/C++ prototypes are:\n"" bsr_eldiv_bsr<(int,signed char)>(int const,int const,int const,int const,int const [],int const [],signed char const [],int const [],int const [],signed char const [],int [],int [],signed char [])\n"" bsr_eldiv_bsr<(int,unsigned char)>(int const,int const,int const,int const,int const [],int const [],unsigned char const [],int const [],int const [],unsigned char const [],int [],int [],unsigned char [])\n"" bsr_eldiv_bsr<(int,short)>(int const,int const,int const,int const,int const [],int const [],short const [],int const [],int const [],short const [],int [],int [],short [])\n"" bsr_eldiv_bsr<(int,unsigned short)>(int const,int const,int const,int const,int const [],int const [],unsigned short const [],int const [],int const [],unsigned short const [],int [],int [],unsigned short [])\n"" bsr_eldiv_bsr<(int,int)>(int const,int const,int const,int const,int const [],int const [],int const [],int const [],int const [],int const [],int [],int [],int [])\n"" bsr_eldiv_bsr<(int,unsigned int)>(int const,int const,int const,int const,int const [],int const [],unsigned int const [],int const [],int const [],unsigned int const [],int [],int [],unsigned int [])\n"" bsr_eldiv_bsr<(int,long long)>(int const,int const,int const,int const,int const [],int const [],long long const [],int const [],int const [],long long const [],int [],int [],long long [])\n"" bsr_eldiv_bsr<(int,unsigned long long)>(int const,int const,int const,int const,int const [],int const [],unsigned long long const [],int const [],int const [],unsigned long long const [],int [],int [],unsigned long long [])\n"" bsr_eldiv_bsr<(int,float)>(int const,int const,int const,int const,int const [],int const [],float const [],int const [],int const [],float const [],int [],int [],float [])\n"" bsr_eldiv_bsr<(int,double)>(int const,int const,int const,int const,int const [],int const [],double const [],int const [],int const [],double const [],int [],int [],double [])\n"" bsr_eldiv_bsr<(int,long double)>(int const,int const,int const,int const,int const [],int const [],long double const [],int const [],int const [],long double const [],int [],int [],long double [])\n"" bsr_eldiv_bsr<(int,npy_cfloat_wrapper)>(int const,int const,int const,int const,int const [],int const [],npy_cfloat_wrapper const [],int const [],int const [],npy_cfloat_wrapper const [],int [],int [],npy_cfloat_wrapper [])\n"" bsr_eldiv_bsr<(int,npy_cdouble_wrapper)>(int const,int const,int const,int const,int const [],int const [],npy_cdouble_wrapper const [],int const [],int const [],npy_cdouble_wrapper const [],int [],int [],npy_cdouble_wrapper [])\n"" bsr_eldiv_bsr<(int,npy_clongdouble_wrapper)>(int const,int const,int const,int const,int const [],int const [],npy_clongdouble_wrapper const [],int const [],int const [],npy_clongdouble_wrapper const [],int [],int [],npy_clongdouble_wrapper [])\n"); + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'bsr_eldiv_bsr'.\n" + " Possible C/C++ prototypes are:\n" + " bsr_eldiv_bsr< int,signed char >(int const,int const,int const,int const,int const [],int const [],signed char const [],int const [],int const [],signed char const [],int [],int [],signed char [])\n" + " bsr_eldiv_bsr< int,unsigned char >(int const,int const,int const,int const,int const [],int const [],unsigned char const [],int const [],int const [],unsigned char const [],int [],int [],unsigned char [])\n" + " bsr_eldiv_bsr< int,short >(int const,int const,int const,int const,int const [],int const [],short const [],int const [],int const [],short const [],int [],int [],short [])\n" + " bsr_eldiv_bsr< int,unsigned short >(int const,int const,int const,int const,int const [],int const [],unsigned short const [],int const [],int const [],unsigned short const [],int [],int [],unsigned short [])\n" + " bsr_eldiv_bsr< int,int >(int const,int const,int const,int const,int const [],int const [],int const [],int const [],int const [],int const [],int [],int [],int [])\n" + " bsr_eldiv_bsr< int,unsigned int >(int const,int const,int const,int const,int const [],int const [],unsigned int const [],int const [],int const [],unsigned int const [],int [],int [],unsigned int [])\n" + " bsr_eldiv_bsr< int,long long >(int const,int const,int const,int const,int const [],int const [],long long const [],int const [],int const [],long long const [],int [],int [],long long [])\n" + " bsr_eldiv_bsr< int,unsigned long long >(int const,int const,int const,int const,int const [],int const [],unsigned long long const [],int const [],int const [],unsigned long long const [],int [],int [],unsigned long long [])\n" + " bsr_eldiv_bsr< int,float >(int const,int const,int const,int const,int const [],int const [],float const [],int const [],int const [],float const [],int [],int [],float [])\n" + " bsr_eldiv_bsr< int,double >(int const,int const,int const,int const,int const [],int const [],double const [],int const [],int const [],double const [],int [],int [],double [])\n" + " bsr_eldiv_bsr< int,long double >(int const,int const,int const,int const,int const [],int const [],long double const [],int const [],int const [],long double const [],int [],int [],long double [])\n" + " bsr_eldiv_bsr< int,npy_cfloat_wrapper >(int const,int const,int const,int const,int const [],int const [],npy_cfloat_wrapper const [],int const [],int const [],npy_cfloat_wrapper const [],int [],int [],npy_cfloat_wrapper [])\n" + " bsr_eldiv_bsr< int,npy_cdouble_wrapper >(int const,int const,int const,int const,int const [],int const [],npy_cdouble_wrapper const [],int const [],int const [],npy_cdouble_wrapper const [],int [],int [],npy_cdouble_wrapper [])\n" + " bsr_eldiv_bsr< int,npy_clongdouble_wrapper >(int const,int const,int const,int const,int const [],int const [],npy_clongdouble_wrapper const [],int const [],int const [],npy_clongdouble_wrapper const [],int [],int [],npy_clongdouble_wrapper [])\n"); return NULL; } @@ -81870,7 +82308,7 @@ if (!temp13 || !require_contiguous(temp13) || !require_native(temp13)) SWIG_fail; arg13 = (signed char*) array_data(temp13); } - bsr_plus_bsr(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(signed char const (*))arg7,(int const (*))arg8,(int const (*))arg9,(signed char const (*))arg10,arg11,arg12,arg13); + bsr_plus_bsr< int,signed char >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(signed char const (*))arg7,(int const (*))arg8,(int const (*))arg9,(signed char const (*))arg10,arg11,arg12,arg13); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -82062,7 +82500,7 @@ if (!temp13 || !require_contiguous(temp13) || !require_native(temp13)) SWIG_fail; arg13 = (unsigned char*) array_data(temp13); } - bsr_plus_bsr(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(unsigned char const (*))arg7,(int const (*))arg8,(int const (*))arg9,(unsigned char const (*))arg10,arg11,arg12,arg13); + bsr_plus_bsr< int,unsigned char >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(unsigned char const (*))arg7,(int const (*))arg8,(int const (*))arg9,(unsigned char const (*))arg10,arg11,arg12,arg13); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -82254,7 +82692,7 @@ if (!temp13 || !require_contiguous(temp13) || !require_native(temp13)) SWIG_fail; arg13 = (short*) array_data(temp13); } - bsr_plus_bsr(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(short const (*))arg7,(int const (*))arg8,(int const (*))arg9,(short const (*))arg10,arg11,arg12,arg13); + bsr_plus_bsr< int,short >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(short const (*))arg7,(int const (*))arg8,(int const (*))arg9,(short const (*))arg10,arg11,arg12,arg13); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -82446,7 +82884,7 @@ if (!temp13 || !require_contiguous(temp13) || !require_native(temp13)) SWIG_fail; arg13 = (unsigned short*) array_data(temp13); } - bsr_plus_bsr(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(unsigned short const (*))arg7,(int const (*))arg8,(int const (*))arg9,(unsigned short const (*))arg10,arg11,arg12,arg13); + bsr_plus_bsr< int,unsigned short >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(unsigned short const (*))arg7,(int const (*))arg8,(int const (*))arg9,(unsigned short const (*))arg10,arg11,arg12,arg13); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -82638,7 +83076,7 @@ if (!temp13 || !require_contiguous(temp13) || !require_native(temp13)) SWIG_fail; arg13 = (int*) array_data(temp13); } - bsr_plus_bsr(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(int const (*))arg7,(int const (*))arg8,(int const (*))arg9,(int const (*))arg10,arg11,arg12,arg13); + bsr_plus_bsr< int,int >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(int const (*))arg7,(int const (*))arg8,(int const (*))arg9,(int const (*))arg10,arg11,arg12,arg13); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -82830,7 +83268,7 @@ if (!temp13 || !require_contiguous(temp13) || !require_native(temp13)) SWIG_fail; arg13 = (unsigned int*) array_data(temp13); } - bsr_plus_bsr(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(unsigned int const (*))arg7,(int const (*))arg8,(int const (*))arg9,(unsigned int const (*))arg10,arg11,arg12,arg13); + bsr_plus_bsr< int,unsigned int >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(unsigned int const (*))arg7,(int const (*))arg8,(int const (*))arg9,(unsigned int const (*))arg10,arg11,arg12,arg13); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -83022,7 +83460,7 @@ if (!temp13 || !require_contiguous(temp13) || !require_native(temp13)) SWIG_fail; arg13 = (long long*) array_data(temp13); } - bsr_plus_bsr(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(long long const (*))arg7,(int const (*))arg8,(int const (*))arg9,(long long const (*))arg10,arg11,arg12,arg13); + bsr_plus_bsr< int,long long >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(long long const (*))arg7,(int const (*))arg8,(int const (*))arg9,(long long const (*))arg10,arg11,arg12,arg13); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -83214,7 +83652,7 @@ if (!temp13 || !require_contiguous(temp13) || !require_native(temp13)) SWIG_fail; arg13 = (unsigned long long*) array_data(temp13); } - bsr_plus_bsr(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(unsigned long long const (*))arg7,(int const (*))arg8,(int const (*))arg9,(unsigned long long const (*))arg10,arg11,arg12,arg13); + bsr_plus_bsr< int,unsigned long long >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(unsigned long long const (*))arg7,(int const (*))arg8,(int const (*))arg9,(unsigned long long const (*))arg10,arg11,arg12,arg13); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -83406,7 +83844,7 @@ if (!temp13 || !require_contiguous(temp13) || !require_native(temp13)) SWIG_fail; arg13 = (float*) array_data(temp13); } - bsr_plus_bsr(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(float const (*))arg7,(int const (*))arg8,(int const (*))arg9,(float const (*))arg10,arg11,arg12,arg13); + bsr_plus_bsr< int,float >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(float const (*))arg7,(int const (*))arg8,(int const (*))arg9,(float const (*))arg10,arg11,arg12,arg13); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -83598,7 +84036,7 @@ if (!temp13 || !require_contiguous(temp13) || !require_native(temp13)) SWIG_fail; arg13 = (double*) array_data(temp13); } - bsr_plus_bsr(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(double const (*))arg7,(int const (*))arg8,(int const (*))arg9,(double const (*))arg10,arg11,arg12,arg13); + bsr_plus_bsr< int,double >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(double const (*))arg7,(int const (*))arg8,(int const (*))arg9,(double const (*))arg10,arg11,arg12,arg13); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -83790,7 +84228,7 @@ if (!temp13 || !require_contiguous(temp13) || !require_native(temp13)) SWIG_fail; arg13 = (long double*) array_data(temp13); } - bsr_plus_bsr(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(long double const (*))arg7,(int const (*))arg8,(int const (*))arg9,(long double const (*))arg10,arg11,arg12,arg13); + bsr_plus_bsr< int,long double >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(long double const (*))arg7,(int const (*))arg8,(int const (*))arg9,(long double const (*))arg10,arg11,arg12,arg13); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -83982,7 +84420,7 @@ if (!temp13 || !require_contiguous(temp13) || !require_native(temp13)) SWIG_fail; arg13 = (npy_cfloat_wrapper*) array_data(temp13); } - bsr_plus_bsr(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(npy_cfloat_wrapper const (*))arg7,(int const (*))arg8,(int const (*))arg9,(npy_cfloat_wrapper const (*))arg10,arg11,arg12,arg13); + bsr_plus_bsr< int,npy_cfloat_wrapper >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(npy_cfloat_wrapper const (*))arg7,(int const (*))arg8,(int const (*))arg9,(npy_cfloat_wrapper const (*))arg10,arg11,arg12,arg13); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -84174,7 +84612,7 @@ if (!temp13 || !require_contiguous(temp13) || !require_native(temp13)) SWIG_fail; arg13 = (npy_cdouble_wrapper*) array_data(temp13); } - bsr_plus_bsr(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(npy_cdouble_wrapper const (*))arg7,(int const (*))arg8,(int const (*))arg9,(npy_cdouble_wrapper const (*))arg10,arg11,arg12,arg13); + bsr_plus_bsr< int,npy_cdouble_wrapper >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(npy_cdouble_wrapper const (*))arg7,(int const (*))arg8,(int const (*))arg9,(npy_cdouble_wrapper const (*))arg10,arg11,arg12,arg13); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -84366,7 +84804,7 @@ if (!temp13 || !require_contiguous(temp13) || !require_native(temp13)) SWIG_fail; arg13 = (npy_clongdouble_wrapper*) array_data(temp13); } - bsr_plus_bsr(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(npy_clongdouble_wrapper const (*))arg7,(int const (*))arg8,(int const (*))arg9,(npy_clongdouble_wrapper const (*))arg10,arg11,arg12,arg13); + bsr_plus_bsr< int,npy_clongdouble_wrapper >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(npy_clongdouble_wrapper const (*))arg7,(int const (*))arg8,(int const (*))arg9,(npy_clongdouble_wrapper const (*))arg10,arg11,arg12,arg13); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -85444,7 +85882,22 @@ } fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'bsr_plus_bsr'.\n Possible C/C++ prototypes are:\n"" bsr_plus_bsr<(int,signed char)>(int const,int const,int const,int const,int const [],int const [],signed char const [],int const [],int const [],signed char const [],int [],int [],signed char [])\n"" bsr_plus_bsr<(int,unsigned char)>(int const,int const,int const,int const,int const [],int const [],unsigned char const [],int const [],int const [],unsigned char const [],int [],int [],unsigned char [])\n"" bsr_plus_bsr<(int,short)>(int const,int const,int const,int const,int const [],int const [],short const [],int const [],int const [],short const [],int [],int [],short [])\n"" bsr_plus_bsr<(int,unsigned short)>(int const,int const,int const,int const,int const [],int const [],unsigned short const [],int const [],int const [],unsigned short const [],int [],int [],unsigned short [])\n"" bsr_plus_bsr<(int,int)>(int const,int const,int const,int const,int const [],int const [],int const [],int const [],int const [],int const [],int [],int [],int [])\n"" bsr_plus_bsr<(int,unsigned int)>(int const,int const,int const,int const,int const [],int const [],unsigned int const [],int const [],int const [],unsigned int const [],int [],int [],unsigned int [])\n"" bsr_plus_bsr<(int,long long)>(int const,int const,int const,int const,int const [],int const [],long long const [],int const [],int const [],long long const [],int [],int [],long long [])\n"" bsr_plus_bsr<(int,unsigned long long)>(int const,int const,int const,int const,int const [],int const [],unsigned long long const [],int const [],int const [],unsigned long long const [],int [],int [],unsigned long long [])\n"" bsr_plus_bsr<(int,float)>(int const,int const,int const,int const,int const [],int const [],float const [],int const [],int const [],float const [],int [],int [],float [])\n"" bsr_plus_bsr<(int,double)>(int const,int const,int const,int const,int const [],int const [],double const [],int const [],int const [],double const [],int [],int [],double [])\n"" bsr_plus_bsr<(int,long double)>(int const,int const,int const,int const,int const [],int const [],long double const [],int const [],int const [],long double const [],int [],int [],long double [])\n"" bsr_plus_bsr<(int,npy_cfloat_wrapper)>(int const,int const,int const,int const,int const [],int const [],npy_cfloat_wrapper const [],int const [],int const [],npy_cfloat_wrapper const [],int [],int [],npy_cfloat_wrapper [])\n"" bsr_plus_bsr<(int,npy_cdouble_wrapper)>(int const,int const,int const,int const,int const [],int const [],npy_cdouble_wrapper const [],int const [],int const [],npy_cdouble_wrapper const [],int [],int [],npy_cdouble_wrapper [])\n"" bsr_plus_bsr<(int,npy_clongdouble_wrapper)>(int const,int const,int const,int const,int const [],int const [],npy_clongdouble_wrapper const [],int const [],int const [],npy_clongdouble_wrapper const [],int [],int [],npy_clongdouble_wrapper [])\n"); + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'bsr_plus_bsr'.\n" + " Possible C/C++ prototypes are:\n" + " bsr_plus_bsr< int,signed char >(int const,int const,int const,int const,int const [],int const [],signed char const [],int const [],int const [],signed char const [],int [],int [],signed char [])\n" + " bsr_plus_bsr< int,unsigned char >(int const,int const,int const,int const,int const [],int const [],unsigned char const [],int const [],int const [],unsigned char const [],int [],int [],unsigned char [])\n" + " bsr_plus_bsr< int,short >(int const,int const,int const,int const,int const [],int const [],short const [],int const [],int const [],short const [],int [],int [],short [])\n" + " bsr_plus_bsr< int,unsigned short >(int const,int const,int const,int const,int const [],int const [],unsigned short const [],int const [],int const [],unsigned short const [],int [],int [],unsigned short [])\n" + " bsr_plus_bsr< int,int >(int const,int const,int const,int const,int const [],int const [],int const [],int const [],int const [],int const [],int [],int [],int [])\n" + " bsr_plus_bsr< int,unsigned int >(int const,int const,int const,int const,int const [],int const [],unsigned int const [],int const [],int const [],unsigned int const [],int [],int [],unsigned int [])\n" + " bsr_plus_bsr< int,long long >(int const,int const,int const,int const,int const [],int const [],long long const [],int const [],int const [],long long const [],int [],int [],long long [])\n" + " bsr_plus_bsr< int,unsigned long long >(int const,int const,int const,int const,int const [],int const [],unsigned long long const [],int const [],int const [],unsigned long long const [],int [],int [],unsigned long long [])\n" + " bsr_plus_bsr< int,float >(int const,int const,int const,int const,int const [],int const [],float const [],int const [],int const [],float const [],int [],int [],float [])\n" + " bsr_plus_bsr< int,double >(int const,int const,int const,int const,int const [],int const [],double const [],int const [],int const [],double const [],int [],int [],double [])\n" + " bsr_plus_bsr< int,long double >(int const,int const,int const,int const,int const [],int const [],long double const [],int const [],int const [],long double const [],int [],int [],long double [])\n" + " bsr_plus_bsr< int,npy_cfloat_wrapper >(int const,int const,int const,int const,int const [],int const [],npy_cfloat_wrapper const [],int const [],int const [],npy_cfloat_wrapper const [],int [],int [],npy_cfloat_wrapper [])\n" + " bsr_plus_bsr< int,npy_cdouble_wrapper >(int const,int const,int const,int const,int const [],int const [],npy_cdouble_wrapper const [],int const [],int const [],npy_cdouble_wrapper const [],int [],int [],npy_cdouble_wrapper [])\n" + " bsr_plus_bsr< int,npy_clongdouble_wrapper >(int const,int const,int const,int const,int const [],int const [],npy_clongdouble_wrapper const [],int const [],int const [],npy_clongdouble_wrapper const [],int [],int [],npy_clongdouble_wrapper [])\n"); return NULL; } @@ -85597,7 +86050,7 @@ if (!temp13 || !require_contiguous(temp13) || !require_native(temp13)) SWIG_fail; arg13 = (signed char*) array_data(temp13); } - bsr_minus_bsr(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(signed char const (*))arg7,(int const (*))arg8,(int const (*))arg9,(signed char const (*))arg10,arg11,arg12,arg13); + bsr_minus_bsr< int,signed char >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(signed char const (*))arg7,(int const (*))arg8,(int const (*))arg9,(signed char const (*))arg10,arg11,arg12,arg13); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -85789,7 +86242,7 @@ if (!temp13 || !require_contiguous(temp13) || !require_native(temp13)) SWIG_fail; arg13 = (unsigned char*) array_data(temp13); } - bsr_minus_bsr(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(unsigned char const (*))arg7,(int const (*))arg8,(int const (*))arg9,(unsigned char const (*))arg10,arg11,arg12,arg13); + bsr_minus_bsr< int,unsigned char >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(unsigned char const (*))arg7,(int const (*))arg8,(int const (*))arg9,(unsigned char const (*))arg10,arg11,arg12,arg13); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -85981,7 +86434,7 @@ if (!temp13 || !require_contiguous(temp13) || !require_native(temp13)) SWIG_fail; arg13 = (short*) array_data(temp13); } - bsr_minus_bsr(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(short const (*))arg7,(int const (*))arg8,(int const (*))arg9,(short const (*))arg10,arg11,arg12,arg13); + bsr_minus_bsr< int,short >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(short const (*))arg7,(int const (*))arg8,(int const (*))arg9,(short const (*))arg10,arg11,arg12,arg13); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -86173,7 +86626,7 @@ if (!temp13 || !require_contiguous(temp13) || !require_native(temp13)) SWIG_fail; arg13 = (unsigned short*) array_data(temp13); } - bsr_minus_bsr(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(unsigned short const (*))arg7,(int const (*))arg8,(int const (*))arg9,(unsigned short const (*))arg10,arg11,arg12,arg13); + bsr_minus_bsr< int,unsigned short >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(unsigned short const (*))arg7,(int const (*))arg8,(int const (*))arg9,(unsigned short const (*))arg10,arg11,arg12,arg13); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -86365,7 +86818,7 @@ if (!temp13 || !require_contiguous(temp13) || !require_native(temp13)) SWIG_fail; arg13 = (int*) array_data(temp13); } - bsr_minus_bsr(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(int const (*))arg7,(int const (*))arg8,(int const (*))arg9,(int const (*))arg10,arg11,arg12,arg13); + bsr_minus_bsr< int,int >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(int const (*))arg7,(int const (*))arg8,(int const (*))arg9,(int const (*))arg10,arg11,arg12,arg13); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -86557,7 +87010,7 @@ if (!temp13 || !require_contiguous(temp13) || !require_native(temp13)) SWIG_fail; arg13 = (unsigned int*) array_data(temp13); } - bsr_minus_bsr(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(unsigned int const (*))arg7,(int const (*))arg8,(int const (*))arg9,(unsigned int const (*))arg10,arg11,arg12,arg13); + bsr_minus_bsr< int,unsigned int >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(unsigned int const (*))arg7,(int const (*))arg8,(int const (*))arg9,(unsigned int const (*))arg10,arg11,arg12,arg13); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -86749,7 +87202,7 @@ if (!temp13 || !require_contiguous(temp13) || !require_native(temp13)) SWIG_fail; arg13 = (long long*) array_data(temp13); } - bsr_minus_bsr(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(long long const (*))arg7,(int const (*))arg8,(int const (*))arg9,(long long const (*))arg10,arg11,arg12,arg13); + bsr_minus_bsr< int,long long >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(long long const (*))arg7,(int const (*))arg8,(int const (*))arg9,(long long const (*))arg10,arg11,arg12,arg13); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -86941,7 +87394,7 @@ if (!temp13 || !require_contiguous(temp13) || !require_native(temp13)) SWIG_fail; arg13 = (unsigned long long*) array_data(temp13); } - bsr_minus_bsr(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(unsigned long long const (*))arg7,(int const (*))arg8,(int const (*))arg9,(unsigned long long const (*))arg10,arg11,arg12,arg13); + bsr_minus_bsr< int,unsigned long long >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(unsigned long long const (*))arg7,(int const (*))arg8,(int const (*))arg9,(unsigned long long const (*))arg10,arg11,arg12,arg13); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -87133,7 +87586,7 @@ if (!temp13 || !require_contiguous(temp13) || !require_native(temp13)) SWIG_fail; arg13 = (float*) array_data(temp13); } - bsr_minus_bsr(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(float const (*))arg7,(int const (*))arg8,(int const (*))arg9,(float const (*))arg10,arg11,arg12,arg13); + bsr_minus_bsr< int,float >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(float const (*))arg7,(int const (*))arg8,(int const (*))arg9,(float const (*))arg10,arg11,arg12,arg13); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -87325,7 +87778,7 @@ if (!temp13 || !require_contiguous(temp13) || !require_native(temp13)) SWIG_fail; arg13 = (double*) array_data(temp13); } - bsr_minus_bsr(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(double const (*))arg7,(int const (*))arg8,(int const (*))arg9,(double const (*))arg10,arg11,arg12,arg13); + bsr_minus_bsr< int,double >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(double const (*))arg7,(int const (*))arg8,(int const (*))arg9,(double const (*))arg10,arg11,arg12,arg13); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -87517,7 +87970,7 @@ if (!temp13 || !require_contiguous(temp13) || !require_native(temp13)) SWIG_fail; arg13 = (long double*) array_data(temp13); } - bsr_minus_bsr(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(long double const (*))arg7,(int const (*))arg8,(int const (*))arg9,(long double const (*))arg10,arg11,arg12,arg13); + bsr_minus_bsr< int,long double >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(long double const (*))arg7,(int const (*))arg8,(int const (*))arg9,(long double const (*))arg10,arg11,arg12,arg13); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -87709,7 +88162,7 @@ if (!temp13 || !require_contiguous(temp13) || !require_native(temp13)) SWIG_fail; arg13 = (npy_cfloat_wrapper*) array_data(temp13); } - bsr_minus_bsr(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(npy_cfloat_wrapper const (*))arg7,(int const (*))arg8,(int const (*))arg9,(npy_cfloat_wrapper const (*))arg10,arg11,arg12,arg13); + bsr_minus_bsr< int,npy_cfloat_wrapper >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(npy_cfloat_wrapper const (*))arg7,(int const (*))arg8,(int const (*))arg9,(npy_cfloat_wrapper const (*))arg10,arg11,arg12,arg13); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -87901,7 +88354,7 @@ if (!temp13 || !require_contiguous(temp13) || !require_native(temp13)) SWIG_fail; arg13 = (npy_cdouble_wrapper*) array_data(temp13); } - bsr_minus_bsr(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(npy_cdouble_wrapper const (*))arg7,(int const (*))arg8,(int const (*))arg9,(npy_cdouble_wrapper const (*))arg10,arg11,arg12,arg13); + bsr_minus_bsr< int,npy_cdouble_wrapper >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(npy_cdouble_wrapper const (*))arg7,(int const (*))arg8,(int const (*))arg9,(npy_cdouble_wrapper const (*))arg10,arg11,arg12,arg13); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -88093,7 +88546,7 @@ if (!temp13 || !require_contiguous(temp13) || !require_native(temp13)) SWIG_fail; arg13 = (npy_clongdouble_wrapper*) array_data(temp13); } - bsr_minus_bsr(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(npy_clongdouble_wrapper const (*))arg7,(int const (*))arg8,(int const (*))arg9,(npy_clongdouble_wrapper const (*))arg10,arg11,arg12,arg13); + bsr_minus_bsr< int,npy_clongdouble_wrapper >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(npy_clongdouble_wrapper const (*))arg7,(int const (*))arg8,(int const (*))arg9,(npy_clongdouble_wrapper const (*))arg10,arg11,arg12,arg13); resultobj = SWIG_Py_Void(); { if (is_new_object5 && array5) Py_DECREF(array5); @@ -89171,7 +89624,22 @@ } fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'bsr_minus_bsr'.\n Possible C/C++ prototypes are:\n"" bsr_minus_bsr<(int,signed char)>(int const,int const,int const,int const,int const [],int const [],signed char const [],int const [],int const [],signed char const [],int [],int [],signed char [])\n"" bsr_minus_bsr<(int,unsigned char)>(int const,int const,int const,int const,int const [],int const [],unsigned char const [],int const [],int const [],unsigned char const [],int [],int [],unsigned char [])\n"" bsr_minus_bsr<(int,short)>(int const,int const,int const,int const,int const [],int const [],short const [],int const [],int const [],short const [],int [],int [],short [])\n"" bsr_minus_bsr<(int,unsigned short)>(int const,int const,int const,int const,int const [],int const [],unsigned short const [],int const [],int const [],unsigned short const [],int [],int [],unsigned short [])\n"" bsr_minus_bsr<(int,int)>(int const,int const,int const,int const,int const [],int const [],int const [],int const [],int const [],int const [],int [],int [],int [])\n"" bsr_minus_bsr<(int,unsigned int)>(int const,int const,int const,int const,int const [],int const [],unsigned int const [],int const [],int const [],unsigned int const [],int [],int [],unsigned int [])\n"" bsr_minus_bsr<(int,long long)>(int const,int const,int const,int const,int const [],int const [],long long const [],int const [],int const [],long long const [],int [],int [],long long [])\n"" bsr_minus_bsr<(int,unsigned long long)>(int const,int const,int const,int const,int const [],int const [],unsigned long long const [],int const [],int const [],unsigned long long const [],int [],int [],unsigned long long [])\n"" bsr_minus_bsr<(int,float)>(int const,int const,int const,int const,int const [],int const [],float const [],int const [],int const [],float const [],int [],int [],float [])\n"" bsr_minus_bsr<(int,double)>(int const,int const,int const,int const,int const [],int const [],double const [],int const [],int const [],double const [],int [],int [],double [])\n"" bsr_minus_bsr<(int,long double)>(int const,int const,int const,int const,int const [],int const [],long double const [],int const [],int const [],long double const [],int [],int [],long double [])\n"" bsr_minus_bsr<(int,npy_cfloat_wrapper)>(int const,int const,int const,int const,int const [],int const [],npy_cfloat_wrapper const [],int const [],int const [],npy_cfloat_wrapper const [],int [],int [],npy_cfloat_wrapper [])\n"" bsr_minus_bsr<(int,npy_cdouble_wrapper)>(int const,int const,int const,int const,int const [],int const [],npy_cdouble_wrapper const [],int const [],int const [],npy_cdouble_wrapper const [],int [],int [],npy_cdouble_wrapper [])\n"" bsr_minus_bsr<(int,npy_clongdouble_wrapper)>(int const,int const,int const,int const,int const [],int const [],npy_clongdouble_wrapper const [],int const [],int const [],npy_clongdouble_wrapper const [],int [],int [],npy_clongdouble_wrapper [])\n"); + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'bsr_minus_bsr'.\n" + " Possible C/C++ prototypes are:\n" + " bsr_minus_bsr< int,signed char >(int const,int const,int const,int const,int const [],int const [],signed char const [],int const [],int const [],signed char const [],int [],int [],signed char [])\n" + " bsr_minus_bsr< int,unsigned char >(int const,int const,int const,int const,int const [],int const [],unsigned char const [],int const [],int const [],unsigned char const [],int [],int [],unsigned char [])\n" + " bsr_minus_bsr< int,short >(int const,int const,int const,int const,int const [],int const [],short const [],int const [],int const [],short const [],int [],int [],short [])\n" + " bsr_minus_bsr< int,unsigned short >(int const,int const,int const,int const,int const [],int const [],unsigned short const [],int const [],int const [],unsigned short const [],int [],int [],unsigned short [])\n" + " bsr_minus_bsr< int,int >(int const,int const,int const,int const,int const [],int const [],int const [],int const [],int const [],int const [],int [],int [],int [])\n" + " bsr_minus_bsr< int,unsigned int >(int const,int const,int const,int const,int const [],int const [],unsigned int const [],int const [],int const [],unsigned int const [],int [],int [],unsigned int [])\n" + " bsr_minus_bsr< int,long long >(int const,int const,int const,int const,int const [],int const [],long long const [],int const [],int const [],long long const [],int [],int [],long long [])\n" + " bsr_minus_bsr< int,unsigned long long >(int const,int const,int const,int const,int const [],int const [],unsigned long long const [],int const [],int const [],unsigned long long const [],int [],int [],unsigned long long [])\n" + " bsr_minus_bsr< int,float >(int const,int const,int const,int const,int const [],int const [],float const [],int const [],int const [],float const [],int [],int [],float [])\n" + " bsr_minus_bsr< int,double >(int const,int const,int const,int const,int const [],int const [],double const [],int const [],int const [],double const [],int [],int [],double [])\n" + " bsr_minus_bsr< int,long double >(int const,int const,int const,int const,int const [],int const [],long double const [],int const [],int const [],long double const [],int [],int [],long double [])\n" + " bsr_minus_bsr< int,npy_cfloat_wrapper >(int const,int const,int const,int const,int const [],int const [],npy_cfloat_wrapper const [],int const [],int const [],npy_cfloat_wrapper const [],int [],int [],npy_cfloat_wrapper [])\n" + " bsr_minus_bsr< int,npy_cdouble_wrapper >(int const,int const,int const,int const,int const [],int const [],npy_cdouble_wrapper const [],int const [],int const [],npy_cdouble_wrapper const [],int [],int [],npy_cdouble_wrapper [])\n" + " bsr_minus_bsr< int,npy_clongdouble_wrapper >(int const,int const,int const,int const,int const [],int const [],npy_clongdouble_wrapper const [],int const [],int const [],npy_clongdouble_wrapper const [],int [],int [],npy_clongdouble_wrapper [])\n"); return NULL; } @@ -89218,7 +89686,7 @@ arg3 = (int*) array3->data; } - result = (bool)csr_has_sorted_indices(arg1,(int const (*))arg2,(int const (*))arg3); + result = (bool)csr_has_sorted_indices< int >(arg1,(int const (*))arg2,(int const (*))arg3); resultobj = SWIG_From_bool(static_cast< bool >(result)); { if (is_new_object2 && array2) Py_DECREF(array2); @@ -89281,7 +89749,7 @@ if (!temp4 || !require_contiguous(temp4) || !require_native(temp4)) SWIG_fail; arg4 = (signed char*) array_data(temp4); } - csr_sort_indices(arg1,(int const (*))arg2,arg3,arg4); + csr_sort_indices< int,signed char >(arg1,(int const (*))arg2,arg3,arg4); resultobj = SWIG_Py_Void(); { if (is_new_object2 && array2) Py_DECREF(array2); @@ -89338,7 +89806,7 @@ if (!temp4 || !require_contiguous(temp4) || !require_native(temp4)) SWIG_fail; arg4 = (unsigned char*) array_data(temp4); } - csr_sort_indices(arg1,(int const (*))arg2,arg3,arg4); + csr_sort_indices< int,unsigned char >(arg1,(int const (*))arg2,arg3,arg4); resultobj = SWIG_Py_Void(); { if (is_new_object2 && array2) Py_DECREF(array2); @@ -89395,7 +89863,7 @@ if (!temp4 || !require_contiguous(temp4) || !require_native(temp4)) SWIG_fail; arg4 = (short*) array_data(temp4); } - csr_sort_indices(arg1,(int const (*))arg2,arg3,arg4); + csr_sort_indices< int,short >(arg1,(int const (*))arg2,arg3,arg4); resultobj = SWIG_Py_Void(); { if (is_new_object2 && array2) Py_DECREF(array2); @@ -89452,7 +89920,7 @@ if (!temp4 || !require_contiguous(temp4) || !require_native(temp4)) SWIG_fail; arg4 = (unsigned short*) array_data(temp4); } - csr_sort_indices(arg1,(int const (*))arg2,arg3,arg4); + csr_sort_indices< int,unsigned short >(arg1,(int const (*))arg2,arg3,arg4); resultobj = SWIG_Py_Void(); { if (is_new_object2 && array2) Py_DECREF(array2); @@ -89509,7 +89977,7 @@ if (!temp4 || !require_contiguous(temp4) || !require_native(temp4)) SWIG_fail; arg4 = (int*) array_data(temp4); } - csr_sort_indices(arg1,(int const (*))arg2,arg3,arg4); + csr_sort_indices< int,int >(arg1,(int const (*))arg2,arg3,arg4); resultobj = SWIG_Py_Void(); { if (is_new_object2 && array2) Py_DECREF(array2); @@ -89566,7 +90034,7 @@ if (!temp4 || !require_contiguous(temp4) || !require_native(temp4)) SWIG_fail; arg4 = (unsigned int*) array_data(temp4); } - csr_sort_indices(arg1,(int const (*))arg2,arg3,arg4); + csr_sort_indices< int,unsigned int >(arg1,(int const (*))arg2,arg3,arg4); resultobj = SWIG_Py_Void(); { if (is_new_object2 && array2) Py_DECREF(array2); @@ -89623,7 +90091,7 @@ if (!temp4 || !require_contiguous(temp4) || !require_native(temp4)) SWIG_fail; arg4 = (long long*) array_data(temp4); } - csr_sort_indices(arg1,(int const (*))arg2,arg3,arg4); + csr_sort_indices< int,long long >(arg1,(int const (*))arg2,arg3,arg4); resultobj = SWIG_Py_Void(); { if (is_new_object2 && array2) Py_DECREF(array2); @@ -89680,7 +90148,7 @@ if (!temp4 || !require_contiguous(temp4) || !require_native(temp4)) SWIG_fail; arg4 = (unsigned long long*) array_data(temp4); } - csr_sort_indices(arg1,(int const (*))arg2,arg3,arg4); + csr_sort_indices< int,unsigned long long >(arg1,(int const (*))arg2,arg3,arg4); resultobj = SWIG_Py_Void(); { if (is_new_object2 && array2) Py_DECREF(array2); @@ -89737,7 +90205,7 @@ if (!temp4 || !require_contiguous(temp4) || !require_native(temp4)) SWIG_fail; arg4 = (float*) array_data(temp4); } - csr_sort_indices(arg1,(int const (*))arg2,arg3,arg4); + csr_sort_indices< int,float >(arg1,(int const (*))arg2,arg3,arg4); resultobj = SWIG_Py_Void(); { if (is_new_object2 && array2) Py_DECREF(array2); @@ -89794,7 +90262,7 @@ if (!temp4 || !require_contiguous(temp4) || !require_native(temp4)) SWIG_fail; arg4 = (double*) array_data(temp4); } - csr_sort_indices(arg1,(int const (*))arg2,arg3,arg4); + csr_sort_indices< int,double >(arg1,(int const (*))arg2,arg3,arg4); resultobj = SWIG_Py_Void(); { if (is_new_object2 && array2) Py_DECREF(array2); @@ -89851,7 +90319,7 @@ if (!temp4 || !require_contiguous(temp4) || !require_native(temp4)) SWIG_fail; arg4 = (long double*) array_data(temp4); } - csr_sort_indices(arg1,(int const (*))arg2,arg3,arg4); + csr_sort_indices< int,long double >(arg1,(int const (*))arg2,arg3,arg4); resultobj = SWIG_Py_Void(); { if (is_new_object2 && array2) Py_DECREF(array2); @@ -89908,7 +90376,7 @@ if (!temp4 || !require_contiguous(temp4) || !require_native(temp4)) SWIG_fail; arg4 = (npy_cfloat_wrapper*) array_data(temp4); } - csr_sort_indices(arg1,(int const (*))arg2,arg3,arg4); + csr_sort_indices< int,npy_cfloat_wrapper >(arg1,(int const (*))arg2,arg3,arg4); resultobj = SWIG_Py_Void(); { if (is_new_object2 && array2) Py_DECREF(array2); @@ -89965,7 +90433,7 @@ if (!temp4 || !require_contiguous(temp4) || !require_native(temp4)) SWIG_fail; arg4 = (npy_cdouble_wrapper*) array_data(temp4); } - csr_sort_indices(arg1,(int const (*))arg2,arg3,arg4); + csr_sort_indices< int,npy_cdouble_wrapper >(arg1,(int const (*))arg2,arg3,arg4); resultobj = SWIG_Py_Void(); { if (is_new_object2 && array2) Py_DECREF(array2); @@ -90022,7 +90490,7 @@ if (!temp4 || !require_contiguous(temp4) || !require_native(temp4)) SWIG_fail; arg4 = (npy_clongdouble_wrapper*) array_data(temp4); } - csr_sort_indices(arg1,(int const (*))arg2,arg3,arg4); + csr_sort_indices< int,npy_clongdouble_wrapper >(arg1,(int const (*))arg2,arg3,arg4); resultobj = SWIG_Py_Void(); { if (is_new_object2 && array2) Py_DECREF(array2); @@ -90398,7 +90866,22 @@ } fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'csr_sort_indices'.\n Possible C/C++ prototypes are:\n"" csr_sort_indices<(int,signed char)>(int const,int const [],int [],signed char [])\n"" csr_sort_indices<(int,unsigned char)>(int const,int const [],int [],unsigned char [])\n"" csr_sort_indices<(int,short)>(int const,int const [],int [],short [])\n"" csr_sort_indices<(int,unsigned short)>(int const,int const [],int [],unsigned short [])\n"" csr_sort_indices<(int,int)>(int const,int const [],int [],int [])\n"" csr_sort_indices<(int,unsigned int)>(int const,int const [],int [],unsigned int [])\n"" csr_sort_indices<(int,long long)>(int const,int const [],int [],long long [])\n"" csr_sort_indices<(int,unsigned long long)>(int const,int const [],int [],unsigned long long [])\n"" csr_sort_indices<(int,float)>(int const,int const [],int [],float [])\n"" csr_sort_indices<(int,double)>(int const,int const [],int [],double [])\n"" csr_sort_indices<(int,long double)>(int const,int const [],int [],long double [])\n"" csr_sort_indices<(int,npy_cfloat_wrapper)>(int const,int const [],int [],npy_cfloat_wrapper [])\n"" csr_sort_indices<(int,npy_cdouble_wrapper)>(int const,int const [],int [],npy_cdouble_wrapper [])\n"" csr_sort_indices<(int,npy_clongdouble_wrapper)>(int const,int const [],int [],npy_clongdouble_wrapper [])\n"); + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'csr_sort_indices'.\n" + " Possible C/C++ prototypes are:\n" + " csr_sort_indices< int,signed char >(int const,int const [],int [],signed char [])\n" + " csr_sort_indices< int,unsigned char >(int const,int const [],int [],unsigned char [])\n" + " csr_sort_indices< int,short >(int const,int const [],int [],short [])\n" + " csr_sort_indices< int,unsigned short >(int const,int const [],int [],unsigned short [])\n" + " csr_sort_indices< int,int >(int const,int const [],int [],int [])\n" + " csr_sort_indices< int,unsigned int >(int const,int const [],int [],unsigned int [])\n" + " csr_sort_indices< int,long long >(int const,int const [],int [],long long [])\n" + " csr_sort_indices< int,unsigned long long >(int const,int const [],int [],unsigned long long [])\n" + " csr_sort_indices< int,float >(int const,int const [],int [],float [])\n" + " csr_sort_indices< int,double >(int const,int const [],int [],double [])\n" + " csr_sort_indices< int,long double >(int const,int const [],int [],long double [])\n" + " csr_sort_indices< int,npy_cfloat_wrapper >(int const,int const [],int [],npy_cfloat_wrapper [])\n" + " csr_sort_indices< int,npy_cdouble_wrapper >(int const,int const [],int [],npy_cdouble_wrapper [])\n" + " csr_sort_indices< int,npy_clongdouble_wrapper >(int const,int const [],int [],npy_clongdouble_wrapper [])\n"); return NULL; } @@ -90449,7 +90932,7 @@ if (!temp5 || !require_contiguous(temp5) || !require_native(temp5)) SWIG_fail; arg5 = (signed char*) array_data(temp5); } - csr_eliminate_zeros(arg1,arg2,arg3,arg4,arg5); + csr_eliminate_zeros< int,signed char >(arg1,arg2,arg3,arg4,arg5); resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -90503,7 +90986,7 @@ if (!temp5 || !require_contiguous(temp5) || !require_native(temp5)) SWIG_fail; arg5 = (unsigned char*) array_data(temp5); } - csr_eliminate_zeros(arg1,arg2,arg3,arg4,arg5); + csr_eliminate_zeros< int,unsigned char >(arg1,arg2,arg3,arg4,arg5); resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -90557,7 +91040,7 @@ if (!temp5 || !require_contiguous(temp5) || !require_native(temp5)) SWIG_fail; arg5 = (short*) array_data(temp5); } - csr_eliminate_zeros(arg1,arg2,arg3,arg4,arg5); + csr_eliminate_zeros< int,short >(arg1,arg2,arg3,arg4,arg5); resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -90611,7 +91094,7 @@ if (!temp5 || !require_contiguous(temp5) || !require_native(temp5)) SWIG_fail; arg5 = (unsigned short*) array_data(temp5); } - csr_eliminate_zeros(arg1,arg2,arg3,arg4,arg5); + csr_eliminate_zeros< int,unsigned short >(arg1,arg2,arg3,arg4,arg5); resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -90665,7 +91148,7 @@ if (!temp5 || !require_contiguous(temp5) || !require_native(temp5)) SWIG_fail; arg5 = (int*) array_data(temp5); } - csr_eliminate_zeros(arg1,arg2,arg3,arg4,arg5); + csr_eliminate_zeros< int,int >(arg1,arg2,arg3,arg4,arg5); resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -90719,7 +91202,7 @@ if (!temp5 || !require_contiguous(temp5) || !require_native(temp5)) SWIG_fail; arg5 = (unsigned int*) array_data(temp5); } - csr_eliminate_zeros(arg1,arg2,arg3,arg4,arg5); + csr_eliminate_zeros< int,unsigned int >(arg1,arg2,arg3,arg4,arg5); resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -90773,7 +91256,7 @@ if (!temp5 || !require_contiguous(temp5) || !require_native(temp5)) SWIG_fail; arg5 = (long long*) array_data(temp5); } - csr_eliminate_zeros(arg1,arg2,arg3,arg4,arg5); + csr_eliminate_zeros< int,long long >(arg1,arg2,arg3,arg4,arg5); resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -90827,7 +91310,7 @@ if (!temp5 || !require_contiguous(temp5) || !require_native(temp5)) SWIG_fail; arg5 = (unsigned long long*) array_data(temp5); } - csr_eliminate_zeros(arg1,arg2,arg3,arg4,arg5); + csr_eliminate_zeros< int,unsigned long long >(arg1,arg2,arg3,arg4,arg5); resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -90881,7 +91364,7 @@ if (!temp5 || !require_contiguous(temp5) || !require_native(temp5)) SWIG_fail; arg5 = (float*) array_data(temp5); } - csr_eliminate_zeros(arg1,arg2,arg3,arg4,arg5); + csr_eliminate_zeros< int,float >(arg1,arg2,arg3,arg4,arg5); resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -90935,7 +91418,7 @@ if (!temp5 || !require_contiguous(temp5) || !require_native(temp5)) SWIG_fail; arg5 = (double*) array_data(temp5); } - csr_eliminate_zeros(arg1,arg2,arg3,arg4,arg5); + csr_eliminate_zeros< int,double >(arg1,arg2,arg3,arg4,arg5); resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -90989,7 +91472,7 @@ if (!temp5 || !require_contiguous(temp5) || !require_native(temp5)) SWIG_fail; arg5 = (long double*) array_data(temp5); } - csr_eliminate_zeros(arg1,arg2,arg3,arg4,arg5); + csr_eliminate_zeros< int,long double >(arg1,arg2,arg3,arg4,arg5); resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -91043,7 +91526,7 @@ if (!temp5 || !require_contiguous(temp5) || !require_native(temp5)) SWIG_fail; arg5 = (npy_cfloat_wrapper*) array_data(temp5); } - csr_eliminate_zeros(arg1,arg2,arg3,arg4,arg5); + csr_eliminate_zeros< int,npy_cfloat_wrapper >(arg1,arg2,arg3,arg4,arg5); resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -91097,7 +91580,7 @@ if (!temp5 || !require_contiguous(temp5) || !require_native(temp5)) SWIG_fail; arg5 = (npy_cdouble_wrapper*) array_data(temp5); } - csr_eliminate_zeros(arg1,arg2,arg3,arg4,arg5); + csr_eliminate_zeros< int,npy_cdouble_wrapper >(arg1,arg2,arg3,arg4,arg5); resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -91151,7 +91634,7 @@ if (!temp5 || !require_contiguous(temp5) || !require_native(temp5)) SWIG_fail; arg5 = (npy_clongdouble_wrapper*) array_data(temp5); } - csr_eliminate_zeros(arg1,arg2,arg3,arg4,arg5); + csr_eliminate_zeros< int,npy_clongdouble_wrapper >(arg1,arg2,arg3,arg4,arg5); resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -91605,7 +92088,22 @@ } fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'csr_eliminate_zeros'.\n Possible C/C++ prototypes are:\n"" csr_eliminate_zeros<(int,signed char)>(int const,int const,int [],int [],signed char [])\n"" csr_eliminate_zeros<(int,unsigned char)>(int const,int const,int [],int [],unsigned char [])\n"" csr_eliminate_zeros<(int,short)>(int const,int const,int [],int [],short [])\n"" csr_eliminate_zeros<(int,unsigned short)>(int const,int const,int [],int [],unsigned short [])\n"" csr_eliminate_zeros<(int,int)>(int const,int const,int [],int [],int [])\n"" csr_eliminate_zeros<(int,unsigned int)>(int const,int const,int [],int [],unsigned int [])\n"" csr_eliminate_zeros<(int,long long)>(int const,int const,int [],int [],long long [])\n"" csr_eliminate_zeros<(int,unsigned long long)>(int const,int const,int [],int [],unsigned long long [])\n"" csr_eliminate_zeros<(int,float)>(int const,int const,int [],int [],float [])\n"" csr_eliminate_zeros<(int,double)>(int const,int const,int [],int [],double [])\n"" csr_eliminate_zeros<(int,long double)>(int const,int const,int [],int [],long double [])\n"" csr_eliminate_zeros<(int,npy_cfloat_wrapper)>(int const,int const,int [],int [],npy_cfloat_wrapper [])\n"" csr_eliminate_zeros<(int,npy_cdouble_wrapper)>(int const,int const,int [],int [],npy_cdouble_wrapper [])\n"" csr_eliminate_zeros<(int,npy_clongdouble_wrapper)>(int const,int const,int [],int [],npy_clongdouble_wrapper [])\n"); + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'csr_eliminate_zeros'.\n" + " Possible C/C++ prototypes are:\n" + " csr_eliminate_zeros< int,signed char >(int const,int const,int [],int [],signed char [])\n" + " csr_eliminate_zeros< int,unsigned char >(int const,int const,int [],int [],unsigned char [])\n" + " csr_eliminate_zeros< int,short >(int const,int const,int [],int [],short [])\n" + " csr_eliminate_zeros< int,unsigned short >(int const,int const,int [],int [],unsigned short [])\n" + " csr_eliminate_zeros< int,int >(int const,int const,int [],int [],int [])\n" + " csr_eliminate_zeros< int,unsigned int >(int const,int const,int [],int [],unsigned int [])\n" + " csr_eliminate_zeros< int,long long >(int const,int const,int [],int [],long long [])\n" + " csr_eliminate_zeros< int,unsigned long long >(int const,int const,int [],int [],unsigned long long [])\n" + " csr_eliminate_zeros< int,float >(int const,int const,int [],int [],float [])\n" + " csr_eliminate_zeros< int,double >(int const,int const,int [],int [],double [])\n" + " csr_eliminate_zeros< int,long double >(int const,int const,int [],int [],long double [])\n" + " csr_eliminate_zeros< int,npy_cfloat_wrapper >(int const,int const,int [],int [],npy_cfloat_wrapper [])\n" + " csr_eliminate_zeros< int,npy_cdouble_wrapper >(int const,int const,int [],int [],npy_cdouble_wrapper [])\n" + " csr_eliminate_zeros< int,npy_clongdouble_wrapper >(int const,int const,int [],int [],npy_clongdouble_wrapper [])\n"); return NULL; } @@ -91656,7 +92154,7 @@ if (!temp5 || !require_contiguous(temp5) || !require_native(temp5)) SWIG_fail; arg5 = (signed char*) array_data(temp5); } - csr_sum_duplicates(arg1,arg2,arg3,arg4,arg5); + csr_sum_duplicates< int,signed char >(arg1,arg2,arg3,arg4,arg5); resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -91710,7 +92208,7 @@ if (!temp5 || !require_contiguous(temp5) || !require_native(temp5)) SWIG_fail; arg5 = (unsigned char*) array_data(temp5); } - csr_sum_duplicates(arg1,arg2,arg3,arg4,arg5); + csr_sum_duplicates< int,unsigned char >(arg1,arg2,arg3,arg4,arg5); resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -91764,7 +92262,7 @@ if (!temp5 || !require_contiguous(temp5) || !require_native(temp5)) SWIG_fail; arg5 = (short*) array_data(temp5); } - csr_sum_duplicates(arg1,arg2,arg3,arg4,arg5); + csr_sum_duplicates< int,short >(arg1,arg2,arg3,arg4,arg5); resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -91818,7 +92316,7 @@ if (!temp5 || !require_contiguous(temp5) || !require_native(temp5)) SWIG_fail; arg5 = (unsigned short*) array_data(temp5); } - csr_sum_duplicates(arg1,arg2,arg3,arg4,arg5); + csr_sum_duplicates< int,unsigned short >(arg1,arg2,arg3,arg4,arg5); resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -91872,7 +92370,7 @@ if (!temp5 || !require_contiguous(temp5) || !require_native(temp5)) SWIG_fail; arg5 = (int*) array_data(temp5); } - csr_sum_duplicates(arg1,arg2,arg3,arg4,arg5); + csr_sum_duplicates< int,int >(arg1,arg2,arg3,arg4,arg5); resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -91926,7 +92424,7 @@ if (!temp5 || !require_contiguous(temp5) || !require_native(temp5)) SWIG_fail; arg5 = (unsigned int*) array_data(temp5); } - csr_sum_duplicates(arg1,arg2,arg3,arg4,arg5); + csr_sum_duplicates< int,unsigned int >(arg1,arg2,arg3,arg4,arg5); resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -91980,7 +92478,7 @@ if (!temp5 || !require_contiguous(temp5) || !require_native(temp5)) SWIG_fail; arg5 = (long long*) array_data(temp5); } - csr_sum_duplicates(arg1,arg2,arg3,arg4,arg5); + csr_sum_duplicates< int,long long >(arg1,arg2,arg3,arg4,arg5); resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -92034,7 +92532,7 @@ if (!temp5 || !require_contiguous(temp5) || !require_native(temp5)) SWIG_fail; arg5 = (unsigned long long*) array_data(temp5); } - csr_sum_duplicates(arg1,arg2,arg3,arg4,arg5); + csr_sum_duplicates< int,unsigned long long >(arg1,arg2,arg3,arg4,arg5); resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -92088,7 +92586,7 @@ if (!temp5 || !require_contiguous(temp5) || !require_native(temp5)) SWIG_fail; arg5 = (float*) array_data(temp5); } - csr_sum_duplicates(arg1,arg2,arg3,arg4,arg5); + csr_sum_duplicates< int,float >(arg1,arg2,arg3,arg4,arg5); resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -92142,7 +92640,7 @@ if (!temp5 || !require_contiguous(temp5) || !require_native(temp5)) SWIG_fail; arg5 = (double*) array_data(temp5); } - csr_sum_duplicates(arg1,arg2,arg3,arg4,arg5); + csr_sum_duplicates< int,double >(arg1,arg2,arg3,arg4,arg5); resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -92196,7 +92694,7 @@ if (!temp5 || !require_contiguous(temp5) || !require_native(temp5)) SWIG_fail; arg5 = (long double*) array_data(temp5); } - csr_sum_duplicates(arg1,arg2,arg3,arg4,arg5); + csr_sum_duplicates< int,long double >(arg1,arg2,arg3,arg4,arg5); resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -92250,7 +92748,7 @@ if (!temp5 || !require_contiguous(temp5) || !require_native(temp5)) SWIG_fail; arg5 = (npy_cfloat_wrapper*) array_data(temp5); } - csr_sum_duplicates(arg1,arg2,arg3,arg4,arg5); + csr_sum_duplicates< int,npy_cfloat_wrapper >(arg1,arg2,arg3,arg4,arg5); resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -92304,7 +92802,7 @@ if (!temp5 || !require_contiguous(temp5) || !require_native(temp5)) SWIG_fail; arg5 = (npy_cdouble_wrapper*) array_data(temp5); } - csr_sum_duplicates(arg1,arg2,arg3,arg4,arg5); + csr_sum_duplicates< int,npy_cdouble_wrapper >(arg1,arg2,arg3,arg4,arg5); resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -92358,7 +92856,7 @@ if (!temp5 || !require_contiguous(temp5) || !require_native(temp5)) SWIG_fail; arg5 = (npy_clongdouble_wrapper*) array_data(temp5); } - csr_sum_duplicates(arg1,arg2,arg3,arg4,arg5); + csr_sum_duplicates< int,npy_clongdouble_wrapper >(arg1,arg2,arg3,arg4,arg5); resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -92812,7 +93310,22 @@ } fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'csr_sum_duplicates'.\n Possible C/C++ prototypes are:\n"" csr_sum_duplicates<(int,signed char)>(int const,int const,int [],int [],signed char [])\n"" csr_sum_duplicates<(int,unsigned char)>(int const,int const,int [],int [],unsigned char [])\n"" csr_sum_duplicates<(int,short)>(int const,int const,int [],int [],short [])\n"" csr_sum_duplicates<(int,unsigned short)>(int const,int const,int [],int [],unsigned short [])\n"" csr_sum_duplicates<(int,int)>(int const,int const,int [],int [],int [])\n"" csr_sum_duplicates<(int,unsigned int)>(int const,int const,int [],int [],unsigned int [])\n"" csr_sum_duplicates<(int,long long)>(int const,int const,int [],int [],long long [])\n"" csr_sum_duplicates<(int,unsigned long long)>(int const,int const,int [],int [],unsigned long long [])\n"" csr_sum_duplicates<(int,float)>(int const,int const,int [],int [],float [])\n"" csr_sum_duplicates<(int,double)>(int const,int const,int [],int [],double [])\n"" csr_sum_duplicates<(int,long double)>(int const,int const,int [],int [],long double [])\n"" csr_sum_duplicates<(int,npy_cfloat_wrapper)>(int const,int const,int [],int [],npy_cfloat_wrapper [])\n"" csr_sum_duplicates<(int,npy_cdouble_wrapper)>(int const,int const,int [],int [],npy_cdouble_wrapper [])\n"" csr_sum_duplicates<(int,npy_clongdouble_wrapper)>(int const,int const,int [],int [],npy_clongdouble_wrapper [])\n"); + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'csr_sum_duplicates'.\n" + " Possible C/C++ prototypes are:\n" + " csr_sum_duplicates< int,signed char >(int const,int const,int [],int [],signed char [])\n" + " csr_sum_duplicates< int,unsigned char >(int const,int const,int [],int [],unsigned char [])\n" + " csr_sum_duplicates< int,short >(int const,int const,int [],int [],short [])\n" + " csr_sum_duplicates< int,unsigned short >(int const,int const,int [],int [],unsigned short [])\n" + " csr_sum_duplicates< int,int >(int const,int const,int [],int [],int [])\n" + " csr_sum_duplicates< int,unsigned int >(int const,int const,int [],int [],unsigned int [])\n" + " csr_sum_duplicates< int,long long >(int const,int const,int [],int [],long long [])\n" + " csr_sum_duplicates< int,unsigned long long >(int const,int const,int [],int [],unsigned long long [])\n" + " csr_sum_duplicates< int,float >(int const,int const,int [],int [],float [])\n" + " csr_sum_duplicates< int,double >(int const,int const,int [],int [],double [])\n" + " csr_sum_duplicates< int,long double >(int const,int const,int [],int [],long double [])\n" + " csr_sum_duplicates< int,npy_cfloat_wrapper >(int const,int const,int [],int [],npy_cfloat_wrapper [])\n" + " csr_sum_duplicates< int,npy_cdouble_wrapper >(int const,int const,int [],int [],npy_cdouble_wrapper [])\n" + " csr_sum_duplicates< int,npy_clongdouble_wrapper >(int const,int const,int [],int [],npy_clongdouble_wrapper [])\n"); return NULL; } @@ -92828,9 +93341,9 @@ int arg7 ; int arg8 ; int arg9 ; - std::vector *arg10 = (std::vector *) 0 ; - std::vector *arg11 = (std::vector *) 0 ; - std::vector *arg12 = (std::vector *) 0 ; + std::vector< int > *arg10 = (std::vector< int > *) 0 ; + std::vector< int > *arg11 = (std::vector< int > *) 0 ; + std::vector< signed char > *arg12 = (std::vector< signed char > *) 0 ; int val1 ; int ecode1 = 0 ; int val2 ; @@ -92849,9 +93362,9 @@ int ecode8 = 0 ; int val9 ; int ecode9 = 0 ; - std::vector *tmp10 ; - std::vector *tmp11 ; - std::vector *tmp12 ; + std::vector< int > *tmp10 ; + std::vector< int > *tmp11 ; + std::vector< signed char > *tmp12 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; @@ -92935,7 +93448,7 @@ SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "get_csr_submatrix" "', argument " "9"" of type '" "int""'"); } arg9 = static_cast< int >(val9); - get_csr_submatrix(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(signed char const (*))arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12); + get_csr_submatrix< int,signed char >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(signed char const (*))arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12); resultobj = SWIG_Py_Void(); { int length = (arg10)->size(); @@ -92993,9 +93506,9 @@ int arg7 ; int arg8 ; int arg9 ; - std::vector *arg10 = (std::vector *) 0 ; - std::vector *arg11 = (std::vector *) 0 ; - std::vector *arg12 = (std::vector *) 0 ; + std::vector< int > *arg10 = (std::vector< int > *) 0 ; + std::vector< int > *arg11 = (std::vector< int > *) 0 ; + std::vector< unsigned char > *arg12 = (std::vector< unsigned char > *) 0 ; int val1 ; int ecode1 = 0 ; int val2 ; @@ -93014,9 +93527,9 @@ int ecode8 = 0 ; int val9 ; int ecode9 = 0 ; - std::vector *tmp10 ; - std::vector *tmp11 ; - std::vector *tmp12 ; + std::vector< int > *tmp10 ; + std::vector< int > *tmp11 ; + std::vector< unsigned char > *tmp12 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; @@ -93100,7 +93613,7 @@ SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "get_csr_submatrix" "', argument " "9"" of type '" "int""'"); } arg9 = static_cast< int >(val9); - get_csr_submatrix(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned char const (*))arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12); + get_csr_submatrix< int,unsigned char >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned char const (*))arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12); resultobj = SWIG_Py_Void(); { int length = (arg10)->size(); @@ -93158,9 +93671,9 @@ int arg7 ; int arg8 ; int arg9 ; - std::vector *arg10 = (std::vector *) 0 ; - std::vector *arg11 = (std::vector *) 0 ; - std::vector *arg12 = (std::vector *) 0 ; + std::vector< int > *arg10 = (std::vector< int > *) 0 ; + std::vector< int > *arg11 = (std::vector< int > *) 0 ; + std::vector< short > *arg12 = (std::vector< short > *) 0 ; int val1 ; int ecode1 = 0 ; int val2 ; @@ -93179,9 +93692,9 @@ int ecode8 = 0 ; int val9 ; int ecode9 = 0 ; - std::vector *tmp10 ; - std::vector *tmp11 ; - std::vector *tmp12 ; + std::vector< int > *tmp10 ; + std::vector< int > *tmp11 ; + std::vector< short > *tmp12 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; @@ -93265,7 +93778,7 @@ SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "get_csr_submatrix" "', argument " "9"" of type '" "int""'"); } arg9 = static_cast< int >(val9); - get_csr_submatrix(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(short const (*))arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12); + get_csr_submatrix< int,short >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(short const (*))arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12); resultobj = SWIG_Py_Void(); { int length = (arg10)->size(); @@ -93323,9 +93836,9 @@ int arg7 ; int arg8 ; int arg9 ; - std::vector *arg10 = (std::vector *) 0 ; - std::vector *arg11 = (std::vector *) 0 ; - std::vector *arg12 = (std::vector *) 0 ; + std::vector< int > *arg10 = (std::vector< int > *) 0 ; + std::vector< int > *arg11 = (std::vector< int > *) 0 ; + std::vector< unsigned short > *arg12 = (std::vector< unsigned short > *) 0 ; int val1 ; int ecode1 = 0 ; int val2 ; @@ -93344,9 +93857,9 @@ int ecode8 = 0 ; int val9 ; int ecode9 = 0 ; - std::vector *tmp10 ; - std::vector *tmp11 ; - std::vector *tmp12 ; + std::vector< int > *tmp10 ; + std::vector< int > *tmp11 ; + std::vector< unsigned short > *tmp12 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; @@ -93430,7 +93943,7 @@ SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "get_csr_submatrix" "', argument " "9"" of type '" "int""'"); } arg9 = static_cast< int >(val9); - get_csr_submatrix(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned short const (*))arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12); + get_csr_submatrix< int,unsigned short >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned short const (*))arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12); resultobj = SWIG_Py_Void(); { int length = (arg10)->size(); @@ -93488,9 +94001,9 @@ int arg7 ; int arg8 ; int arg9 ; - std::vector *arg10 = (std::vector *) 0 ; - std::vector *arg11 = (std::vector *) 0 ; - std::vector *arg12 = (std::vector *) 0 ; + std::vector< int > *arg10 = (std::vector< int > *) 0 ; + std::vector< int > *arg11 = (std::vector< int > *) 0 ; + std::vector< int > *arg12 = (std::vector< int > *) 0 ; int val1 ; int ecode1 = 0 ; int val2 ; @@ -93509,9 +94022,9 @@ int ecode8 = 0 ; int val9 ; int ecode9 = 0 ; - std::vector *tmp10 ; - std::vector *tmp11 ; - std::vector *tmp12 ; + std::vector< int > *tmp10 ; + std::vector< int > *tmp11 ; + std::vector< int > *tmp12 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; @@ -93595,7 +94108,7 @@ SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "get_csr_submatrix" "', argument " "9"" of type '" "int""'"); } arg9 = static_cast< int >(val9); - get_csr_submatrix(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(int const (*))arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12); + get_csr_submatrix< int,int >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(int const (*))arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12); resultobj = SWIG_Py_Void(); { int length = (arg10)->size(); @@ -93653,9 +94166,9 @@ int arg7 ; int arg8 ; int arg9 ; - std::vector *arg10 = (std::vector *) 0 ; - std::vector *arg11 = (std::vector *) 0 ; - std::vector *arg12 = (std::vector *) 0 ; + std::vector< int > *arg10 = (std::vector< int > *) 0 ; + std::vector< int > *arg11 = (std::vector< int > *) 0 ; + std::vector< unsigned int > *arg12 = (std::vector< unsigned int > *) 0 ; int val1 ; int ecode1 = 0 ; int val2 ; @@ -93674,9 +94187,9 @@ int ecode8 = 0 ; int val9 ; int ecode9 = 0 ; - std::vector *tmp10 ; - std::vector *tmp11 ; - std::vector *tmp12 ; + std::vector< int > *tmp10 ; + std::vector< int > *tmp11 ; + std::vector< unsigned int > *tmp12 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; @@ -93760,7 +94273,7 @@ SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "get_csr_submatrix" "', argument " "9"" of type '" "int""'"); } arg9 = static_cast< int >(val9); - get_csr_submatrix(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned int const (*))arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12); + get_csr_submatrix< int,unsigned int >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned int const (*))arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12); resultobj = SWIG_Py_Void(); { int length = (arg10)->size(); @@ -93818,9 +94331,9 @@ int arg7 ; int arg8 ; int arg9 ; - std::vector *arg10 = (std::vector *) 0 ; - std::vector *arg11 = (std::vector *) 0 ; - std::vector *arg12 = (std::vector *) 0 ; + std::vector< int > *arg10 = (std::vector< int > *) 0 ; + std::vector< int > *arg11 = (std::vector< int > *) 0 ; + std::vector< long long > *arg12 = (std::vector< long long > *) 0 ; int val1 ; int ecode1 = 0 ; int val2 ; @@ -93839,9 +94352,9 @@ int ecode8 = 0 ; int val9 ; int ecode9 = 0 ; - std::vector *tmp10 ; - std::vector *tmp11 ; - std::vector *tmp12 ; + std::vector< int > *tmp10 ; + std::vector< int > *tmp11 ; + std::vector< long long > *tmp12 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; @@ -93925,7 +94438,7 @@ SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "get_csr_submatrix" "', argument " "9"" of type '" "int""'"); } arg9 = static_cast< int >(val9); - get_csr_submatrix(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long long const (*))arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12); + get_csr_submatrix< int,long long >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long long const (*))arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12); resultobj = SWIG_Py_Void(); { int length = (arg10)->size(); @@ -93983,9 +94496,9 @@ int arg7 ; int arg8 ; int arg9 ; - std::vector *arg10 = (std::vector *) 0 ; - std::vector *arg11 = (std::vector *) 0 ; - std::vector *arg12 = (std::vector *) 0 ; + std::vector< int > *arg10 = (std::vector< int > *) 0 ; + std::vector< int > *arg11 = (std::vector< int > *) 0 ; + std::vector< unsigned long long > *arg12 = (std::vector< unsigned long long > *) 0 ; int val1 ; int ecode1 = 0 ; int val2 ; @@ -94004,9 +94517,9 @@ int ecode8 = 0 ; int val9 ; int ecode9 = 0 ; - std::vector *tmp10 ; - std::vector *tmp11 ; - std::vector *tmp12 ; + std::vector< int > *tmp10 ; + std::vector< int > *tmp11 ; + std::vector< unsigned long long > *tmp12 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; @@ -94090,7 +94603,7 @@ SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "get_csr_submatrix" "', argument " "9"" of type '" "int""'"); } arg9 = static_cast< int >(val9); - get_csr_submatrix(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned long long const (*))arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12); + get_csr_submatrix< int,unsigned long long >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(unsigned long long const (*))arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12); resultobj = SWIG_Py_Void(); { int length = (arg10)->size(); @@ -94148,9 +94661,9 @@ int arg7 ; int arg8 ; int arg9 ; - std::vector *arg10 = (std::vector *) 0 ; - std::vector *arg11 = (std::vector *) 0 ; - std::vector *arg12 = (std::vector *) 0 ; + std::vector< int > *arg10 = (std::vector< int > *) 0 ; + std::vector< int > *arg11 = (std::vector< int > *) 0 ; + std::vector< float > *arg12 = (std::vector< float > *) 0 ; int val1 ; int ecode1 = 0 ; int val2 ; @@ -94169,9 +94682,9 @@ int ecode8 = 0 ; int val9 ; int ecode9 = 0 ; - std::vector *tmp10 ; - std::vector *tmp11 ; - std::vector *tmp12 ; + std::vector< int > *tmp10 ; + std::vector< int > *tmp11 ; + std::vector< float > *tmp12 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; @@ -94255,7 +94768,7 @@ SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "get_csr_submatrix" "', argument " "9"" of type '" "int""'"); } arg9 = static_cast< int >(val9); - get_csr_submatrix(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(float const (*))arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12); + get_csr_submatrix< int,float >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(float const (*))arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12); resultobj = SWIG_Py_Void(); { int length = (arg10)->size(); @@ -94313,9 +94826,9 @@ int arg7 ; int arg8 ; int arg9 ; - std::vector *arg10 = (std::vector *) 0 ; - std::vector *arg11 = (std::vector *) 0 ; - std::vector *arg12 = (std::vector *) 0 ; + std::vector< int > *arg10 = (std::vector< int > *) 0 ; + std::vector< int > *arg11 = (std::vector< int > *) 0 ; + std::vector< double > *arg12 = (std::vector< double > *) 0 ; int val1 ; int ecode1 = 0 ; int val2 ; @@ -94334,9 +94847,9 @@ int ecode8 = 0 ; int val9 ; int ecode9 = 0 ; - std::vector *tmp10 ; - std::vector *tmp11 ; - std::vector *tmp12 ; + std::vector< int > *tmp10 ; + std::vector< int > *tmp11 ; + std::vector< double > *tmp12 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; @@ -94420,7 +94933,7 @@ SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "get_csr_submatrix" "', argument " "9"" of type '" "int""'"); } arg9 = static_cast< int >(val9); - get_csr_submatrix(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(double const (*))arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12); + get_csr_submatrix< int,double >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(double const (*))arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12); resultobj = SWIG_Py_Void(); { int length = (arg10)->size(); @@ -94478,9 +94991,9 @@ int arg7 ; int arg8 ; int arg9 ; - std::vector *arg10 = (std::vector *) 0 ; - std::vector *arg11 = (std::vector *) 0 ; - std::vector *arg12 = (std::vector *) 0 ; + std::vector< int > *arg10 = (std::vector< int > *) 0 ; + std::vector< int > *arg11 = (std::vector< int > *) 0 ; + std::vector< long double > *arg12 = (std::vector< long double > *) 0 ; int val1 ; int ecode1 = 0 ; int val2 ; @@ -94499,9 +95012,9 @@ int ecode8 = 0 ; int val9 ; int ecode9 = 0 ; - std::vector *tmp10 ; - std::vector *tmp11 ; - std::vector *tmp12 ; + std::vector< int > *tmp10 ; + std::vector< int > *tmp11 ; + std::vector< long double > *tmp12 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; @@ -94585,7 +95098,7 @@ SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "get_csr_submatrix" "', argument " "9"" of type '" "int""'"); } arg9 = static_cast< int >(val9); - get_csr_submatrix(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long double const (*))arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12); + get_csr_submatrix< int,long double >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(long double const (*))arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12); resultobj = SWIG_Py_Void(); { int length = (arg10)->size(); @@ -94643,9 +95156,9 @@ int arg7 ; int arg8 ; int arg9 ; - std::vector *arg10 = (std::vector *) 0 ; - std::vector *arg11 = (std::vector *) 0 ; - std::vector *arg12 = (std::vector *) 0 ; + std::vector< int > *arg10 = (std::vector< int > *) 0 ; + std::vector< int > *arg11 = (std::vector< int > *) 0 ; + std::vector< npy_cfloat_wrapper > *arg12 = (std::vector< npy_cfloat_wrapper > *) 0 ; int val1 ; int ecode1 = 0 ; int val2 ; @@ -94664,9 +95177,9 @@ int ecode8 = 0 ; int val9 ; int ecode9 = 0 ; - std::vector *tmp10 ; - std::vector *tmp11 ; - std::vector *tmp12 ; + std::vector< int > *tmp10 ; + std::vector< int > *tmp11 ; + std::vector< npy_cfloat_wrapper > *tmp12 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; @@ -94750,7 +95263,7 @@ SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "get_csr_submatrix" "', argument " "9"" of type '" "int""'"); } arg9 = static_cast< int >(val9); - get_csr_submatrix(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cfloat_wrapper const (*))arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12); + get_csr_submatrix< int,npy_cfloat_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cfloat_wrapper const (*))arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12); resultobj = SWIG_Py_Void(); { int length = (arg10)->size(); @@ -94808,9 +95321,9 @@ int arg7 ; int arg8 ; int arg9 ; - std::vector *arg10 = (std::vector *) 0 ; - std::vector *arg11 = (std::vector *) 0 ; - std::vector *arg12 = (std::vector *) 0 ; + std::vector< int > *arg10 = (std::vector< int > *) 0 ; + std::vector< int > *arg11 = (std::vector< int > *) 0 ; + std::vector< npy_cdouble_wrapper > *arg12 = (std::vector< npy_cdouble_wrapper > *) 0 ; int val1 ; int ecode1 = 0 ; int val2 ; @@ -94829,9 +95342,9 @@ int ecode8 = 0 ; int val9 ; int ecode9 = 0 ; - std::vector *tmp10 ; - std::vector *tmp11 ; - std::vector *tmp12 ; + std::vector< int > *tmp10 ; + std::vector< int > *tmp11 ; + std::vector< npy_cdouble_wrapper > *tmp12 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; @@ -94915,7 +95428,7 @@ SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "get_csr_submatrix" "', argument " "9"" of type '" "int""'"); } arg9 = static_cast< int >(val9); - get_csr_submatrix(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cdouble_wrapper const (*))arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12); + get_csr_submatrix< int,npy_cdouble_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_cdouble_wrapper const (*))arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12); resultobj = SWIG_Py_Void(); { int length = (arg10)->size(); @@ -94973,9 +95486,9 @@ int arg7 ; int arg8 ; int arg9 ; - std::vector *arg10 = (std::vector *) 0 ; - std::vector *arg11 = (std::vector *) 0 ; - std::vector *arg12 = (std::vector *) 0 ; + std::vector< int > *arg10 = (std::vector< int > *) 0 ; + std::vector< int > *arg11 = (std::vector< int > *) 0 ; + std::vector< npy_clongdouble_wrapper > *arg12 = (std::vector< npy_clongdouble_wrapper > *) 0 ; int val1 ; int ecode1 = 0 ; int val2 ; @@ -94994,9 +95507,9 @@ int ecode8 = 0 ; int val9 ; int ecode9 = 0 ; - std::vector *tmp10 ; - std::vector *tmp11 ; - std::vector *tmp12 ; + std::vector< int > *tmp10 ; + std::vector< int > *tmp11 ; + std::vector< npy_clongdouble_wrapper > *tmp12 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; @@ -95080,7 +95593,7 @@ SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "get_csr_submatrix" "', argument " "9"" of type '" "int""'"); } arg9 = static_cast< int >(val9); - get_csr_submatrix(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_clongdouble_wrapper const (*))arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12); + get_csr_submatrix< int,npy_clongdouble_wrapper >(arg1,arg2,(int const (*))arg3,(int const (*))arg4,(npy_clongdouble_wrapper const (*))arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12); resultobj = SWIG_Py_Void(); { int length = (arg10)->size(); @@ -95909,7 +96422,22 @@ } fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'get_csr_submatrix'.\n Possible C/C++ prototypes are:\n"" get_csr_submatrix<(int,signed char)>(int const,int const,int const [],int const [],signed char const [],int const,int const,int const,int const,std::vector *,std::vector *,std::vector *)\n"" get_csr_submatrix<(int,unsigned char)>(int const,int const,int const [],int const [],unsigned char const [],int const,int const,int const,int const,std::vector *,std::vector *,std::vector *)\n"" get_csr_submatrix<(int,short)>(int const,int const,int const [],int const [],short const [],int const,int const,int const,int const,std::vector *,std::vector *,std::vector *)\n"" get_csr_submatrix<(int,unsigned short)>(int const,int const,int const [],int const [],unsigned short const [],int const,int const,int const,int const,std::vector *,std::vector *,std::vector *)\n"" get_csr_submatrix<(int,int)>(int const,int const,int const [],int const [],int const [],int const,int const,int const,int const,std::vector *,std::vector *,std::vector *)\n"" get_csr_submatrix<(int,unsigned int)>(int const,int const,int const [],int const [],unsigned int const [],int const,int const,int const,int const,std::vector *,std::vector *,std::vector *)\n"" get_csr_submatrix<(int,long long)>(int const,int const,int const [],int const [],long long const [],int const,int const,int const,int const,std::vector *,std::vector *,std::vector *)\n"" get_csr_submatrix<(int,unsigned long long)>(int const,int const,int const [],int const [],unsigned long long const [],int const,int const,int const,int const,std::vector *,std::vector *,std::vector *)\n"" get_csr_submatrix<(int,float)>(int const,int const,int const [],int const [],float const [],int const,int const,int const,int const,std::vector *,std::vector *,std::vector *)\n"" get_csr_submatrix<(int,double)>(int const,int const,int const [],int const [],double const [],int const,int const,int const,int const,std::vector *,std::vector *,std::vector *)\n"" get_csr_submatrix<(int,long double)>(int const,int const,int const [],int const [],long double const [],int const,int const,int const,int const,std::vector *,std::vector *,std::vector *)\n"" get_csr_submatrix<(int,npy_cfloat_wrapper)>(int const,int const,int const [],int const [],npy_cfloat_wrapper const [],int const,int const,int const,int const,std::vector *,std::vector *,std::vector *)\n"" get_csr_submatrix<(int,npy_cdouble_wrapper)>(int const,int const,int const [],int const [],npy_cdouble_wrapper const [],int const,int const,int const,int const,std::vector *,std::vector *,std::vector *)\n"" get_csr_submatrix<(int,npy_clongdouble_wrapper)>(int const,int const,int const [],int const [],npy_clongdouble_wrapper const [],int const,int const,int const,int const,std::vector *,std::vector *,std::vector *)\n"); + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'get_csr_submatrix'.\n" + " Possible C/C++ prototypes are:\n" + " get_csr_submatrix< int,signed char >(int const,int const,int const [],int const [],signed char const [],int const,int const,int const,int const,std::vector< int > *,std::vector< int > *,std::vector< signed char > *)\n" + " get_csr_submatrix< int,unsigned char >(int const,int const,int const [],int const [],unsigned char const [],int const,int const,int const,int const,std::vector< int > *,std::vector< int > *,std::vector< unsigned char > *)\n" + " get_csr_submatrix< int,short >(int const,int const,int const [],int const [],short const [],int const,int const,int const,int const,std::vector< int > *,std::vector< int > *,std::vector< short > *)\n" + " get_csr_submatrix< int,unsigned short >(int const,int const,int const [],int const [],unsigned short const [],int const,int const,int const,int const,std::vector< int > *,std::vector< int > *,std::vector< unsigned short > *)\n" + " get_csr_submatrix< int,int >(int const,int const,int const [],int const [],int const [],int const,int const,int const,int const,std::vector< int > *,std::vector< int > *,std::vector< int > *)\n" + " get_csr_submatrix< int,unsigned int >(int const,int const,int const [],int const [],unsigned int const [],int const,int const,int const,int const,std::vector< int > *,std::vector< int > *,std::vector< unsigned int > *)\n" + " get_csr_submatrix< int,long long >(int const,int const,int const [],int const [],long long const [],int const,int const,int const,int const,std::vector< int > *,std::vector< int > *,std::vector< long long > *)\n" + " get_csr_submatrix< int,unsigned long long >(int const,int const,int const [],int const [],unsigned long long const [],int const,int const,int const,int const,std::vector< int > *,std::vector< int > *,std::vector< unsigned long long > *)\n" + " get_csr_submatrix< int,float >(int const,int const,int const [],int const [],float const [],int const,int const,int const,int const,std::vector< int > *,std::vector< int > *,std::vector< float > *)\n" + " get_csr_submatrix< int,double >(int const,int const,int const [],int const [],double const [],int const,int const,int const,int const,std::vector< int > *,std::vector< int > *,std::vector< double > *)\n" + " get_csr_submatrix< int,long double >(int const,int const,int const [],int const [],long double const [],int const,int const,int const,int const,std::vector< int > *,std::vector< int > *,std::vector< long double > *)\n" + " get_csr_submatrix< int,npy_cfloat_wrapper >(int const,int const,int const [],int const [],npy_cfloat_wrapper const [],int const,int const,int const,int const,std::vector< int > *,std::vector< int > *,std::vector< npy_cfloat_wrapper > *)\n" + " get_csr_submatrix< int,npy_cdouble_wrapper >(int const,int const,int const [],int const [],npy_cdouble_wrapper const [],int const,int const,int const,int const,std::vector< int > *,std::vector< int > *,std::vector< npy_cdouble_wrapper > *)\n" + " get_csr_submatrix< int,npy_clongdouble_wrapper >(int const,int const,int const [],int const [],npy_clongdouble_wrapper const [],int const,int const,int const,int const,std::vector< int > *,std::vector< int > *,std::vector< npy_clongdouble_wrapper > *)\n"); return NULL; } @@ -95995,7 +96523,7 @@ if (!temp7 || !require_contiguous(temp7) || !require_native(temp7)) SWIG_fail; arg7 = (signed char*) array_data(temp7); } - coo_todense(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(signed char const (*))arg6,arg7); + coo_todense< int,signed char >(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(signed char const (*))arg6,arg7); resultobj = SWIG_Py_Void(); { if (is_new_object4 && array4) Py_DECREF(array4); @@ -96102,7 +96630,7 @@ if (!temp7 || !require_contiguous(temp7) || !require_native(temp7)) SWIG_fail; arg7 = (unsigned char*) array_data(temp7); } - coo_todense(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(unsigned char const (*))arg6,arg7); + coo_todense< int,unsigned char >(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(unsigned char const (*))arg6,arg7); resultobj = SWIG_Py_Void(); { if (is_new_object4 && array4) Py_DECREF(array4); @@ -96209,7 +96737,7 @@ if (!temp7 || !require_contiguous(temp7) || !require_native(temp7)) SWIG_fail; arg7 = (short*) array_data(temp7); } - coo_todense(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(short const (*))arg6,arg7); + coo_todense< int,short >(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(short const (*))arg6,arg7); resultobj = SWIG_Py_Void(); { if (is_new_object4 && array4) Py_DECREF(array4); @@ -96316,7 +96844,7 @@ if (!temp7 || !require_contiguous(temp7) || !require_native(temp7)) SWIG_fail; arg7 = (unsigned short*) array_data(temp7); } - coo_todense(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(unsigned short const (*))arg6,arg7); + coo_todense< int,unsigned short >(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(unsigned short const (*))arg6,arg7); resultobj = SWIG_Py_Void(); { if (is_new_object4 && array4) Py_DECREF(array4); @@ -96423,7 +96951,7 @@ if (!temp7 || !require_contiguous(temp7) || !require_native(temp7)) SWIG_fail; arg7 = (int*) array_data(temp7); } - coo_todense(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(int const (*))arg6,arg7); + coo_todense< int,int >(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(int const (*))arg6,arg7); resultobj = SWIG_Py_Void(); { if (is_new_object4 && array4) Py_DECREF(array4); @@ -96530,7 +97058,7 @@ if (!temp7 || !require_contiguous(temp7) || !require_native(temp7)) SWIG_fail; arg7 = (unsigned int*) array_data(temp7); } - coo_todense(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(unsigned int const (*))arg6,arg7); + coo_todense< int,unsigned int >(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(unsigned int const (*))arg6,arg7); resultobj = SWIG_Py_Void(); { if (is_new_object4 && array4) Py_DECREF(array4); @@ -96637,7 +97165,7 @@ if (!temp7 || !require_contiguous(temp7) || !require_native(temp7)) SWIG_fail; arg7 = (long long*) array_data(temp7); } - coo_todense(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(long long const (*))arg6,arg7); + coo_todense< int,long long >(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(long long const (*))arg6,arg7); resultobj = SWIG_Py_Void(); { if (is_new_object4 && array4) Py_DECREF(array4); @@ -96744,7 +97272,7 @@ if (!temp7 || !require_contiguous(temp7) || !require_native(temp7)) SWIG_fail; arg7 = (unsigned long long*) array_data(temp7); } - coo_todense(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(unsigned long long const (*))arg6,arg7); + coo_todense< int,unsigned long long >(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(unsigned long long const (*))arg6,arg7); resultobj = SWIG_Py_Void(); { if (is_new_object4 && array4) Py_DECREF(array4); @@ -96851,7 +97379,7 @@ if (!temp7 || !require_contiguous(temp7) || !require_native(temp7)) SWIG_fail; arg7 = (float*) array_data(temp7); } - coo_todense(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(float const (*))arg6,arg7); + coo_todense< int,float >(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(float const (*))arg6,arg7); resultobj = SWIG_Py_Void(); { if (is_new_object4 && array4) Py_DECREF(array4); @@ -96958,7 +97486,7 @@ if (!temp7 || !require_contiguous(temp7) || !require_native(temp7)) SWIG_fail; arg7 = (double*) array_data(temp7); } - coo_todense(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(double const (*))arg6,arg7); + coo_todense< int,double >(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(double const (*))arg6,arg7); resultobj = SWIG_Py_Void(); { if (is_new_object4 && array4) Py_DECREF(array4); @@ -97065,7 +97593,7 @@ if (!temp7 || !require_contiguous(temp7) || !require_native(temp7)) SWIG_fail; arg7 = (long double*) array_data(temp7); } - coo_todense(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(long double const (*))arg6,arg7); + coo_todense< int,long double >(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(long double const (*))arg6,arg7); resultobj = SWIG_Py_Void(); { if (is_new_object4 && array4) Py_DECREF(array4); @@ -97172,7 +97700,7 @@ if (!temp7 || !require_contiguous(temp7) || !require_native(temp7)) SWIG_fail; arg7 = (npy_cfloat_wrapper*) array_data(temp7); } - coo_todense(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(npy_cfloat_wrapper const (*))arg6,arg7); + coo_todense< int,npy_cfloat_wrapper >(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(npy_cfloat_wrapper const (*))arg6,arg7); resultobj = SWIG_Py_Void(); { if (is_new_object4 && array4) Py_DECREF(array4); @@ -97279,7 +97807,7 @@ if (!temp7 || !require_contiguous(temp7) || !require_native(temp7)) SWIG_fail; arg7 = (npy_cdouble_wrapper*) array_data(temp7); } - coo_todense(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(npy_cdouble_wrapper const (*))arg6,arg7); + coo_todense< int,npy_cdouble_wrapper >(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(npy_cdouble_wrapper const (*))arg6,arg7); resultobj = SWIG_Py_Void(); { if (is_new_object4 && array4) Py_DECREF(array4); @@ -97386,7 +97914,7 @@ if (!temp7 || !require_contiguous(temp7) || !require_native(temp7)) SWIG_fail; arg7 = (npy_clongdouble_wrapper*) array_data(temp7); } - coo_todense(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(npy_clongdouble_wrapper const (*))arg6,arg7); + coo_todense< int,npy_clongdouble_wrapper >(arg1,arg2,arg3,(int const (*))arg4,(int const (*))arg5,(npy_clongdouble_wrapper const (*))arg6,arg7); resultobj = SWIG_Py_Void(); { if (is_new_object4 && array4) Py_DECREF(array4); @@ -98012,7 +98540,22 @@ } fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'coo_todense'.\n Possible C/C++ prototypes are:\n"" coo_todense<(int,signed char)>(int const,int const,int const,int const [],int const [],signed char const [],signed char [])\n"" coo_todense<(int,unsigned char)>(int const,int const,int const,int const [],int const [],unsigned char const [],unsigned char [])\n"" coo_todense<(int,short)>(int const,int const,int const,int const [],int const [],short const [],short [])\n"" coo_todense<(int,unsigned short)>(int const,int const,int const,int const [],int const [],unsigned short const [],unsigned short [])\n"" coo_todense<(int,int)>(int const,int const,int const,int const [],int const [],int const [],int [])\n"" coo_todense<(int,unsigned int)>(int const,int const,int const,int const [],int const [],unsigned int const [],unsigned int [])\n"" coo_todense<(int,long long)>(int const,int const,int const,int const [],int const [],long long const [],long long [])\n"" coo_todense<(int,unsigned long long)>(int const,int const,int const,int const [],int const [],unsigned long long const [],unsigned long long [])\n"" coo_todense<(int,float)>(int const,int const,int const,int const [],int const [],float const [],float [])\n"" coo_todense<(int,double)>(int const,int const,int const,int const [],int const [],double const [],double [])\n"" coo_todense<(int,long double)>(int const,int const,int const,int const [],int const [],long double const [],long double [])\n"" coo_todense<(int,npy_cfloat_wrapper)>(int const,int const,int const,int const [],int const [],npy_cfloat_wrapper const [],npy_cfloat_wrapper [])\n"" coo_todense<(int,npy_cdouble_wrapper)>(int const,int const,int const,int const [],int const [],npy_cdouble_wrapper const [],npy_cdouble_wrapper [])\n"" coo_todense<(int,npy_clongdouble_wrapper)>(int const,int const,int const,int const [],int const [],npy_clongdouble_wrapper const [],npy_clongdouble_wrapper [])\n"); + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'coo_todense'.\n" + " Possible C/C++ prototypes are:\n" + " coo_todense< int,signed char >(int const,int const,int const,int const [],int const [],signed char const [],signed char [])\n" + " coo_todense< int,unsigned char >(int const,int const,int const,int const [],int const [],unsigned char const [],unsigned char [])\n" + " coo_todense< int,short >(int const,int const,int const,int const [],int const [],short const [],short [])\n" + " coo_todense< int,unsigned short >(int const,int const,int const,int const [],int const [],unsigned short const [],unsigned short [])\n" + " coo_todense< int,int >(int const,int const,int const,int const [],int const [],int const [],int [])\n" + " coo_todense< int,unsigned int >(int const,int const,int const,int const [],int const [],unsigned int const [],unsigned int [])\n" + " coo_todense< int,long long >(int const,int const,int const,int const [],int const [],long long const [],long long [])\n" + " coo_todense< int,unsigned long long >(int const,int const,int const,int const [],int const [],unsigned long long const [],unsigned long long [])\n" + " coo_todense< int,float >(int const,int const,int const,int const [],int const [],float const [],float [])\n" + " coo_todense< int,double >(int const,int const,int const,int const [],int const [],double const [],double [])\n" + " coo_todense< int,long double >(int const,int const,int const,int const [],int const [],long double const [],long double [])\n" + " coo_todense< int,npy_cfloat_wrapper >(int const,int const,int const,int const [],int const [],npy_cfloat_wrapper const [],npy_cfloat_wrapper [])\n" + " coo_todense< int,npy_cdouble_wrapper >(int const,int const,int const,int const [],int const [],npy_cdouble_wrapper const [],npy_cdouble_wrapper [])\n" + " coo_todense< int,npy_clongdouble_wrapper >(int const,int const,int const,int const [],int const [],npy_clongdouble_wrapper const [],npy_clongdouble_wrapper [])\n"); return NULL; } @@ -99223,71 +99766,71 @@ /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */ static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__vectorTdouble_t = {"_p_std__vectorTdouble_t", "std::vector *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__vectorTfloat_t = {"_p_std__vectorTfloat_t", "std::vector *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__vectorTint_t = {"_p_std__vectorTint_t", "std::vector *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__vectorTlong_double_t = {"_p_std__vectorTlong_double_t", "std::vector *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__vectorTlong_long_t = {"_p_std__vectorTlong_long_t", "std::vector *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__vectorTnpy_cdouble_wrapper_t = {"_p_std__vectorTnpy_cdouble_wrapper_t", "std::vector *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__vectorTnpy_cfloat_wrapper_t = {"_p_std__vectorTnpy_cfloat_wrapper_t", "std::vector *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__vectorTnpy_clongdouble_wrapper_t = {"_p_std__vectorTnpy_clongdouble_wrapper_t", "std::vector *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__vectorTshort_t = {"_p_std__vectorTshort_t", "std::vector *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__vectorTsigned_char_t = {"_p_std__vectorTsigned_char_t", "std::vector *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__vectorTunsigned_char_t = {"_p_std__vectorTunsigned_char_t", "std::vector *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__vectorTunsigned_int_t = {"_p_std__vectorTunsigned_int_t", "std::vector *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__vectorTunsigned_long_long_t = {"_p_std__vectorTunsigned_long_long_t", "std::vector *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__vectorTunsigned_short_t = {"_p_std__vectorTunsigned_short_t", "std::vector *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_std__vectorT_double_t = {"_p_std__vectorT_double_t", "std::vector< double > *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_std__vectorT_float_t = {"_p_std__vectorT_float_t", "std::vector< float > *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_std__vectorT_int_t = {"_p_std__vectorT_int_t", "std::vector< int > *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_std__vectorT_long_double_t = {"_p_std__vectorT_long_double_t", "std::vector< long double > *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_std__vectorT_long_long_t = {"_p_std__vectorT_long_long_t", "std::vector< long long > *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_std__vectorT_npy_cdouble_wrapper_t = {"_p_std__vectorT_npy_cdouble_wrapper_t", "std::vector< npy_cdouble_wrapper > *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_std__vectorT_npy_cfloat_wrapper_t = {"_p_std__vectorT_npy_cfloat_wrapper_t", "std::vector< npy_cfloat_wrapper > *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_std__vectorT_npy_clongdouble_wrapper_t = {"_p_std__vectorT_npy_clongdouble_wrapper_t", "std::vector< npy_clongdouble_wrapper > *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_std__vectorT_short_t = {"_p_std__vectorT_short_t", "std::vector< short > *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_std__vectorT_signed_char_t = {"_p_std__vectorT_signed_char_t", "std::vector< signed char > *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_std__vectorT_unsigned_char_t = {"_p_std__vectorT_unsigned_char_t", "std::vector< unsigned char > *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_std__vectorT_unsigned_int_t = {"_p_std__vectorT_unsigned_int_t", "std::vector< unsigned int > *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_std__vectorT_unsigned_long_long_t = {"_p_std__vectorT_unsigned_long_long_t", "std::vector< unsigned long long > *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_std__vectorT_unsigned_short_t = {"_p_std__vectorT_unsigned_short_t", "std::vector< unsigned short > *", 0, 0, (void*)0, 0}; static swig_type_info *swig_type_initial[] = { &_swigt__p_char, - &_swigt__p_std__vectorTdouble_t, - &_swigt__p_std__vectorTfloat_t, - &_swigt__p_std__vectorTint_t, - &_swigt__p_std__vectorTlong_double_t, - &_swigt__p_std__vectorTlong_long_t, - &_swigt__p_std__vectorTnpy_cdouble_wrapper_t, - &_swigt__p_std__vectorTnpy_cfloat_wrapper_t, - &_swigt__p_std__vectorTnpy_clongdouble_wrapper_t, - &_swigt__p_std__vectorTshort_t, - &_swigt__p_std__vectorTsigned_char_t, - &_swigt__p_std__vectorTunsigned_char_t, - &_swigt__p_std__vectorTunsigned_int_t, - &_swigt__p_std__vectorTunsigned_long_long_t, - &_swigt__p_std__vectorTunsigned_short_t, + &_swigt__p_std__vectorT_double_t, + &_swigt__p_std__vectorT_float_t, + &_swigt__p_std__vectorT_int_t, + &_swigt__p_std__vectorT_long_double_t, + &_swigt__p_std__vectorT_long_long_t, + &_swigt__p_std__vectorT_npy_cdouble_wrapper_t, + &_swigt__p_std__vectorT_npy_cfloat_wrapper_t, + &_swigt__p_std__vectorT_npy_clongdouble_wrapper_t, + &_swigt__p_std__vectorT_short_t, + &_swigt__p_std__vectorT_signed_char_t, + &_swigt__p_std__vectorT_unsigned_char_t, + &_swigt__p_std__vectorT_unsigned_int_t, + &_swigt__p_std__vectorT_unsigned_long_long_t, + &_swigt__p_std__vectorT_unsigned_short_t, }; static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__vectorTdouble_t[] = { {&_swigt__p_std__vectorTdouble_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__vectorTfloat_t[] = { {&_swigt__p_std__vectorTfloat_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__vectorTint_t[] = { {&_swigt__p_std__vectorTint_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__vectorTlong_double_t[] = { {&_swigt__p_std__vectorTlong_double_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__vectorTlong_long_t[] = { {&_swigt__p_std__vectorTlong_long_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__vectorTnpy_cdouble_wrapper_t[] = { {&_swigt__p_std__vectorTnpy_cdouble_wrapper_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__vectorTnpy_cfloat_wrapper_t[] = { {&_swigt__p_std__vectorTnpy_cfloat_wrapper_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__vectorTnpy_clongdouble_wrapper_t[] = { {&_swigt__p_std__vectorTnpy_clongdouble_wrapper_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__vectorTshort_t[] = { {&_swigt__p_std__vectorTshort_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__vectorTsigned_char_t[] = { {&_swigt__p_std__vectorTsigned_char_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__vectorTunsigned_char_t[] = { {&_swigt__p_std__vectorTunsigned_char_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__vectorTunsigned_int_t[] = { {&_swigt__p_std__vectorTunsigned_int_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__vectorTunsigned_long_long_t[] = { {&_swigt__p_std__vectorTunsigned_long_long_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__vectorTunsigned_short_t[] = { {&_swigt__p_std__vectorTunsigned_short_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_std__vectorT_double_t[] = { {&_swigt__p_std__vectorT_double_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_std__vectorT_float_t[] = { {&_swigt__p_std__vectorT_float_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_std__vectorT_int_t[] = { {&_swigt__p_std__vectorT_int_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_std__vectorT_long_double_t[] = { {&_swigt__p_std__vectorT_long_double_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_std__vectorT_long_long_t[] = { {&_swigt__p_std__vectorT_long_long_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_std__vectorT_npy_cdouble_wrapper_t[] = { {&_swigt__p_std__vectorT_npy_cdouble_wrapper_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_std__vectorT_npy_cfloat_wrapper_t[] = { {&_swigt__p_std__vectorT_npy_cfloat_wrapper_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_std__vectorT_npy_clongdouble_wrapper_t[] = { {&_swigt__p_std__vectorT_npy_clongdouble_wrapper_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_std__vectorT_short_t[] = { {&_swigt__p_std__vectorT_short_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_std__vectorT_signed_char_t[] = { {&_swigt__p_std__vectorT_signed_char_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_std__vectorT_unsigned_char_t[] = { {&_swigt__p_std__vectorT_unsigned_char_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_std__vectorT_unsigned_int_t[] = { {&_swigt__p_std__vectorT_unsigned_int_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_std__vectorT_unsigned_long_long_t[] = { {&_swigt__p_std__vectorT_unsigned_long_long_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_std__vectorT_unsigned_short_t[] = { {&_swigt__p_std__vectorT_unsigned_short_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info *swig_cast_initial[] = { _swigc__p_char, - _swigc__p_std__vectorTdouble_t, - _swigc__p_std__vectorTfloat_t, - _swigc__p_std__vectorTint_t, - _swigc__p_std__vectorTlong_double_t, - _swigc__p_std__vectorTlong_long_t, - _swigc__p_std__vectorTnpy_cdouble_wrapper_t, - _swigc__p_std__vectorTnpy_cfloat_wrapper_t, - _swigc__p_std__vectorTnpy_clongdouble_wrapper_t, - _swigc__p_std__vectorTshort_t, - _swigc__p_std__vectorTsigned_char_t, - _swigc__p_std__vectorTunsigned_char_t, - _swigc__p_std__vectorTunsigned_int_t, - _swigc__p_std__vectorTunsigned_long_long_t, - _swigc__p_std__vectorTunsigned_short_t, + _swigc__p_std__vectorT_double_t, + _swigc__p_std__vectorT_float_t, + _swigc__p_std__vectorT_int_t, + _swigc__p_std__vectorT_long_double_t, + _swigc__p_std__vectorT_long_long_t, + _swigc__p_std__vectorT_npy_cdouble_wrapper_t, + _swigc__p_std__vectorT_npy_cfloat_wrapper_t, + _swigc__p_std__vectorT_npy_clongdouble_wrapper_t, + _swigc__p_std__vectorT_short_t, + _swigc__p_std__vectorT_signed_char_t, + _swigc__p_std__vectorT_unsigned_char_t, + _swigc__p_std__vectorT_unsigned_int_t, + _swigc__p_std__vectorT_unsigned_long_long_t, + _swigc__p_std__vectorT_unsigned_short_t, }; @@ -99356,7 +99899,7 @@ SWIG_InitializeModule(void *clientdata) { size_t i; swig_module_info *module_head, *iter; - int found; + int found, init; clientdata = clientdata; @@ -99366,6 +99909,9 @@ swig_module.type_initial = swig_type_initial; swig_module.cast_initial = swig_cast_initial; swig_module.next = &swig_module; + init = 1; + } else { + init = 0; } /* Try and load any already created modules */ @@ -99394,6 +99940,12 @@ module_head->next = &swig_module; } + /* When multiple interpeters are used, a module could have already been initialized in + a different interpreter, but not yet have a pointer in this interpreter. + In this case, we do not want to continue adding types... everything should be + set up already */ + if (init == 0) return; + /* Now work on filling in swig_module.types */ #ifdef SWIGRUNTIME_DEBUG printf("SWIG_InitializeModule: size %d\n", swig_module.size); From scipy-svn at scipy.org Sat Mar 15 06:08:30 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 15 Mar 2008 05:08:30 -0500 (CDT) Subject: [Scipy-svn] r4018 - in trunk/scipy: . cluster Message-ID: <20080315100830.2625239C093@new.scipy.org> Author: cdavid Date: 2008-03-15 05:08:20 -0500 (Sat, 15 Mar 2008) New Revision: 4018 Added: trunk/scipy/cluster/SConstruct trunk/scipy/cluster/setupscons.py trunk/scipy/setupscons.py Log: Merge revisions 3870-3872 from build_with_scons branch. Copied: trunk/scipy/cluster/SConstruct (from rev 3872, branches/build_with_scons/scipy/cluster/SConstruct) Copied: trunk/scipy/cluster/setupscons.py (from rev 3872, branches/build_with_scons/scipy/cluster/setupscons.py) Copied: trunk/scipy/setupscons.py (from rev 3872, branches/build_with_scons/scipy/setupscons.py) From scipy-svn at scipy.org Sat Mar 15 06:09:39 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 15 Mar 2008 05:09:39 -0500 (CDT) Subject: [Scipy-svn] r4019 - trunk Message-ID: <20080315100939.3C46A39C18C@new.scipy.org> Author: cdavid Date: 2008-03-15 05:09:34 -0500 (Sat, 15 Mar 2008) New Revision: 4019 Added: trunk/setupscons.py Log: Merge revisions 3943-3944 from build_with_scons branch. Copied: trunk/setupscons.py (from rev 3944, branches/build_with_scons/setupscons.py) From scipy-svn at scipy.org Sat Mar 15 06:20:25 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 15 Mar 2008 05:20:25 -0500 (CDT) Subject: [Scipy-svn] r4020 - in trunk/scipy: . integrate interpolate io lib lib/blas lib/lapack linalg Message-ID: <20080315102025.A2F1AC7C015@new.scipy.org> Author: cdavid Date: 2008-03-15 05:19:52 -0500 (Sat, 15 Mar 2008) New Revision: 4020 Added: trunk/scipy/integrate/SConstruct trunk/scipy/integrate/setupscons.py trunk/scipy/interpolate/SConstruct trunk/scipy/interpolate/setupscons.py trunk/scipy/io/SConstruct trunk/scipy/io/setupscons.py trunk/scipy/lib/blas/SConstruct trunk/scipy/lib/blas/scons_support.py trunk/scipy/lib/blas/setupscons.py trunk/scipy/lib/lapack/SConstruct trunk/scipy/lib/lapack/scons_support.py trunk/scipy/lib/lapack/setupscons.py trunk/scipy/lib/setupscons.py trunk/scipy/linalg/SConstruct trunk/scipy/linalg/scons_support.py trunk/scipy/linalg/setupscons.py Modified: trunk/scipy/setupscons.py Log: Merge revisions 3970:3975 from build_with_scons. Copied: trunk/scipy/integrate/SConstruct (from rev 3975, branches/build_with_scons/scipy/integrate/SConstruct) Copied: trunk/scipy/integrate/setupscons.py (from rev 3975, branches/build_with_scons/scipy/integrate/setupscons.py) Copied: trunk/scipy/interpolate/SConstruct (from rev 3975, branches/build_with_scons/scipy/interpolate/SConstruct) Copied: trunk/scipy/interpolate/setupscons.py (from rev 3975, branches/build_with_scons/scipy/interpolate/setupscons.py) Copied: trunk/scipy/io/SConstruct (from rev 3975, branches/build_with_scons/scipy/io/SConstruct) Copied: trunk/scipy/io/setupscons.py (from rev 3975, branches/build_with_scons/scipy/io/setupscons.py) Copied: trunk/scipy/lib/blas/SConstruct (from rev 3975, branches/build_with_scons/scipy/lib/blas/SConstruct) Copied: trunk/scipy/lib/blas/scons_support.py (from rev 3975, branches/build_with_scons/scipy/lib/blas/scons_support.py) Copied: trunk/scipy/lib/blas/setupscons.py (from rev 3975, branches/build_with_scons/scipy/lib/blas/setupscons.py) Copied: trunk/scipy/lib/lapack/SConstruct (from rev 3975, branches/build_with_scons/scipy/lib/lapack/SConstruct) Copied: trunk/scipy/lib/lapack/scons_support.py (from rev 3975, branches/build_with_scons/scipy/lib/lapack/scons_support.py) Copied: trunk/scipy/lib/lapack/setupscons.py (from rev 3975, branches/build_with_scons/scipy/lib/lapack/setupscons.py) Copied: trunk/scipy/lib/setupscons.py (from rev 3975, branches/build_with_scons/scipy/lib/setupscons.py) Copied: trunk/scipy/linalg/SConstruct (from rev 3975, branches/build_with_scons/scipy/linalg/SConstruct) Copied: trunk/scipy/linalg/scons_support.py (from rev 3975, branches/build_with_scons/scipy/linalg/scons_support.py) Copied: trunk/scipy/linalg/setupscons.py (from rev 3975, branches/build_with_scons/scipy/linalg/setupscons.py) Modified: trunk/scipy/setupscons.py =================================================================== --- trunk/scipy/setupscons.py 2008-03-15 10:09:34 UTC (rev 4019) +++ trunk/scipy/setupscons.py 2008-03-15 10:19:52 UTC (rev 4020) @@ -4,11 +4,11 @@ config = Configuration('scipy',parent_package,top_path, setup_name = 'setupscons.py') config.add_subpackage('cluster') config.add_subpackage('fftpack') - #config.add_subpackage('integrate') - #config.add_subpackage('interpolate') - #config.add_subpackage('io') - #config.add_subpackage('lib') - #config.add_subpackage('linalg') + config.add_subpackage('integrate') + config.add_subpackage('interpolate') + config.add_subpackage('io') + config.add_subpackage('lib') + config.add_subpackage('linalg') #config.add_subpackage('linsolve') #config.add_subpackage('maxentropy') #config.add_subpackage('misc') From scipy-svn at scipy.org Sat Mar 15 06:32:10 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 15 Mar 2008 05:32:10 -0500 (CDT) Subject: [Scipy-svn] r4021 - trunk/scipy/fftpack Message-ID: <20080315103210.9984539C080@new.scipy.org> Author: cdavid Date: 2008-03-15 05:32:03 -0500 (Sat, 15 Mar 2008) New Revision: 4021 Added: trunk/scipy/fftpack/SConstruct trunk/scipy/fftpack/setupscons.py Log: Merge revisions 3969:3970 from build_with_scons. Copied: trunk/scipy/fftpack/SConstruct (from rev 3970, branches/build_with_scons/scipy/fftpack/SConstruct) Copied: trunk/scipy/fftpack/setupscons.py (from rev 3970, branches/build_with_scons/scipy/fftpack/setupscons.py) From scipy-svn at scipy.org Sat Mar 15 06:39:39 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 15 Mar 2008 05:39:39 -0500 (CDT) Subject: [Scipy-svn] r4022 - in trunk/scipy: . fftpack integrate interpolate maxentropy misc ndimage odr optimize sandbox signal sparse sparse/linalg sparse/linalg/dsolve sparse/linalg/dsolve/umfpack sparse/linalg/eigen sparse/linalg/eigen/arpack sparse/linalg/isolve special stats stats/models stsci stsci/convolve stsci/image testing weave Message-ID: <20080315103939.86EA739C0EB@new.scipy.org> Author: cdavid Date: 2008-03-15 05:38:18 -0500 (Sat, 15 Mar 2008) New Revision: 4022 Added: trunk/scipy/maxentropy/setupscons.py trunk/scipy/misc/setupscons.py trunk/scipy/ndimage/SConstruct trunk/scipy/ndimage/setupscons.py trunk/scipy/odr/SConstruct trunk/scipy/odr/setupscons.py trunk/scipy/optimize/SConstruct trunk/scipy/optimize/setupscons.py trunk/scipy/sandbox/setupscons.py trunk/scipy/signal/SConstruct trunk/scipy/signal/setupscons.py trunk/scipy/sparse/SConstruct trunk/scipy/sparse/linalg/dsolve/SConstruct trunk/scipy/sparse/linalg/dsolve/setupscons.py trunk/scipy/sparse/linalg/dsolve/umfpack/SConstruct trunk/scipy/sparse/linalg/dsolve/umfpack/setupscons.py trunk/scipy/sparse/linalg/eigen/arpack/SConstruct trunk/scipy/sparse/linalg/eigen/arpack/setupscons.py trunk/scipy/sparse/linalg/eigen/setupscons.py trunk/scipy/sparse/linalg/isolve/SConstruct trunk/scipy/sparse/linalg/isolve/setupscons.py trunk/scipy/sparse/linalg/setupscons.py trunk/scipy/sparse/setupscons.py trunk/scipy/special/SConstruct trunk/scipy/special/setupscons.py trunk/scipy/stats/SConstruct trunk/scipy/stats/models/setupscons.py trunk/scipy/stats/setupscons.py trunk/scipy/stsci/convolve/SConstruct trunk/scipy/stsci/convolve/setupscons.py trunk/scipy/stsci/image/SConstruct trunk/scipy/stsci/image/setupscons.py trunk/scipy/stsci/setupscons.py trunk/scipy/testing/setupscons.py trunk/scipy/weave/setupscons.py Modified: trunk/scipy/fftpack/SConstruct trunk/scipy/integrate/SConstruct trunk/scipy/interpolate/SConstruct trunk/scipy/setupscons.py Log: Merge revisions 3976:3998 from build_with_scons branch Modified: trunk/scipy/fftpack/SConstruct =================================================================== --- trunk/scipy/fftpack/SConstruct 2008-03-15 10:32:03 UTC (rev 4021) +++ trunk/scipy/fftpack/SConstruct 2008-03-15 10:38:18 UTC (rev 4022) @@ -29,7 +29,7 @@ pass # Build dfftpack -src = env.Glob(pjoin('dfftpack', '*.f')) +src = env.NumpyGlob(pjoin('dfftpack', '*.f')) dfftpack = env.NumpyStaticExtLibrary('dfftpack', source = [str(s) for s in src]) env.AppendUnique(LIBS = ['dfftpack']) env.AppendUnique(LIBPATH = env['build_dir']) Modified: trunk/scipy/integrate/SConstruct =================================================================== --- trunk/scipy/integrate/SConstruct 2008-03-15 10:32:03 UTC (rev 4021) +++ trunk/scipy/integrate/SConstruct 2008-03-15 10:38:18 UTC (rev 4022) @@ -25,20 +25,20 @@ # XXX: lapack integration # Build linpack_lite -src = [str(s) for s in env.Glob(pjoin('linpack_lite', '*.f'))] +src = [str(s) for s in env.NumpyGlob(pjoin('linpack_lite', '*.f'))] linpack_lite = env.NumpyStaticExtLibrary('linpack_lite', source = src) # Build mach # XXX: do not use optimization flags for mach -src = [str(s) for s in env.Glob(pjoin('mach', '*.f'))] +src = [str(s) for s in env.NumpyGlob(pjoin('mach', '*.f'))] mach = env.NumpyStaticExtLibrary('mach', source = src) # Build quadpack -src = [str(s) for s in env.Glob(pjoin('quadpack', '*.f'))] +src = [str(s) for s in env.NumpyGlob(pjoin('quadpack', '*.f'))] quadpack = env.NumpyStaticExtLibrary('quadpack', source = src) # Build odepack -src = [str(s) for s in env.Glob(pjoin('odepack', '*.f'))] +src = [str(s) for s in env.NumpyGlob(pjoin('odepack', '*.f'))] odepack = env.NumpyStaticExtLibrary('odepack', source = src) #env.AppendUnique(LIBS = ['linpack_lite', 'quadpack', 'odepack', 'mach']) Modified: trunk/scipy/interpolate/SConstruct =================================================================== --- trunk/scipy/interpolate/SConstruct 2008-03-15 10:32:03 UTC (rev 4021) +++ trunk/scipy/interpolate/SConstruct 2008-03-15 10:38:18 UTC (rev 4022) @@ -17,7 +17,7 @@ env.AppendUnique(LINKFLAGS = env['F77_LDFLAGS']) # Build fitpack -src = [str(s) for s in env.Glob(pjoin('fitpack', '*.f'))] +src = [str(s) for s in env.NumpyGlob(pjoin('fitpack', '*.f'))] fitpack = env.NumpyStaticExtLibrary('fitpack', source = src) env.AppendUnique(LIBS = ['fitpack']) Copied: trunk/scipy/maxentropy/setupscons.py (from rev 3998, branches/build_with_scons/scipy/maxentropy/setupscons.py) Copied: trunk/scipy/misc/setupscons.py (from rev 3998, branches/build_with_scons/scipy/misc/setupscons.py) Copied: trunk/scipy/ndimage/SConstruct (from rev 3998, branches/build_with_scons/scipy/ndimage/SConstruct) Copied: trunk/scipy/ndimage/setupscons.py (from rev 3998, branches/build_with_scons/scipy/ndimage/setupscons.py) Copied: trunk/scipy/odr/SConstruct (from rev 3998, branches/build_with_scons/scipy/odr/SConstruct) Copied: trunk/scipy/odr/setupscons.py (from rev 3998, branches/build_with_scons/scipy/odr/setupscons.py) Copied: trunk/scipy/optimize/SConstruct (from rev 3998, branches/build_with_scons/scipy/optimize/SConstruct) Copied: trunk/scipy/optimize/setupscons.py (from rev 3998, branches/build_with_scons/scipy/optimize/setupscons.py) Copied: trunk/scipy/sandbox/setupscons.py (from rev 3998, branches/build_with_scons/scipy/sandbox/setupscons.py) Modified: trunk/scipy/setupscons.py =================================================================== --- trunk/scipy/setupscons.py 2008-03-15 10:32:03 UTC (rev 4021) +++ trunk/scipy/setupscons.py 2008-03-15 10:38:18 UTC (rev 4022) @@ -9,21 +9,21 @@ config.add_subpackage('io') config.add_subpackage('lib') config.add_subpackage('linalg') - #config.add_subpackage('linsolve') - #config.add_subpackage('maxentropy') - #config.add_subpackage('misc') - #config.add_subpackage('odr') - #config.add_subpackage('optimize') - #config.add_subpackage('sandbox') - #config.add_subpackage('signal') - #config.add_subpackage('sparse') - #config.add_subpackage('special') - #config.add_subpackage('splinalg') - #config.add_subpackage('stats') - #config.add_subpackage('ndimage') - #config.add_subpackage('stsci') - #config.add_subpackage('weave') - #config.add_subpackage('testing') + config.add_subpackage('linsolve') + config.add_subpackage('maxentropy') + config.add_subpackage('misc') + config.add_subpackage('odr') + config.add_subpackage('optimize') + config.add_subpackage('sandbox') + config.add_subpackage('signal') + config.add_subpackage('sparse') + config.add_subpackage('special') + config.add_subpackage('splinalg') + config.add_subpackage('stats') + config.add_subpackage('ndimage') + config.add_subpackage('stsci') + config.add_subpackage('weave') + config.add_subpackage('testing') config.make_svn_version_py() # installs __svn_version__.py config.scons_make_config_py() # installs __config__.py return config Copied: trunk/scipy/signal/SConstruct (from rev 3998, branches/build_with_scons/scipy/signal/SConstruct) Copied: trunk/scipy/signal/setupscons.py (from rev 3998, branches/build_with_scons/scipy/signal/setupscons.py) Copied: trunk/scipy/sparse/SConstruct (from rev 3998, branches/build_with_scons/scipy/sparse/SConstruct) Copied: trunk/scipy/sparse/linalg/dsolve/SConstruct (from rev 3998, branches/build_with_scons/scipy/sparse/linalg/dsolve/SConstruct) Copied: trunk/scipy/sparse/linalg/dsolve/setupscons.py (from rev 3998, branches/build_with_scons/scipy/sparse/linalg/dsolve/setupscons.py) Copied: trunk/scipy/sparse/linalg/dsolve/umfpack/SConstruct (from rev 3998, branches/build_with_scons/scipy/sparse/linalg/dsolve/umfpack/SConstruct) Copied: trunk/scipy/sparse/linalg/dsolve/umfpack/setupscons.py (from rev 3998, branches/build_with_scons/scipy/sparse/linalg/dsolve/umfpack/setupscons.py) Copied: trunk/scipy/sparse/linalg/eigen/arpack/SConstruct (from rev 3998, branches/build_with_scons/scipy/sparse/linalg/eigen/arpack/SConstruct) Copied: trunk/scipy/sparse/linalg/eigen/arpack/setupscons.py (from rev 3998, branches/build_with_scons/scipy/sparse/linalg/eigen/arpack/setupscons.py) Copied: trunk/scipy/sparse/linalg/eigen/setupscons.py (from rev 3998, branches/build_with_scons/scipy/sparse/linalg/eigen/setupscons.py) Copied: trunk/scipy/sparse/linalg/isolve/SConstruct (from rev 3998, branches/build_with_scons/scipy/sparse/linalg/isolve/SConstruct) Copied: trunk/scipy/sparse/linalg/isolve/setupscons.py (from rev 3998, branches/build_with_scons/scipy/sparse/linalg/isolve/setupscons.py) Copied: trunk/scipy/sparse/linalg/setupscons.py (from rev 3998, branches/build_with_scons/scipy/sparse/linalg/setupscons.py) Copied: trunk/scipy/sparse/setupscons.py (from rev 3998, branches/build_with_scons/scipy/sparse/setupscons.py) Copied: trunk/scipy/special/SConstruct (from rev 3998, branches/build_with_scons/scipy/special/SConstruct) Copied: trunk/scipy/special/setupscons.py (from rev 3998, branches/build_with_scons/scipy/special/setupscons.py) Copied: trunk/scipy/stats/SConstruct (from rev 3998, branches/build_with_scons/scipy/stats/SConstruct) Copied: trunk/scipy/stats/models/setupscons.py (from rev 3998, branches/build_with_scons/scipy/stats/models/setupscons.py) Copied: trunk/scipy/stats/setupscons.py (from rev 3998, branches/build_with_scons/scipy/stats/setupscons.py) Copied: trunk/scipy/stsci/convolve/SConstruct (from rev 3998, branches/build_with_scons/scipy/stsci/convolve/SConstruct) Copied: trunk/scipy/stsci/convolve/setupscons.py (from rev 3998, branches/build_with_scons/scipy/stsci/convolve/setupscons.py) Copied: trunk/scipy/stsci/image/SConstruct (from rev 3998, branches/build_with_scons/scipy/stsci/image/SConstruct) Copied: trunk/scipy/stsci/image/setupscons.py (from rev 3998, branches/build_with_scons/scipy/stsci/image/setupscons.py) Copied: trunk/scipy/stsci/setupscons.py (from rev 3998, branches/build_with_scons/scipy/stsci/setupscons.py) Copied: trunk/scipy/testing/setupscons.py (from rev 3998, branches/build_with_scons/scipy/testing/setupscons.py) Copied: trunk/scipy/weave/setupscons.py (from rev 3998, branches/build_with_scons/scipy/weave/setupscons.py) From scipy-svn at scipy.org Sat Mar 15 06:48:30 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 15 Mar 2008 05:48:30 -0500 (CDT) Subject: [Scipy-svn] r4023 - in trunk/scipy: fftpack linalg sparse/linalg/eigen/arpack Message-ID: <20080315104830.0636139C0EB@new.scipy.org> Author: cdavid Date: 2008-03-15 05:48:23 -0500 (Sat, 15 Mar 2008) New Revision: 4023 Modified: trunk/scipy/fftpack/SConstruct trunk/scipy/linalg/SConstruct trunk/scipy/sparse/linalg/eigen/arpack/SConstruct Log: Merging revs 4000:4003 from build_with_scons branch. Modified: trunk/scipy/fftpack/SConstruct =================================================================== --- trunk/scipy/fftpack/SConstruct 2008-03-15 10:38:18 UTC (rev 4022) +++ trunk/scipy/fftpack/SConstruct 2008-03-15 10:48:23 UTC (rev 4023) @@ -1,4 +1,4 @@ -# Last Change: Wed Mar 05 02:00 PM 2008 J +# Last Change: Fri Mar 07 09:00 PM 2008 J # vim:syntax=python from os.path import join as pjoin @@ -31,8 +31,8 @@ # Build dfftpack src = env.NumpyGlob(pjoin('dfftpack', '*.f')) dfftpack = env.NumpyStaticExtLibrary('dfftpack', source = [str(s) for s in src]) -env.AppendUnique(LIBS = ['dfftpack']) -env.AppendUnique(LIBPATH = env['build_dir']) +env.PrependUnique(LIBS = ['dfftpack']) +env.PrependUnique(LIBPATH = env['build_dir']) # Build _fftpack src = ['src/zfft.c','src/drfft.c','src/zrfft.c', 'src/zfftnd.c'] Modified: trunk/scipy/linalg/SConstruct =================================================================== --- trunk/scipy/linalg/SConstruct 2008-03-15 10:38:18 UTC (rev 4022) +++ trunk/scipy/linalg/SConstruct 2008-03-15 10:48:23 UTC (rev 4023) @@ -1,4 +1,4 @@ -# Last Change: Wed Mar 05 03:00 PM 2008 J +# Last Change: Fri Mar 07 07:00 PM 2008 J # vim:syntax=python import os @@ -20,45 +20,44 @@ env = GetNumpyEnvironment(ARGUMENTS) env.Append(CPPPATH = [get_python_inc(), get_numpy_include_dirs()]) + +# XXX: handle cblas wrapper for complex (check in numpy.scons or here ?) +env.AppendUnique(CPPPATH = env['F2PYINCLUDEDIR']) +env.AppendUnique(F2PYOPTIONS = '--quiet') + +env['BUILDERS']['haha'] = Builder(action = do_generate_interface, + emitter = generate_interface_emitter) + +env['BUILDERS']['hihi'] = Builder(action = do_generate_fake_interface, + emitter = generate_interface_emitter) + #if os.name == 'nt': # # NT needs the pythonlib to run any code importing Python.h, including # # simple code using only typedef and so on, so we need it for configuration # # checks # env.AppendUnique(LIBPATH = [get_pythonlib_dir()]) +fenv = env.Copy() + #======================= # Starting Configuration #======================= -config = env.NumpyConfigure(custom_tests = {'CheckCBLAS' : CheckCBLAS, - 'CheckBLAS' : CheckF77BLAS, - 'CheckCLAPACK' : CheckCLAPACK, - 'CheckLAPACK' : CheckF77LAPACK, - 'CheckF77Clib' : CheckF77Clib}) +config = env.Configure(custom_tests = {'CheckCBLAS' : CheckCBLAS, + 'CheckCLAPACK' : CheckCLAPACK}) -#-------------- -# Checking Blas -#-------------- -if not config.CheckF77Clib(): - raise RuntimeError("Could not check F/C runtime library for %s/%s, " \ - "contact the maintainer" % (env['CC'], env['F77'])) - -st = config.CheckBLAS(check_version = 1) -if not st: - raise RuntimeError("no blas found, necessary for linalg module") -if IsATLAS(env, 'blas'): - version = GetATLASVersion(env) - env.Append(CPPDEFINES = [('ATLAS_INFO', '"\\"%s"\\"' % version)]) -else: - env.Append(CPPDEFINES = [('NO_ATLAS_INFO', 1)]) - -st = config.CheckLAPACK() -if not st: - raise RuntimeError("no lapack found, necessary for linalg module") - +#------------------------- +# Checking cblas/clapack +#------------------------- if config.CheckCBLAS(): has_cblas = 1 else: has_cblas = 0 +if has_cblas: + if IsATLAS(env, 'cblas'): + version = GetATLASVersion(env) + env.Append(CPPDEFINES = [('ATLAS_INFO', '"\\"%s"\\"' % version)]) + else: + env.Append(CPPDEFINES = [('NO_ATLAS_INFO', 1)]) if config.CheckCLAPACK(): has_clapack = 1 @@ -68,30 +67,46 @@ config.Finish() write_info(env) -#========== -# Build -#========== +#--------------------------- +# Checking F77 blas/lapack +#--------------------------- +fconfig = fenv.Configure(custom_tests = {'CheckBLAS' : CheckF77BLAS, + 'CheckLAPACK' : CheckF77LAPACK, + 'CheckF77Clib' : CheckF77Clib}) -# XXX: handle cblas wrapper for complex (check in numpy.scons or here ?) -env.AppendUnique(CPPPATH = env['F2PYINCLUDEDIR']) -env.AppendUnique(F2PYOPTIONS = '--quiet') +if not fconfig.CheckF77Clib(): + raise RuntimeError("Could not check F/C runtime library for %s/%s, " \ + "contact the maintainer" % (fenv['CC'], fenv['F77'])) -env['BUILDERS']['haha'] = Builder(action = do_generate_interface, - emitter = generate_interface_emitter) +st = fconfig.CheckBLAS(check_version = 1) +if not st: + raise RuntimeError("no blas found, necessary for linalg module") +if IsATLAS(fenv, 'blas'): + version = GetATLASVersion(fenv) + env.Append(CPPDEFINES = [('ATLAS_INFO', '"\\"%s"\\"' % version)]) +else: + env.Append(CPPDEFINES = [('NO_ATLAS_INFO', 1)]) -env['BUILDERS']['hihi'] = Builder(action = do_generate_fake_interface, - emitter = generate_interface_emitter) +st = fconfig.CheckLAPACK() +if not st: + raise RuntimeError("no lapack found, necessary for linalg module") +fconfig.Finish() +write_info(fenv) + +#========== +# Build +#========== #------------ # fblas #------------ -env.haha('fblas', 'generic_fblas.pyf') +fenv.haha('fblas', 'generic_fblas.pyf') source = ['fblas.pyf'] -if IsVeclib(env, 'blas') or IsAccelerate(env, 'blas'): +if IsVeclib(fenv, 'blas') or IsAccelerate(fenv, 'blas'): source.append(pjoin('src', 'fblaswrap_veclib_c.c')) else: source.append(pjoin('src', 'fblaswrap.f')) -env.NumpyPythonExtension('fblas', source) +fenv.NumpyPythonExtension('fblas', source) #------------ # cblas @@ -105,10 +120,10 @@ #------------ # flapack #------------ -yop = env.haha('flapack', 'generic_flapack.pyf') +yop = fenv.haha('flapack', 'generic_flapack.pyf') # XXX: automatically scan dependency on flapack_user_routines.pyf ? -env.Depends(yop, pjoin(env['build_dir'], 'flapack_user_routines.pyf')) -env.NumpyPythonExtension('flapack', source = ['flapack.pyf']) +fenv.Depends(yop, pjoin(env['build_dir'], 'flapack_user_routines.pyf')) +fenv.NumpyPythonExtension('flapack', source = ['flapack.pyf']) #------------ # clapack @@ -123,11 +138,11 @@ # _flinalg #---------------- _flinalg_fsrc = ['det.f', 'lu.f'] -_flinalg_src = env.F2py( - pjoin(env['build_dir'], 'src', '_flinalgmodule.c'), - source = [pjoin(env['build_dir'], 'src', i) for i in _flinalg_fsrc]) +_flinalg_src = fenv.F2py( + pjoin(fenv['build_dir'], 'src', '_flinalgmodule.c'), + source = [pjoin(fenv['build_dir'], 'src', i) for i in _flinalg_fsrc]) -env.NumpyPythonExtension( +fenv.NumpyPythonExtension( '_flinalg', source = _flinalg_src + [pjoin('src', i) for i in _flinalg_fsrc]) #---------------- @@ -135,14 +150,13 @@ #---------------- calc_src = env.F2py(pjoin(env['build_dir'], 'src', 'calc_lworkmodule.c'), source = pjoin(env['build_dir'], 'src', 'calc_lwork.f')) -env.NumpyPythonExtension('calc_lwork', - source = calc_src + [pjoin('src', 'calc_lwork.f')], - LINKFLAGSEND = env['F77_LDFLAGS']) +fenv.NumpyPythonExtension('calc_lwork', + source = calc_src + [pjoin('src', 'calc_lwork.f')]) #-------------- # Atlas version #-------------- atlas_env = env.Copy() -if not IsATLAS(env, 'blas'): +if not IsATLAS(env, 'cblas'): atlas_env.AppendUnique(CPPDEFINES = "NO_ATLAS_INFO") atlas_env.NumpyPythonExtension('atlas_version', 'atlas_version.c') Modified: trunk/scipy/sparse/linalg/eigen/arpack/SConstruct =================================================================== --- trunk/scipy/sparse/linalg/eigen/arpack/SConstruct 2008-03-15 10:38:18 UTC (rev 4022) +++ trunk/scipy/sparse/linalg/eigen/arpack/SConstruct 2008-03-15 10:48:23 UTC (rev 4023) @@ -17,7 +17,8 @@ #----------------- # Checking Lapack #----------------- -st = config.CheckLAPACK() +st = config.CheckF77Clib() +st = config.CheckLAPACK(autoadd = 1) if not st: raise RuntimeError("no lapack found, necessary for arpack module") @@ -32,6 +33,7 @@ src = [str(s) for s in arpack_src] env.AppendUnique(CPPPATH = pjoin('ARPACK', 'SRC')) +env.AppendUnique(LIBPATH = env['build_dir']) arpack_lib = env.NumpyStaticExtLibrary('arpack', source = src) # Build _arpack extension @@ -41,4 +43,5 @@ env.NumpyFromFTemplate('arpack.pyf', 'arpack.pyf.src') wsrc = env.F2py(pjoin(env['build_dir'], '_arpackmodule.c'), pjoin(env['build_dir'], 'arpack.pyf')) -env.NumpyPythonExtension('_arpack', source = wsrc, LIBS = arpack_lib) +env.Prepend(LIBS = 'arpack') +env.NumpyPythonExtension('_arpack', source = wsrc) From scipy-svn at scipy.org Sat Mar 15 06:52:27 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 15 Mar 2008 05:52:27 -0500 (CDT) Subject: [Scipy-svn] r4024 - in trunk/scipy: integrate interpolate odr Message-ID: <20080315105227.AFF47C7C00A@new.scipy.org> Author: cdavid Date: 2008-03-15 05:52:19 -0500 (Sat, 15 Mar 2008) New Revision: 4024 Modified: trunk/scipy/integrate/SConstruct trunk/scipy/interpolate/SConstruct trunk/scipy/odr/SConstruct Log: Merging revs 4007:4010 from branch build_with_scons. Modified: trunk/scipy/integrate/SConstruct =================================================================== --- trunk/scipy/integrate/SConstruct 2008-03-15 10:48:23 UTC (rev 4023) +++ trunk/scipy/integrate/SConstruct 2008-03-15 10:52:19 UTC (rev 4024) @@ -1,4 +1,4 @@ -# Last Change: Wed Mar 05 03:00 PM 2008 J +# Last Change: Tue Mar 11 04:00 PM 2008 J # vim:syntax=python from os.path import join as pjoin import warnings @@ -41,20 +41,20 @@ src = [str(s) for s in env.NumpyGlob(pjoin('odepack', '*.f'))] odepack = env.NumpyStaticExtLibrary('odepack', source = src) -#env.AppendUnique(LIBS = ['linpack_lite', 'quadpack', 'odepack', 'mach']) env.AppendUnique(LIBPATH = env['build_dir']) +env.AppendUnique(LINKFLAGSEND = env['F77_LDFLAGS']) +quadenv = env.Copy() +quadenv.Prepend(LIBS = ['quadpack', 'linpack_lite', 'mach']) + +odenv = env.Copy() +odenv.Prepend(LIBS = ['odepack', 'linpack_lite', 'mach']) + # Build _quadpack -env.NumpyPythonExtension('_quadpack', source = '_quadpackmodule.c', - LIBS = ['quadpack', 'linpack_lite', 'mach'], - LINKFLAGSEND = env['F77_LDFLAGS']) +quadenv.NumpyPythonExtension('_quadpack', source = '_quadpackmodule.c') # Build _odepack -env.NumpyPythonExtension('_odepack', source = '_odepackmodule.c', - LIBS = ['odepack', 'linpack_lite', 'mach'], - LINKFLAGSEND = env['F77_LDFLAGS']) +odenv.NumpyPythonExtension('_odepack', source = '_odepackmodule.c') # Build vode -env.NumpyPythonExtension('vode', source = 'vode.pyf', - LIBS = ['odepack', 'linpack_lite', 'mach'], - LINKFLAGSEND = env['F77_LDFLAGS']) +odenv.NumpyPythonExtension('vode', source = 'vode.pyf') Modified: trunk/scipy/interpolate/SConstruct =================================================================== --- trunk/scipy/interpolate/SConstruct 2008-03-15 10:48:23 UTC (rev 4023) +++ trunk/scipy/interpolate/SConstruct 2008-03-15 10:52:19 UTC (rev 4024) @@ -12,16 +12,16 @@ raise Exception("Could not check F77 runtime, needed for interpolate") config.Finish() -env.AppendUnique(CPPPATH = get_numpy_include_dirs()) -env.AppendUnique(CPPPATH = env['F2PYINCLUDEDIR']) -env.AppendUnique(LINKFLAGS = env['F77_LDFLAGS']) +env.PrependUnique(CPPPATH = get_numpy_include_dirs()) +env.PrependUnique(CPPPATH = env['F2PYINCLUDEDIR']) +env.AppendUnique(LINKFLAGSEND = env['F77_LDFLAGS']) # Build fitpack src = [str(s) for s in env.NumpyGlob(pjoin('fitpack', '*.f'))] fitpack = env.NumpyStaticExtLibrary('fitpack', source = src) -env.AppendUnique(LIBS = ['fitpack']) -env.AppendUnique(LIBPATH = env['build_dir']) +env.PrependUnique(LIBS = ['fitpack']) +env.PrependUnique(LIBPATH = [env['build_dir']]) # Build _fitpack env.NumpyPythonExtension('_fitpack', source = '_fitpackmodule.c') Modified: trunk/scipy/odr/SConstruct =================================================================== --- trunk/scipy/odr/SConstruct 2008-03-15 10:48:23 UTC (rev 4023) +++ trunk/scipy/odr/SConstruct 2008-03-15 10:52:19 UTC (rev 4024) @@ -53,9 +53,10 @@ libodr_src.append(pjoin('odrpack', 'd_lpkbls.f')) env.NumpyStaticExtLibrary('odrpack', source = libodr_src) -env.AppendUnique(LIBS = 'odrpack') -env.AppendUnique(LIBPATH = env['build_dir']) +env.PrependUnique(LIBS = 'odrpack') +env.PrependUnique(LIBPATH = env['build_dir']) + # odr pyextension env.NumpyPythonExtension('__odrpack', '__odrpack.c', LINKFLAGSEND = env['F77_LDFLAGS']) From scipy-svn at scipy.org Sat Mar 15 07:01:22 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 15 Mar 2008 06:01:22 -0500 (CDT) Subject: [Scipy-svn] r4025 - trunk/scipy/cluster Message-ID: <20080315110122.9F96D39C063@new.scipy.org> Author: cdavid Date: 2008-03-15 06:01:18 -0500 (Sat, 15 Mar 2008) New Revision: 4025 Modified: trunk/scipy/cluster/SConstruct Log: Merging 3942:3943 from branch build_with_scons. Modified: trunk/scipy/cluster/SConstruct =================================================================== --- trunk/scipy/cluster/SConstruct 2008-03-15 10:52:19 UTC (rev 4024) +++ trunk/scipy/cluster/SConstruct 2008-03-15 11:01:18 UTC (rev 4025) @@ -3,7 +3,7 @@ from os.path import join from numpy.distutils.misc_util import get_numpy_include_dirs -from numpy.distutils.scons import GetNumpyEnvironment +from numscons import GetNumpyEnvironment env = GetNumpyEnvironment(ARGUMENTS) From scipy-svn at scipy.org Sat Mar 15 09:20:03 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 15 Mar 2008 08:20:03 -0500 (CDT) Subject: [Scipy-svn] r4026 - trunk/scipy/sparse/linalg/eigen/arpack/ARPACK/SRC Message-ID: <20080315132003.ED85C39C080@new.scipy.org> Author: hagberg Date: 2008-03-15 08:19:57 -0500 (Sat, 15 Mar 2008) New Revision: 4026 Removed: trunk/scipy/sparse/linalg/eigen/arpack/ARPACK/SRC/dnaupe.f trunk/scipy/sparse/linalg/eigen/arpack/ARPACK/SRC/snaupe.f Log: remove empty (and unused) fortran files from ARPACK Deleted: trunk/scipy/sparse/linalg/eigen/arpack/ARPACK/SRC/dnaupe.f =================================================================== Deleted: trunk/scipy/sparse/linalg/eigen/arpack/ARPACK/SRC/snaupe.f =================================================================== From scipy-svn at scipy.org Sat Mar 15 23:59:27 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 15 Mar 2008 22:59:27 -0500 (CDT) Subject: [Scipy-svn] r4027 - in trunk/scipy: io/matlab io/matlab/tests io/matlab/tests/data testing testing/examples Message-ID: <20080316035927.8CA8039C0F1@new.scipy.org> Author: cdavid Date: 2008-03-15 22:59:16 -0500 (Sat, 15 Mar 2008) New Revision: 4027 Modified: trunk/scipy/io/matlab/ trunk/scipy/io/matlab/tests/ trunk/scipy/io/matlab/tests/data/ trunk/scipy/testing/ trunk/scipy/testing/examples/ Log: Set svn:ignore to sensible values in scipy/io/matlab and scipy/testing/. Property changes on: trunk/scipy/io/matlab ___________________________________________________________________ Name: svn:ignore + *.pyc *.swp *.pyd *.so Property changes on: trunk/scipy/io/matlab/tests ___________________________________________________________________ Name: svn:ignore + *.pyc *.swp *.pyd *.so Property changes on: trunk/scipy/io/matlab/tests/data ___________________________________________________________________ Name: svn:ignore - *.pyc *.swp *.pyd *.so + *.pyc *.swp *.pyd *.so Property changes on: trunk/scipy/testing ___________________________________________________________________ Name: svn:ignore + *.pyc *.swp *.pyd *.so Property changes on: trunk/scipy/testing/examples ___________________________________________________________________ Name: svn:ignore + *.pyc *.swp *.pyd *.so From scipy-svn at scipy.org Mon Mar 17 09:38:28 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Mon, 17 Mar 2008 08:38:28 -0500 (CDT) Subject: [Scipy-svn] r4028 - in trunk/scipy/sparse: . linalg/dsolve/umfpack/tests sparsetools tests Message-ID: <20080317133828.D73AA39C0E5@new.scipy.org> Author: wnbell Date: 2008-03-17 08:38:19 -0500 (Mon, 17 Mar 2008) New Revision: 4028 Modified: trunk/scipy/sparse/dia.py trunk/scipy/sparse/linalg/dsolve/umfpack/tests/test_umfpack.py trunk/scipy/sparse/sparsetools/sparsetools.h trunk/scipy/sparse/sparsetools/sparsetools.i trunk/scipy/sparse/sparsetools/sparsetools.py trunk/scipy/sparse/sparsetools/sparsetools_wrap.cxx trunk/scipy/sparse/tests/bench_sparse.py Log: added DIA matrix vector product Modified: trunk/scipy/sparse/dia.py =================================================================== --- trunk/scipy/sparse/dia.py 2008-03-16 03:59:16 UTC (rev 4027) +++ trunk/scipy/sparse/dia.py 2008-03-17 13:38:19 UTC (rev 4028) @@ -12,6 +12,8 @@ from data import _data_matrix from sputils import isscalarlike, isshape, upcast, getdtype, isdense +from sparsetools import dia_matvec + class dia_matrix(_data_matrix): """Sparse matrix with DIAgonal storage @@ -157,14 +159,13 @@ raise ValueError, "shape mismatch error" return self.tocsr() * other - #TODO handle sparse matmat here + #TODO handle sparse/sparse matmat here else: - # matvec handles multiple columns - return self.matvec(other) + return self.tocsr() * other + #TODO handle sparse/dense matmat here def matvec(self,other): - # can we do the multiply add faster? x = asarray(other) if x.ndim == 1: @@ -177,21 +178,8 @@ L = self.data.shape[1] M,N = self.shape - - for diag,k in zip(self.data,self.diags): - j_start = max(0,k) - j_end = min(M+k,N,L) - - i_start = max(0,-k) - i_end = i_start + (j_end - j_start) - - #we'd prefer a fused multiply add here - multiply(diag[j_start:j_end].reshape(-1,1), x[j_start:j_end], temp[i_start:i_end]) - add(y[i_start:i_end],temp[i_start:i_end],y[i_start:i_end]) - - #slower version of two steps above - #y[i_start:i_end] += diag[j_start:j_end].reshape(-1,1) * x[j_start:j_end] - + + dia_matvec(M,N, len(self.diags), L, self.diags, self.data, x.ravel(), y.ravel()) if isinstance(other, matrix): y = asmatrix(y) Modified: trunk/scipy/sparse/linalg/dsolve/umfpack/tests/test_umfpack.py =================================================================== --- trunk/scipy/sparse/linalg/dsolve/umfpack/tests/test_umfpack.py 2008-03-16 03:59:16 UTC (rev 4027) +++ trunk/scipy/sparse/linalg/dsolve/umfpack/tests/test_umfpack.py 2008-03-17 13:38:19 UTC (rev 4028) @@ -42,7 +42,7 @@ x = linsolve.spsolve(a, b) #print x #print "Error: ", a*x-b - assert_array_almost_equal(a*x, b) + assert_array_almost_equal(a*x, b, decimal=4) def test_solve_without_umfpack(self): @@ -53,7 +53,7 @@ x = linsolve.spsolve(a, b.astype('f')) #print x #print "Error: ", a*x-b - assert_array_almost_equal(a*x, b) + assert_array_almost_equal(a*x, b, decimal=4) def test_solve_complex_umfpack(self): Modified: trunk/scipy/sparse/sparsetools/sparsetools.h =================================================================== --- trunk/scipy/sparse/sparsetools/sparsetools.h 2008-03-16 03:59:16 UTC (rev 4027) +++ trunk/scipy/sparse/sparsetools/sparsetools.h 2008-03-17 13:38:19 UTC (rev 4028) @@ -1438,6 +1438,58 @@ } + +/* + * Compute Y += A*X for DIA matrix A and dense vectors X,Y + * + * + * Input Arguments: + * I n_row - number of rows in A + * I n_col - number of columns in A + * I n_diags - number of diagonals + * I L - length of each diagonal + * I offsets[n_diags] - diagonal offsets + * T diags[n_diags,L] - nonzeros + * T Xx[n_col] - input vector + * + * Output Arguments: + * T Yx[n_row] - output vector + * + * Note: + * Output array Yx must be preallocated + * Negative offsets correspond to lower diagonals + * Positive offsets correspond to upper diagonals + * + */ +template +void dia_matvec(const I n_row, + const I n_col, + const I n_diags, + const I L, + const I offsets[], + const T diags[], + const T Xx[], + T Yx[]) +{ + for(I i = 0; i < n_diags; i++){ + const I k = offsets[i]; //diagonal offset + + const I i_start = std::max(0,-k); + const I j_start = std::max(0, k); + const I j_end = std::min(std::min(n_row + k, n_col),L); + + const I N = j_end - j_start; //number of elements to process + + const T * diag = diags + i*L + j_start; + const T * x = Xx + j_start; + T * y = Yx + i_start; + + for(I n = 0; n < N; n++){ + y[n] += diag[n] * x[n]; + } + } +} + //template //void bsr_tocsr(const I n_brow, // const I n_bcol, Modified: trunk/scipy/sparse/sparsetools/sparsetools.i =================================================================== --- trunk/scipy/sparse/sparsetools/sparsetools.i 2008-03-16 03:59:16 UTC (rev 4027) +++ trunk/scipy/sparse/sparsetools/sparsetools.i 2008-03-17 13:38:19 UTC (rev 4028) @@ -238,14 +238,15 @@ /* - * CSR*x and CSC*x + * A*x */ INSTANTIATE_ALL(csr_matvec) INSTANTIATE_ALL(csc_matvec) INSTANTIATE_ALL(bsr_matvec) +INSTANTIATE_ALL(dia_matvec) /* - * CSR (binary op) CSR and CSC (binary op) CSC + * A (binary op) B */ INSTANTIATE_ALL(csr_elmul_csr) INSTANTIATE_ALL(csr_eldiv_csr) Modified: trunk/scipy/sparse/sparsetools/sparsetools.py =================================================================== --- trunk/scipy/sparse/sparsetools/sparsetools.py 2008-03-16 03:59:16 UTC (rev 4027) +++ trunk/scipy/sparse/sparsetools/sparsetools.py 2008-03-17 13:38:19 UTC (rev 4028) @@ -695,6 +695,44 @@ """ return _sparsetools.bsr_matvec(*args) +def dia_matvec(*args): + """ + dia_matvec(int n_row, int n_col, int n_diags, int L, int offsets, + signed char diags, signed char Xx, signed char Yx) + dia_matvec(int n_row, int n_col, int n_diags, int L, int offsets, + unsigned char diags, unsigned char Xx, unsigned char Yx) + dia_matvec(int n_row, int n_col, int n_diags, int L, int offsets, + short diags, short Xx, short Yx) + dia_matvec(int n_row, int n_col, int n_diags, int L, int offsets, + unsigned short diags, unsigned short Xx, + unsigned short Yx) + dia_matvec(int n_row, int n_col, int n_diags, int L, int offsets, + int diags, int Xx, int Yx) + dia_matvec(int n_row, int n_col, int n_diags, int L, int offsets, + unsigned int diags, unsigned int Xx, unsigned int Yx) + dia_matvec(int n_row, int n_col, int n_diags, int L, int offsets, + long long diags, long long Xx, long long Yx) + dia_matvec(int n_row, int n_col, int n_diags, int L, int offsets, + unsigned long long diags, unsigned long long Xx, + unsigned long long Yx) + dia_matvec(int n_row, int n_col, int n_diags, int L, int offsets, + float diags, float Xx, float Yx) + dia_matvec(int n_row, int n_col, int n_diags, int L, int offsets, + double diags, double Xx, double Yx) + dia_matvec(int n_row, int n_col, int n_diags, int L, int offsets, + long double diags, long double Xx, long double Yx) + dia_matvec(int n_row, int n_col, int n_diags, int L, int offsets, + npy_cfloat_wrapper diags, npy_cfloat_wrapper Xx, + npy_cfloat_wrapper Yx) + dia_matvec(int n_row, int n_col, int n_diags, int L, int offsets, + npy_cdouble_wrapper diags, npy_cdouble_wrapper Xx, + npy_cdouble_wrapper Yx) + dia_matvec(int n_row, int n_col, int n_diags, int L, int offsets, + npy_clongdouble_wrapper diags, npy_clongdouble_wrapper Xx, + npy_clongdouble_wrapper Yx) + """ + return _sparsetools.dia_matvec(*args) + def csr_elmul_csr(*args): """ csr_elmul_csr(int n_row, int n_col, int Ap, int Aj, signed char Ax, Modified: trunk/scipy/sparse/sparsetools/sparsetools_wrap.cxx =================================================================== --- trunk/scipy/sparse/sparsetools/sparsetools_wrap.cxx 2008-03-16 03:59:16 UTC (rev 4027) +++ trunk/scipy/sparse/sparsetools/sparsetools_wrap.cxx 2008-03-17 13:38:19 UTC (rev 4028) @@ -48100,6 +48100,2320 @@ } +SWIGINTERN PyObject *_wrap_dia_matvec__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + int arg1 ; + int arg2 ; + int arg3 ; + int arg4 ; + int *arg5 ; + signed char *arg6 ; + signed char *arg7 ; + signed char *arg8 ; + int val1 ; + int ecode1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + PyArrayObject *array5 = NULL ; + int is_new_object5 ; + PyArrayObject *array6 = NULL ; + int is_new_object6 ; + PyArrayObject *array7 = NULL ; + int is_new_object7 ; + PyArrayObject *temp8 = NULL ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + PyObject * obj7 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:dia_matvec",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail; + ecode1 = SWIG_AsVal_int(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "dia_matvec" "', argument " "1"" of type '" "int""'"); + } + arg1 = static_cast< int >(val1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "dia_matvec" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "dia_matvec" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "dia_matvec" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + { + npy_intp size[1] = { + -1 + }; + array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_INT, &is_new_object5); + if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1) + || !require_contiguous(array5) || !require_native(array5)) SWIG_fail; + + arg5 = (int*) array5->data; + } + { + npy_intp size[2] = { + -1,-1 + }; + array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_BYTE, &is_new_object6); + if (!array6 || !require_dimensions(array6,2) || !require_size(array6,size,1) + || !require_contiguous(array6) || !require_native(array6)) SWIG_fail; + arg6 = (signed char*) array6->data; + } + { + npy_intp size[1] = { + -1 + }; + array7 = obj_to_array_contiguous_allow_conversion(obj6, PyArray_BYTE, &is_new_object7); + if (!array7 || !require_dimensions(array7,1) || !require_size(array7,size,1) + || !require_contiguous(array7) || !require_native(array7)) SWIG_fail; + + arg7 = (signed char*) array7->data; + } + { + temp8 = obj_to_array_no_conversion(obj7,PyArray_BYTE); + if (!temp8 || !require_contiguous(temp8) || !require_native(temp8)) SWIG_fail; + arg8 = (signed char*) array_data(temp8); + } + dia_matvec< int,signed char >(arg1,arg2,arg3,arg4,(int const (*))arg5,(signed char const (*))arg6,(signed char const (*))arg7,arg8); + resultobj = SWIG_Py_Void(); + { + if (is_new_object5 && array5) Py_DECREF(array5); + } + { + if (is_new_object6 && array6) Py_DECREF(array6); + } + { + if (is_new_object7 && array7) Py_DECREF(array7); + } + return resultobj; +fail: + { + if (is_new_object5 && array5) Py_DECREF(array5); + } + { + if (is_new_object6 && array6) Py_DECREF(array6); + } + { + if (is_new_object7 && array7) Py_DECREF(array7); + } + return NULL; +} + + +SWIGINTERN PyObject *_wrap_dia_matvec__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + int arg1 ; + int arg2 ; + int arg3 ; + int arg4 ; + int *arg5 ; + unsigned char *arg6 ; + unsigned char *arg7 ; + unsigned char *arg8 ; + int val1 ; + int ecode1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + PyArrayObject *array5 = NULL ; + int is_new_object5 ; + PyArrayObject *array6 = NULL ; + int is_new_object6 ; + PyArrayObject *array7 = NULL ; + int is_new_object7 ; + PyArrayObject *temp8 = NULL ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + PyObject * obj7 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:dia_matvec",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail; + ecode1 = SWIG_AsVal_int(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "dia_matvec" "', argument " "1"" of type '" "int""'"); + } + arg1 = static_cast< int >(val1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "dia_matvec" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "dia_matvec" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "dia_matvec" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + { + npy_intp size[1] = { + -1 + }; + array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_INT, &is_new_object5); + if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1) + || !require_contiguous(array5) || !require_native(array5)) SWIG_fail; + + arg5 = (int*) array5->data; + } + { + npy_intp size[2] = { + -1,-1 + }; + array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_UBYTE, &is_new_object6); + if (!array6 || !require_dimensions(array6,2) || !require_size(array6,size,1) + || !require_contiguous(array6) || !require_native(array6)) SWIG_fail; + arg6 = (unsigned char*) array6->data; + } + { + npy_intp size[1] = { + -1 + }; + array7 = obj_to_array_contiguous_allow_conversion(obj6, PyArray_UBYTE, &is_new_object7); + if (!array7 || !require_dimensions(array7,1) || !require_size(array7,size,1) + || !require_contiguous(array7) || !require_native(array7)) SWIG_fail; + + arg7 = (unsigned char*) array7->data; + } + { + temp8 = obj_to_array_no_conversion(obj7,PyArray_UBYTE); + if (!temp8 || !require_contiguous(temp8) || !require_native(temp8)) SWIG_fail; + arg8 = (unsigned char*) array_data(temp8); + } + dia_matvec< int,unsigned char >(arg1,arg2,arg3,arg4,(int const (*))arg5,(unsigned char const (*))arg6,(unsigned char const (*))arg7,arg8); + resultobj = SWIG_Py_Void(); + { + if (is_new_object5 && array5) Py_DECREF(array5); + } + { + if (is_new_object6 && array6) Py_DECREF(array6); + } + { + if (is_new_object7 && array7) Py_DECREF(array7); + } + return resultobj; +fail: + { + if (is_new_object5 && array5) Py_DECREF(array5); + } + { + if (is_new_object6 && array6) Py_DECREF(array6); + } + { + if (is_new_object7 && array7) Py_DECREF(array7); + } + return NULL; +} + + +SWIGINTERN PyObject *_wrap_dia_matvec__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + int arg1 ; + int arg2 ; + int arg3 ; + int arg4 ; + int *arg5 ; + short *arg6 ; + short *arg7 ; + short *arg8 ; + int val1 ; + int ecode1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + PyArrayObject *array5 = NULL ; + int is_new_object5 ; + PyArrayObject *array6 = NULL ; + int is_new_object6 ; + PyArrayObject *array7 = NULL ; + int is_new_object7 ; + PyArrayObject *temp8 = NULL ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + PyObject * obj7 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:dia_matvec",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail; + ecode1 = SWIG_AsVal_int(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "dia_matvec" "', argument " "1"" of type '" "int""'"); + } + arg1 = static_cast< int >(val1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "dia_matvec" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "dia_matvec" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "dia_matvec" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + { + npy_intp size[1] = { + -1 + }; + array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_INT, &is_new_object5); + if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1) + || !require_contiguous(array5) || !require_native(array5)) SWIG_fail; + + arg5 = (int*) array5->data; + } + { + npy_intp size[2] = { + -1,-1 + }; + array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_SHORT, &is_new_object6); + if (!array6 || !require_dimensions(array6,2) || !require_size(array6,size,1) + || !require_contiguous(array6) || !require_native(array6)) SWIG_fail; + arg6 = (short*) array6->data; + } + { + npy_intp size[1] = { + -1 + }; + array7 = obj_to_array_contiguous_allow_conversion(obj6, PyArray_SHORT, &is_new_object7); + if (!array7 || !require_dimensions(array7,1) || !require_size(array7,size,1) + || !require_contiguous(array7) || !require_native(array7)) SWIG_fail; + + arg7 = (short*) array7->data; + } + { + temp8 = obj_to_array_no_conversion(obj7,PyArray_SHORT); + if (!temp8 || !require_contiguous(temp8) || !require_native(temp8)) SWIG_fail; + arg8 = (short*) array_data(temp8); + } + dia_matvec< int,short >(arg1,arg2,arg3,arg4,(int const (*))arg5,(short const (*))arg6,(short const (*))arg7,arg8); + resultobj = SWIG_Py_Void(); + { + if (is_new_object5 && array5) Py_DECREF(array5); + } + { + if (is_new_object6 && array6) Py_DECREF(array6); + } + { + if (is_new_object7 && array7) Py_DECREF(array7); + } + return resultobj; +fail: + { + if (is_new_object5 && array5) Py_DECREF(array5); + } + { + if (is_new_object6 && array6) Py_DECREF(array6); + } + { + if (is_new_object7 && array7) Py_DECREF(array7); + } + return NULL; +} + + +SWIGINTERN PyObject *_wrap_dia_matvec__SWIG_4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + int arg1 ; + int arg2 ; + int arg3 ; + int arg4 ; + int *arg5 ; + unsigned short *arg6 ; + unsigned short *arg7 ; + unsigned short *arg8 ; + int val1 ; + int ecode1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + PyArrayObject *array5 = NULL ; + int is_new_object5 ; + PyArrayObject *array6 = NULL ; + int is_new_object6 ; + PyArrayObject *array7 = NULL ; + int is_new_object7 ; + PyArrayObject *temp8 = NULL ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + PyObject * obj7 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:dia_matvec",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail; + ecode1 = SWIG_AsVal_int(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "dia_matvec" "', argument " "1"" of type '" "int""'"); + } + arg1 = static_cast< int >(val1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "dia_matvec" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "dia_matvec" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "dia_matvec" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + { + npy_intp size[1] = { + -1 + }; + array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_INT, &is_new_object5); + if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1) + || !require_contiguous(array5) || !require_native(array5)) SWIG_fail; + + arg5 = (int*) array5->data; + } + { + npy_intp size[2] = { + -1,-1 + }; + array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_USHORT, &is_new_object6); + if (!array6 || !require_dimensions(array6,2) || !require_size(array6,size,1) + || !require_contiguous(array6) || !require_native(array6)) SWIG_fail; + arg6 = (unsigned short*) array6->data; + } + { + npy_intp size[1] = { + -1 + }; + array7 = obj_to_array_contiguous_allow_conversion(obj6, PyArray_USHORT, &is_new_object7); + if (!array7 || !require_dimensions(array7,1) || !require_size(array7,size,1) + || !require_contiguous(array7) || !require_native(array7)) SWIG_fail; + + arg7 = (unsigned short*) array7->data; + } + { + temp8 = obj_to_array_no_conversion(obj7,PyArray_USHORT); + if (!temp8 || !require_contiguous(temp8) || !require_native(temp8)) SWIG_fail; + arg8 = (unsigned short*) array_data(temp8); + } + dia_matvec< int,unsigned short >(arg1,arg2,arg3,arg4,(int const (*))arg5,(unsigned short const (*))arg6,(unsigned short const (*))arg7,arg8); + resultobj = SWIG_Py_Void(); + { + if (is_new_object5 && array5) Py_DECREF(array5); + } + { + if (is_new_object6 && array6) Py_DECREF(array6); + } + { + if (is_new_object7 && array7) Py_DECREF(array7); + } + return resultobj; +fail: + { + if (is_new_object5 && array5) Py_DECREF(array5); + } + { + if (is_new_object6 && array6) Py_DECREF(array6); + } + { + if (is_new_object7 && array7) Py_DECREF(array7); + } + return NULL; +} + + +SWIGINTERN PyObject *_wrap_dia_matvec__SWIG_5(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + int arg1 ; + int arg2 ; + int arg3 ; + int arg4 ; + int *arg5 ; + int *arg6 ; + int *arg7 ; + int *arg8 ; + int val1 ; + int ecode1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + PyArrayObject *array5 = NULL ; + int is_new_object5 ; + PyArrayObject *array6 = NULL ; + int is_new_object6 ; + PyArrayObject *array7 = NULL ; + int is_new_object7 ; + PyArrayObject *temp8 = NULL ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + PyObject * obj7 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:dia_matvec",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail; + ecode1 = SWIG_AsVal_int(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "dia_matvec" "', argument " "1"" of type '" "int""'"); + } + arg1 = static_cast< int >(val1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "dia_matvec" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "dia_matvec" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "dia_matvec" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + { + npy_intp size[1] = { + -1 + }; + array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_INT, &is_new_object5); + if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1) + || !require_contiguous(array5) || !require_native(array5)) SWIG_fail; + + arg5 = (int*) array5->data; + } + { + npy_intp size[2] = { + -1,-1 + }; + array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_INT, &is_new_object6); + if (!array6 || !require_dimensions(array6,2) || !require_size(array6,size,1) + || !require_contiguous(array6) || !require_native(array6)) SWIG_fail; + arg6 = (int*) array6->data; + } + { + npy_intp size[1] = { + -1 + }; + array7 = obj_to_array_contiguous_allow_conversion(obj6, PyArray_INT, &is_new_object7); + if (!array7 || !require_dimensions(array7,1) || !require_size(array7,size,1) + || !require_contiguous(array7) || !require_native(array7)) SWIG_fail; + + arg7 = (int*) array7->data; + } + { + temp8 = obj_to_array_no_conversion(obj7,PyArray_INT); + if (!temp8 || !require_contiguous(temp8) || !require_native(temp8)) SWIG_fail; + arg8 = (int*) array_data(temp8); + } + dia_matvec< int,int >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(int const (*))arg7,arg8); + resultobj = SWIG_Py_Void(); + { + if (is_new_object5 && array5) Py_DECREF(array5); + } + { + if (is_new_object6 && array6) Py_DECREF(array6); + } + { + if (is_new_object7 && array7) Py_DECREF(array7); + } + return resultobj; +fail: + { + if (is_new_object5 && array5) Py_DECREF(array5); + } + { + if (is_new_object6 && array6) Py_DECREF(array6); + } + { + if (is_new_object7 && array7) Py_DECREF(array7); + } + return NULL; +} + + +SWIGINTERN PyObject *_wrap_dia_matvec__SWIG_6(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + int arg1 ; + int arg2 ; + int arg3 ; + int arg4 ; + int *arg5 ; + unsigned int *arg6 ; + unsigned int *arg7 ; + unsigned int *arg8 ; + int val1 ; + int ecode1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + PyArrayObject *array5 = NULL ; + int is_new_object5 ; + PyArrayObject *array6 = NULL ; + int is_new_object6 ; + PyArrayObject *array7 = NULL ; + int is_new_object7 ; + PyArrayObject *temp8 = NULL ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + PyObject * obj7 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:dia_matvec",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail; + ecode1 = SWIG_AsVal_int(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "dia_matvec" "', argument " "1"" of type '" "int""'"); + } + arg1 = static_cast< int >(val1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "dia_matvec" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "dia_matvec" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "dia_matvec" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + { + npy_intp size[1] = { + -1 + }; + array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_INT, &is_new_object5); + if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1) + || !require_contiguous(array5) || !require_native(array5)) SWIG_fail; + + arg5 = (int*) array5->data; + } + { + npy_intp size[2] = { + -1,-1 + }; + array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_UINT, &is_new_object6); + if (!array6 || !require_dimensions(array6,2) || !require_size(array6,size,1) + || !require_contiguous(array6) || !require_native(array6)) SWIG_fail; + arg6 = (unsigned int*) array6->data; + } + { + npy_intp size[1] = { + -1 + }; + array7 = obj_to_array_contiguous_allow_conversion(obj6, PyArray_UINT, &is_new_object7); + if (!array7 || !require_dimensions(array7,1) || !require_size(array7,size,1) + || !require_contiguous(array7) || !require_native(array7)) SWIG_fail; + + arg7 = (unsigned int*) array7->data; + } + { + temp8 = obj_to_array_no_conversion(obj7,PyArray_UINT); + if (!temp8 || !require_contiguous(temp8) || !require_native(temp8)) SWIG_fail; + arg8 = (unsigned int*) array_data(temp8); + } + dia_matvec< int,unsigned int >(arg1,arg2,arg3,arg4,(int const (*))arg5,(unsigned int const (*))arg6,(unsigned int const (*))arg7,arg8); + resultobj = SWIG_Py_Void(); + { + if (is_new_object5 && array5) Py_DECREF(array5); + } + { + if (is_new_object6 && array6) Py_DECREF(array6); + } + { + if (is_new_object7 && array7) Py_DECREF(array7); + } + return resultobj; +fail: + { + if (is_new_object5 && array5) Py_DECREF(array5); + } + { + if (is_new_object6 && array6) Py_DECREF(array6); + } + { + if (is_new_object7 && array7) Py_DECREF(array7); + } + return NULL; +} + + +SWIGINTERN PyObject *_wrap_dia_matvec__SWIG_7(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + int arg1 ; + int arg2 ; + int arg3 ; + int arg4 ; + int *arg5 ; + long long *arg6 ; + long long *arg7 ; + long long *arg8 ; + int val1 ; + int ecode1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + PyArrayObject *array5 = NULL ; + int is_new_object5 ; + PyArrayObject *array6 = NULL ; + int is_new_object6 ; + PyArrayObject *array7 = NULL ; + int is_new_object7 ; + PyArrayObject *temp8 = NULL ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + PyObject * obj7 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:dia_matvec",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail; + ecode1 = SWIG_AsVal_int(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "dia_matvec" "', argument " "1"" of type '" "int""'"); + } + arg1 = static_cast< int >(val1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "dia_matvec" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "dia_matvec" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "dia_matvec" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + { + npy_intp size[1] = { + -1 + }; + array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_INT, &is_new_object5); + if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1) + || !require_contiguous(array5) || !require_native(array5)) SWIG_fail; + + arg5 = (int*) array5->data; + } + { + npy_intp size[2] = { + -1,-1 + }; + array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_LONGLONG, &is_new_object6); + if (!array6 || !require_dimensions(array6,2) || !require_size(array6,size,1) + || !require_contiguous(array6) || !require_native(array6)) SWIG_fail; + arg6 = (long long*) array6->data; + } + { + npy_intp size[1] = { + -1 + }; + array7 = obj_to_array_contiguous_allow_conversion(obj6, PyArray_LONGLONG, &is_new_object7); + if (!array7 || !require_dimensions(array7,1) || !require_size(array7,size,1) + || !require_contiguous(array7) || !require_native(array7)) SWIG_fail; + + arg7 = (long long*) array7->data; + } + { + temp8 = obj_to_array_no_conversion(obj7,PyArray_LONGLONG); + if (!temp8 || !require_contiguous(temp8) || !require_native(temp8)) SWIG_fail; + arg8 = (long long*) array_data(temp8); + } + dia_matvec< int,long long >(arg1,arg2,arg3,arg4,(int const (*))arg5,(long long const (*))arg6,(long long const (*))arg7,arg8); + resultobj = SWIG_Py_Void(); + { + if (is_new_object5 && array5) Py_DECREF(array5); + } + { + if (is_new_object6 && array6) Py_DECREF(array6); + } + { + if (is_new_object7 && array7) Py_DECREF(array7); + } + return resultobj; +fail: + { + if (is_new_object5 && array5) Py_DECREF(array5); + } + { + if (is_new_object6 && array6) Py_DECREF(array6); + } + { + if (is_new_object7 && array7) Py_DECREF(array7); + } + return NULL; +} + + +SWIGINTERN PyObject *_wrap_dia_matvec__SWIG_8(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + int arg1 ; + int arg2 ; + int arg3 ; + int arg4 ; + int *arg5 ; + unsigned long long *arg6 ; + unsigned long long *arg7 ; + unsigned long long *arg8 ; + int val1 ; + int ecode1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + PyArrayObject *array5 = NULL ; + int is_new_object5 ; + PyArrayObject *array6 = NULL ; + int is_new_object6 ; + PyArrayObject *array7 = NULL ; + int is_new_object7 ; + PyArrayObject *temp8 = NULL ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + PyObject * obj7 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:dia_matvec",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail; + ecode1 = SWIG_AsVal_int(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "dia_matvec" "', argument " "1"" of type '" "int""'"); + } + arg1 = static_cast< int >(val1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "dia_matvec" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "dia_matvec" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "dia_matvec" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + { + npy_intp size[1] = { + -1 + }; + array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_INT, &is_new_object5); + if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1) + || !require_contiguous(array5) || !require_native(array5)) SWIG_fail; + + arg5 = (int*) array5->data; + } + { + npy_intp size[2] = { + -1,-1 + }; + array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_ULONGLONG, &is_new_object6); + if (!array6 || !require_dimensions(array6,2) || !require_size(array6,size,1) + || !require_contiguous(array6) || !require_native(array6)) SWIG_fail; + arg6 = (unsigned long long*) array6->data; + } + { + npy_intp size[1] = { + -1 + }; + array7 = obj_to_array_contiguous_allow_conversion(obj6, PyArray_ULONGLONG, &is_new_object7); + if (!array7 || !require_dimensions(array7,1) || !require_size(array7,size,1) + || !require_contiguous(array7) || !require_native(array7)) SWIG_fail; + + arg7 = (unsigned long long*) array7->data; + } + { + temp8 = obj_to_array_no_conversion(obj7,PyArray_ULONGLONG); + if (!temp8 || !require_contiguous(temp8) || !require_native(temp8)) SWIG_fail; + arg8 = (unsigned long long*) array_data(temp8); + } + dia_matvec< int,unsigned long long >(arg1,arg2,arg3,arg4,(int const (*))arg5,(unsigned long long const (*))arg6,(unsigned long long const (*))arg7,arg8); + resultobj = SWIG_Py_Void(); + { + if (is_new_object5 && array5) Py_DECREF(array5); + } + { + if (is_new_object6 && array6) Py_DECREF(array6); + } + { + if (is_new_object7 && array7) Py_DECREF(array7); + } + return resultobj; +fail: + { + if (is_new_object5 && array5) Py_DECREF(array5); + } + { + if (is_new_object6 && array6) Py_DECREF(array6); + } + { + if (is_new_object7 && array7) Py_DECREF(array7); + } + return NULL; +} + + +SWIGINTERN PyObject *_wrap_dia_matvec__SWIG_9(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + int arg1 ; + int arg2 ; + int arg3 ; + int arg4 ; + int *arg5 ; + float *arg6 ; + float *arg7 ; + float *arg8 ; + int val1 ; + int ecode1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + PyArrayObject *array5 = NULL ; + int is_new_object5 ; + PyArrayObject *array6 = NULL ; + int is_new_object6 ; + PyArrayObject *array7 = NULL ; + int is_new_object7 ; + PyArrayObject *temp8 = NULL ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + PyObject * obj7 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:dia_matvec",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail; + ecode1 = SWIG_AsVal_int(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "dia_matvec" "', argument " "1"" of type '" "int""'"); + } + arg1 = static_cast< int >(val1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "dia_matvec" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "dia_matvec" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "dia_matvec" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + { + npy_intp size[1] = { + -1 + }; + array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_INT, &is_new_object5); + if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1) + || !require_contiguous(array5) || !require_native(array5)) SWIG_fail; + + arg5 = (int*) array5->data; + } + { + npy_intp size[2] = { + -1,-1 + }; + array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_FLOAT, &is_new_object6); + if (!array6 || !require_dimensions(array6,2) || !require_size(array6,size,1) + || !require_contiguous(array6) || !require_native(array6)) SWIG_fail; + arg6 = (float*) array6->data; + } + { + npy_intp size[1] = { + -1 + }; + array7 = obj_to_array_contiguous_allow_conversion(obj6, PyArray_FLOAT, &is_new_object7); + if (!array7 || !require_dimensions(array7,1) || !require_size(array7,size,1) + || !require_contiguous(array7) || !require_native(array7)) SWIG_fail; + + arg7 = (float*) array7->data; + } + { + temp8 = obj_to_array_no_conversion(obj7,PyArray_FLOAT); + if (!temp8 || !require_contiguous(temp8) || !require_native(temp8)) SWIG_fail; + arg8 = (float*) array_data(temp8); + } + dia_matvec< int,float >(arg1,arg2,arg3,arg4,(int const (*))arg5,(float const (*))arg6,(float const (*))arg7,arg8); + resultobj = SWIG_Py_Void(); + { + if (is_new_object5 && array5) Py_DECREF(array5); + } + { + if (is_new_object6 && array6) Py_DECREF(array6); + } + { + if (is_new_object7 && array7) Py_DECREF(array7); + } + return resultobj; +fail: + { + if (is_new_object5 && array5) Py_DECREF(array5); + } + { + if (is_new_object6 && array6) Py_DECREF(array6); + } + { + if (is_new_object7 && array7) Py_DECREF(array7); + } + return NULL; +} + + +SWIGINTERN PyObject *_wrap_dia_matvec__SWIG_10(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + int arg1 ; + int arg2 ; + int arg3 ; + int arg4 ; + int *arg5 ; + double *arg6 ; + double *arg7 ; + double *arg8 ; + int val1 ; + int ecode1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + PyArrayObject *array5 = NULL ; + int is_new_object5 ; + PyArrayObject *array6 = NULL ; + int is_new_object6 ; + PyArrayObject *array7 = NULL ; + int is_new_object7 ; + PyArrayObject *temp8 = NULL ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + PyObject * obj7 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:dia_matvec",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail; + ecode1 = SWIG_AsVal_int(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "dia_matvec" "', argument " "1"" of type '" "int""'"); + } + arg1 = static_cast< int >(val1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "dia_matvec" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "dia_matvec" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "dia_matvec" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + { + npy_intp size[1] = { + -1 + }; + array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_INT, &is_new_object5); + if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1) + || !require_contiguous(array5) || !require_native(array5)) SWIG_fail; + + arg5 = (int*) array5->data; + } + { + npy_intp size[2] = { + -1,-1 + }; + array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_DOUBLE, &is_new_object6); + if (!array6 || !require_dimensions(array6,2) || !require_size(array6,size,1) + || !require_contiguous(array6) || !require_native(array6)) SWIG_fail; + arg6 = (double*) array6->data; + } + { + npy_intp size[1] = { + -1 + }; + array7 = obj_to_array_contiguous_allow_conversion(obj6, PyArray_DOUBLE, &is_new_object7); + if (!array7 || !require_dimensions(array7,1) || !require_size(array7,size,1) + || !require_contiguous(array7) || !require_native(array7)) SWIG_fail; + + arg7 = (double*) array7->data; + } + { + temp8 = obj_to_array_no_conversion(obj7,PyArray_DOUBLE); + if (!temp8 || !require_contiguous(temp8) || !require_native(temp8)) SWIG_fail; + arg8 = (double*) array_data(temp8); + } + dia_matvec< int,double >(arg1,arg2,arg3,arg4,(int const (*))arg5,(double const (*))arg6,(double const (*))arg7,arg8); + resultobj = SWIG_Py_Void(); + { + if (is_new_object5 && array5) Py_DECREF(array5); + } + { + if (is_new_object6 && array6) Py_DECREF(array6); + } + { + if (is_new_object7 && array7) Py_DECREF(array7); + } + return resultobj; +fail: + { + if (is_new_object5 && array5) Py_DECREF(array5); + } + { + if (is_new_object6 && array6) Py_DECREF(array6); + } + { + if (is_new_object7 && array7) Py_DECREF(array7); + } + return NULL; +} + + +SWIGINTERN PyObject *_wrap_dia_matvec__SWIG_11(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + int arg1 ; + int arg2 ; + int arg3 ; + int arg4 ; + int *arg5 ; + long double *arg6 ; + long double *arg7 ; + long double *arg8 ; + int val1 ; + int ecode1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + PyArrayObject *array5 = NULL ; + int is_new_object5 ; + PyArrayObject *array6 = NULL ; + int is_new_object6 ; + PyArrayObject *array7 = NULL ; + int is_new_object7 ; + PyArrayObject *temp8 = NULL ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + PyObject * obj7 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:dia_matvec",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail; + ecode1 = SWIG_AsVal_int(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "dia_matvec" "', argument " "1"" of type '" "int""'"); + } + arg1 = static_cast< int >(val1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "dia_matvec" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "dia_matvec" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "dia_matvec" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + { + npy_intp size[1] = { + -1 + }; + array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_INT, &is_new_object5); + if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1) + || !require_contiguous(array5) || !require_native(array5)) SWIG_fail; + + arg5 = (int*) array5->data; + } + { + npy_intp size[2] = { + -1,-1 + }; + array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_LONGDOUBLE, &is_new_object6); + if (!array6 || !require_dimensions(array6,2) || !require_size(array6,size,1) + || !require_contiguous(array6) || !require_native(array6)) SWIG_fail; + arg6 = (long double*) array6->data; + } + { + npy_intp size[1] = { + -1 + }; + array7 = obj_to_array_contiguous_allow_conversion(obj6, PyArray_LONGDOUBLE, &is_new_object7); + if (!array7 || !require_dimensions(array7,1) || !require_size(array7,size,1) + || !require_contiguous(array7) || !require_native(array7)) SWIG_fail; + + arg7 = (long double*) array7->data; + } + { + temp8 = obj_to_array_no_conversion(obj7,PyArray_LONGDOUBLE); + if (!temp8 || !require_contiguous(temp8) || !require_native(temp8)) SWIG_fail; + arg8 = (long double*) array_data(temp8); + } + dia_matvec< int,long double >(arg1,arg2,arg3,arg4,(int const (*))arg5,(long double const (*))arg6,(long double const (*))arg7,arg8); + resultobj = SWIG_Py_Void(); + { + if (is_new_object5 && array5) Py_DECREF(array5); + } + { + if (is_new_object6 && array6) Py_DECREF(array6); + } + { + if (is_new_object7 && array7) Py_DECREF(array7); + } + return resultobj; +fail: + { + if (is_new_object5 && array5) Py_DECREF(array5); + } + { + if (is_new_object6 && array6) Py_DECREF(array6); + } + { + if (is_new_object7 && array7) Py_DECREF(array7); + } + return NULL; +} + + +SWIGINTERN PyObject *_wrap_dia_matvec__SWIG_12(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + int arg1 ; + int arg2 ; + int arg3 ; + int arg4 ; + int *arg5 ; + npy_cfloat_wrapper *arg6 ; + npy_cfloat_wrapper *arg7 ; + npy_cfloat_wrapper *arg8 ; + int val1 ; + int ecode1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + PyArrayObject *array5 = NULL ; + int is_new_object5 ; + PyArrayObject *array6 = NULL ; + int is_new_object6 ; + PyArrayObject *array7 = NULL ; + int is_new_object7 ; + PyArrayObject *temp8 = NULL ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + PyObject * obj7 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:dia_matvec",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail; + ecode1 = SWIG_AsVal_int(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "dia_matvec" "', argument " "1"" of type '" "int""'"); + } + arg1 = static_cast< int >(val1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "dia_matvec" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "dia_matvec" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "dia_matvec" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + { + npy_intp size[1] = { + -1 + }; + array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_INT, &is_new_object5); + if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1) + || !require_contiguous(array5) || !require_native(array5)) SWIG_fail; + + arg5 = (int*) array5->data; + } + { + npy_intp size[2] = { + -1,-1 + }; + array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_CFLOAT, &is_new_object6); + if (!array6 || !require_dimensions(array6,2) || !require_size(array6,size,1) + || !require_contiguous(array6) || !require_native(array6)) SWIG_fail; + arg6 = (npy_cfloat_wrapper*) array6->data; + } + { + npy_intp size[1] = { + -1 + }; + array7 = obj_to_array_contiguous_allow_conversion(obj6, PyArray_CFLOAT, &is_new_object7); + if (!array7 || !require_dimensions(array7,1) || !require_size(array7,size,1) + || !require_contiguous(array7) || !require_native(array7)) SWIG_fail; + + arg7 = (npy_cfloat_wrapper*) array7->data; + } + { + temp8 = obj_to_array_no_conversion(obj7,PyArray_CFLOAT); + if (!temp8 || !require_contiguous(temp8) || !require_native(temp8)) SWIG_fail; + arg8 = (npy_cfloat_wrapper*) array_data(temp8); + } + dia_matvec< int,npy_cfloat_wrapper >(arg1,arg2,arg3,arg4,(int const (*))arg5,(npy_cfloat_wrapper const (*))arg6,(npy_cfloat_wrapper const (*))arg7,arg8); + resultobj = SWIG_Py_Void(); + { + if (is_new_object5 && array5) Py_DECREF(array5); + } + { + if (is_new_object6 && array6) Py_DECREF(array6); + } + { + if (is_new_object7 && array7) Py_DECREF(array7); + } + return resultobj; +fail: + { + if (is_new_object5 && array5) Py_DECREF(array5); + } + { + if (is_new_object6 && array6) Py_DECREF(array6); + } + { + if (is_new_object7 && array7) Py_DECREF(array7); + } + return NULL; +} + + +SWIGINTERN PyObject *_wrap_dia_matvec__SWIG_13(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + int arg1 ; + int arg2 ; + int arg3 ; + int arg4 ; + int *arg5 ; + npy_cdouble_wrapper *arg6 ; + npy_cdouble_wrapper *arg7 ; + npy_cdouble_wrapper *arg8 ; + int val1 ; + int ecode1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + PyArrayObject *array5 = NULL ; + int is_new_object5 ; + PyArrayObject *array6 = NULL ; + int is_new_object6 ; + PyArrayObject *array7 = NULL ; + int is_new_object7 ; + PyArrayObject *temp8 = NULL ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + PyObject * obj7 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:dia_matvec",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail; + ecode1 = SWIG_AsVal_int(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "dia_matvec" "', argument " "1"" of type '" "int""'"); + } + arg1 = static_cast< int >(val1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "dia_matvec" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "dia_matvec" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "dia_matvec" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + { + npy_intp size[1] = { + -1 + }; + array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_INT, &is_new_object5); + if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1) + || !require_contiguous(array5) || !require_native(array5)) SWIG_fail; + + arg5 = (int*) array5->data; + } + { + npy_intp size[2] = { + -1,-1 + }; + array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_CDOUBLE, &is_new_object6); + if (!array6 || !require_dimensions(array6,2) || !require_size(array6,size,1) + || !require_contiguous(array6) || !require_native(array6)) SWIG_fail; + arg6 = (npy_cdouble_wrapper*) array6->data; + } + { + npy_intp size[1] = { + -1 + }; + array7 = obj_to_array_contiguous_allow_conversion(obj6, PyArray_CDOUBLE, &is_new_object7); + if (!array7 || !require_dimensions(array7,1) || !require_size(array7,size,1) + || !require_contiguous(array7) || !require_native(array7)) SWIG_fail; + + arg7 = (npy_cdouble_wrapper*) array7->data; + } + { + temp8 = obj_to_array_no_conversion(obj7,PyArray_CDOUBLE); + if (!temp8 || !require_contiguous(temp8) || !require_native(temp8)) SWIG_fail; + arg8 = (npy_cdouble_wrapper*) array_data(temp8); + } + dia_matvec< int,npy_cdouble_wrapper >(arg1,arg2,arg3,arg4,(int const (*))arg5,(npy_cdouble_wrapper const (*))arg6,(npy_cdouble_wrapper const (*))arg7,arg8); + resultobj = SWIG_Py_Void(); + { + if (is_new_object5 && array5) Py_DECREF(array5); + } + { + if (is_new_object6 && array6) Py_DECREF(array6); + } + { + if (is_new_object7 && array7) Py_DECREF(array7); + } + return resultobj; +fail: + { + if (is_new_object5 && array5) Py_DECREF(array5); + } + { + if (is_new_object6 && array6) Py_DECREF(array6); + } + { + if (is_new_object7 && array7) Py_DECREF(array7); + } + return NULL; +} + + +SWIGINTERN PyObject *_wrap_dia_matvec__SWIG_14(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + int arg1 ; + int arg2 ; + int arg3 ; + int arg4 ; + int *arg5 ; + npy_clongdouble_wrapper *arg6 ; + npy_clongdouble_wrapper *arg7 ; + npy_clongdouble_wrapper *arg8 ; + int val1 ; + int ecode1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + PyArrayObject *array5 = NULL ; + int is_new_object5 ; + PyArrayObject *array6 = NULL ; + int is_new_object6 ; + PyArrayObject *array7 = NULL ; + int is_new_object7 ; + PyArrayObject *temp8 = NULL ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + PyObject * obj7 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:dia_matvec",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail; + ecode1 = SWIG_AsVal_int(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "dia_matvec" "', argument " "1"" of type '" "int""'"); + } + arg1 = static_cast< int >(val1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "dia_matvec" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "dia_matvec" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "dia_matvec" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + { + npy_intp size[1] = { + -1 + }; + array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_INT, &is_new_object5); + if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1) + || !require_contiguous(array5) || !require_native(array5)) SWIG_fail; + + arg5 = (int*) array5->data; + } + { + npy_intp size[2] = { + -1,-1 + }; + array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_CLONGDOUBLE, &is_new_object6); + if (!array6 || !require_dimensions(array6,2) || !require_size(array6,size,1) + || !require_contiguous(array6) || !require_native(array6)) SWIG_fail; + arg6 = (npy_clongdouble_wrapper*) array6->data; + } + { + npy_intp size[1] = { + -1 + }; + array7 = obj_to_array_contiguous_allow_conversion(obj6, PyArray_CLONGDOUBLE, &is_new_object7); + if (!array7 || !require_dimensions(array7,1) || !require_size(array7,size,1) + || !require_contiguous(array7) || !require_native(array7)) SWIG_fail; + + arg7 = (npy_clongdouble_wrapper*) array7->data; + } + { + temp8 = obj_to_array_no_conversion(obj7,PyArray_CLONGDOUBLE); + if (!temp8 || !require_contiguous(temp8) || !require_native(temp8)) SWIG_fail; + arg8 = (npy_clongdouble_wrapper*) array_data(temp8); + } + dia_matvec< int,npy_clongdouble_wrapper >(arg1,arg2,arg3,arg4,(int const (*))arg5,(npy_clongdouble_wrapper const (*))arg6,(npy_clongdouble_wrapper const (*))arg7,arg8); + resultobj = SWIG_Py_Void(); + { + if (is_new_object5 && array5) Py_DECREF(array5); + } + { + if (is_new_object6 && array6) Py_DECREF(array6); + } + { + if (is_new_object7 && array7) Py_DECREF(array7); + } + return resultobj; +fail: + { + if (is_new_object5 && array5) Py_DECREF(array5); + } + { + if (is_new_object6 && array6) Py_DECREF(array6); + } + { + if (is_new_object7 && array7) Py_DECREF(array7); + } + return NULL; +} + + +SWIGINTERN PyObject *_wrap_dia_matvec(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[9]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = (int)PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 8); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 8) { + int _v; + { + int res = SWIG_AsVal_int(argv[0], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[3], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_BYTE)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_BYTE)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[7]) && PyArray_CanCastSafely(PyArray_TYPE(argv[7]),PyArray_BYTE)) ? 1 : 0; + } + if (_v) { + return _wrap_dia_matvec__SWIG_1(self, args); + } + } + } + } + } + } + } + } + } + if (argc == 8) { + int _v; + { + int res = SWIG_AsVal_int(argv[0], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[3], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_UBYTE)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_UBYTE)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[7]) && PyArray_CanCastSafely(PyArray_TYPE(argv[7]),PyArray_UBYTE)) ? 1 : 0; + } + if (_v) { + return _wrap_dia_matvec__SWIG_2(self, args); + } + } + } + } + } + } + } + } + } + if (argc == 8) { + int _v; + { + int res = SWIG_AsVal_int(argv[0], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[3], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_SHORT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_SHORT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[7]) && PyArray_CanCastSafely(PyArray_TYPE(argv[7]),PyArray_SHORT)) ? 1 : 0; + } + if (_v) { + return _wrap_dia_matvec__SWIG_3(self, args); + } + } + } + } + } + } + } + } + } + if (argc == 8) { + int _v; + { + int res = SWIG_AsVal_int(argv[0], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[3], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_USHORT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_USHORT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[7]) && PyArray_CanCastSafely(PyArray_TYPE(argv[7]),PyArray_USHORT)) ? 1 : 0; + } + if (_v) { + return _wrap_dia_matvec__SWIG_4(self, args); + } + } + } + } + } + } + } + } + } + if (argc == 8) { + int _v; + { + int res = SWIG_AsVal_int(argv[0], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[3], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[7]) && PyArray_CanCastSafely(PyArray_TYPE(argv[7]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + return _wrap_dia_matvec__SWIG_5(self, args); + } + } + } + } + } + } + } + } + } + if (argc == 8) { + int _v; + { + int res = SWIG_AsVal_int(argv[0], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[3], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_UINT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_UINT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[7]) && PyArray_CanCastSafely(PyArray_TYPE(argv[7]),PyArray_UINT)) ? 1 : 0; + } + if (_v) { + return _wrap_dia_matvec__SWIG_6(self, args); + } + } + } + } + } + } + } + } + } + if (argc == 8) { + int _v; + { + int res = SWIG_AsVal_int(argv[0], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[3], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_LONGLONG)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_LONGLONG)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[7]) && PyArray_CanCastSafely(PyArray_TYPE(argv[7]),PyArray_LONGLONG)) ? 1 : 0; + } + if (_v) { + return _wrap_dia_matvec__SWIG_7(self, args); + } + } + } + } + } + } + } + } + } + if (argc == 8) { + int _v; + { + int res = SWIG_AsVal_int(argv[0], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[3], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_ULONGLONG)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_ULONGLONG)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[7]) && PyArray_CanCastSafely(PyArray_TYPE(argv[7]),PyArray_ULONGLONG)) ? 1 : 0; + } + if (_v) { + return _wrap_dia_matvec__SWIG_8(self, args); + } + } + } + } + } + } + } + } + } + if (argc == 8) { + int _v; + { + int res = SWIG_AsVal_int(argv[0], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[3], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_FLOAT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_FLOAT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[7]) && PyArray_CanCastSafely(PyArray_TYPE(argv[7]),PyArray_FLOAT)) ? 1 : 0; + } + if (_v) { + return _wrap_dia_matvec__SWIG_9(self, args); + } + } + } + } + } + } + } + } + } + if (argc == 8) { + int _v; + { + int res = SWIG_AsVal_int(argv[0], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[3], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_DOUBLE)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_DOUBLE)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[7]) && PyArray_CanCastSafely(PyArray_TYPE(argv[7]),PyArray_DOUBLE)) ? 1 : 0; + } + if (_v) { + return _wrap_dia_matvec__SWIG_10(self, args); + } + } + } + } + } + } + } + } + } + if (argc == 8) { + int _v; + { + int res = SWIG_AsVal_int(argv[0], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[3], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_LONGDOUBLE)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_LONGDOUBLE)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[7]) && PyArray_CanCastSafely(PyArray_TYPE(argv[7]),PyArray_LONGDOUBLE)) ? 1 : 0; + } + if (_v) { + return _wrap_dia_matvec__SWIG_11(self, args); + } + } + } + } + } + } + } + } + } + if (argc == 8) { + int _v; + { + int res = SWIG_AsVal_int(argv[0], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[3], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_CFLOAT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_CFLOAT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[7]) && PyArray_CanCastSafely(PyArray_TYPE(argv[7]),PyArray_CFLOAT)) ? 1 : 0; + } + if (_v) { + return _wrap_dia_matvec__SWIG_12(self, args); + } + } + } + } + } + } + } + } + } + if (argc == 8) { + int _v; + { + int res = SWIG_AsVal_int(argv[0], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[3], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_CDOUBLE)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_CDOUBLE)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[7]) && PyArray_CanCastSafely(PyArray_TYPE(argv[7]),PyArray_CDOUBLE)) ? 1 : 0; + } + if (_v) { + return _wrap_dia_matvec__SWIG_13(self, args); + } + } + } + } + } + } + } + } + } + if (argc == 8) { + int _v; + { + int res = SWIG_AsVal_int(argv[0], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[3], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_CLONGDOUBLE)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_CLONGDOUBLE)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[7]) && PyArray_CanCastSafely(PyArray_TYPE(argv[7]),PyArray_CLONGDOUBLE)) ? 1 : 0; + } + if (_v) { + return _wrap_dia_matvec__SWIG_14(self, args); + } + } + } + } + } + } + } + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'dia_matvec'.\n" + " Possible C/C++ prototypes are:\n" + " dia_matvec< int,signed char >(int const,int const,int const,int const,int const [],signed char const [],signed char const [],signed char [])\n" + " dia_matvec< int,unsigned char >(int const,int const,int const,int const,int const [],unsigned char const [],unsigned char const [],unsigned char [])\n" + " dia_matvec< int,short >(int const,int const,int const,int const,int const [],short const [],short const [],short [])\n" + " dia_matvec< int,unsigned short >(int const,int const,int const,int const,int const [],unsigned short const [],unsigned short const [],unsigned short [])\n" + " dia_matvec< int,int >(int const,int const,int const,int const,int const [],int const [],int const [],int [])\n" + " dia_matvec< int,unsigned int >(int const,int const,int const,int const,int const [],unsigned int const [],unsigned int const [],unsigned int [])\n" + " dia_matvec< int,long long >(int const,int const,int const,int const,int const [],long long const [],long long const [],long long [])\n" + " dia_matvec< int,unsigned long long >(int const,int const,int const,int const,int const [],unsigned long long const [],unsigned long long const [],unsigned long long [])\n" + " dia_matvec< int,float >(int const,int const,int const,int const,int const [],float const [],float const [],float [])\n" + " dia_matvec< int,double >(int const,int const,int const,int const,int const [],double const [],double const [],double [])\n" + " dia_matvec< int,long double >(int const,int const,int const,int const,int const [],long double const [],long double const [],long double [])\n" + " dia_matvec< int,npy_cfloat_wrapper >(int const,int const,int const,int const,int const [],npy_cfloat_wrapper const [],npy_cfloat_wrapper const [],npy_cfloat_wrapper [])\n" + " dia_matvec< int,npy_cdouble_wrapper >(int const,int const,int const,int const,int const [],npy_cdouble_wrapper const [],npy_cdouble_wrapper const [],npy_cdouble_wrapper [])\n" + " dia_matvec< int,npy_clongdouble_wrapper >(int const,int const,int const,int const,int const [],npy_clongdouble_wrapper const [],npy_clongdouble_wrapper const [],npy_clongdouble_wrapper [])\n"); + return NULL; +} + + SWIGINTERN PyObject *_wrap_csr_elmul_csr__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; int arg1 ; @@ -99136,6 +101450,41 @@ " npy_clongdouble_wrapper Ax, npy_clongdouble_wrapper Xx, \n" " npy_clongdouble_wrapper Yx)\n" ""}, + { (char *)"dia_matvec", _wrap_dia_matvec, METH_VARARGS, (char *)"\n" + "dia_matvec(int n_row, int n_col, int n_diags, int L, int offsets, \n" + " signed char diags, signed char Xx, signed char Yx)\n" + "dia_matvec(int n_row, int n_col, int n_diags, int L, int offsets, \n" + " unsigned char diags, unsigned char Xx, unsigned char Yx)\n" + "dia_matvec(int n_row, int n_col, int n_diags, int L, int offsets, \n" + " short diags, short Xx, short Yx)\n" + "dia_matvec(int n_row, int n_col, int n_diags, int L, int offsets, \n" + " unsigned short diags, unsigned short Xx, \n" + " unsigned short Yx)\n" + "dia_matvec(int n_row, int n_col, int n_diags, int L, int offsets, \n" + " int diags, int Xx, int Yx)\n" + "dia_matvec(int n_row, int n_col, int n_diags, int L, int offsets, \n" + " unsigned int diags, unsigned int Xx, unsigned int Yx)\n" + "dia_matvec(int n_row, int n_col, int n_diags, int L, int offsets, \n" + " long long diags, long long Xx, long long Yx)\n" + "dia_matvec(int n_row, int n_col, int n_diags, int L, int offsets, \n" + " unsigned long long diags, unsigned long long Xx, \n" + " unsigned long long Yx)\n" + "dia_matvec(int n_row, int n_col, int n_diags, int L, int offsets, \n" + " float diags, float Xx, float Yx)\n" + "dia_matvec(int n_row, int n_col, int n_diags, int L, int offsets, \n" + " double diags, double Xx, double Yx)\n" + "dia_matvec(int n_row, int n_col, int n_diags, int L, int offsets, \n" + " long double diags, long double Xx, long double Yx)\n" + "dia_matvec(int n_row, int n_col, int n_diags, int L, int offsets, \n" + " npy_cfloat_wrapper diags, npy_cfloat_wrapper Xx, \n" + " npy_cfloat_wrapper Yx)\n" + "dia_matvec(int n_row, int n_col, int n_diags, int L, int offsets, \n" + " npy_cdouble_wrapper diags, npy_cdouble_wrapper Xx, \n" + " npy_cdouble_wrapper Yx)\n" + "dia_matvec(int n_row, int n_col, int n_diags, int L, int offsets, \n" + " npy_clongdouble_wrapper diags, npy_clongdouble_wrapper Xx, \n" + " npy_clongdouble_wrapper Yx)\n" + ""}, { (char *)"csr_elmul_csr", _wrap_csr_elmul_csr, METH_VARARGS, (char *)"\n" "csr_elmul_csr(int n_row, int n_col, int Ap, int Aj, signed char Ax, \n" " int Bp, int Bj, signed char Bx, int Cp, int Cj, \n" Modified: trunk/scipy/sparse/tests/bench_sparse.py =================================================================== --- trunk/scipy/sparse/tests/bench_sparse.py 2008-03-16 03:59:16 UTC (rev 4027) +++ trunk/scipy/sparse/tests/bench_sparse.py 2008-03-17 13:38:19 UTC (rev 4028) @@ -1,15 +1,15 @@ """general tests and simple benchmarks for the sparse module""" +import time + import numpy from numpy import ones, array, asarray, empty -import random from scipy.testing import * +from scipy import sparse from scipy.sparse import csc_matrix, csr_matrix, dok_matrix, \ - coo_matrix, lil_matrix, dia_matrix, spidentity, spdiags, \ - spkron -from scipy.linsolve import splu + coo_matrix, lil_matrix, dia_matrix, spdiags def random_sparse(m,n,nnz_per_row): @@ -38,17 +38,16 @@ diags[1:] = -1 #all offdiagonals diags[3,N-1::N] = 0 #first lower diagonal - diags[4,N::N] = 0 #first upper diagonal + diags[4,N::N] = 0 #first upper diagonal return dia_matrix((diags,offsets),shape=(N**2,N**2)).asformat(format) -import time -class TestSparseTools(TestCase): +class BenchmarkSparse(TestCase): """Simple benchmarks for sparse matrix module""" def bench_arithmetic(self): matrices = [] - #matrices.append( ('A','Identity', spidentity(500**2,format='csr')) ) + #matrices.append( ('A','Identity', sparse.identity(500**2,format='csr')) ) matrices.append( ('A','Poisson5pt', poisson2d(500,format='csr')) ) matrices.append( ('B','Poisson5pt^2', poisson2d(500,format='csr')**2) ) @@ -116,7 +115,7 @@ start = time.clock() iter = 0 while iter < 5 and time.clock() - start < 1: - A._has_sorted_indices = False + A.has_sorted_indices = False A.sort_indices() iter += 1 end = time.clock() @@ -128,17 +127,17 @@ def bench_matvec(self): matrices = [] - matrices.append(('Identity', spidentity(10**4,format='dia'))) - matrices.append(('Identity', spidentity(10**4,format='csr'))) + matrices.append(('Identity', sparse.identity(10**4,format='dia'))) + matrices.append(('Identity', sparse.identity(10**4,format='csr'))) matrices.append(('Poisson5pt', poisson2d(300,format='dia'))) matrices.append(('Poisson5pt', poisson2d(300,format='csr'))) matrices.append(('Poisson5pt', poisson2d(300,format='bsr'))) - A = spkron(poisson2d(150),ones((2,2))).tobsr(blocksize=(2,2)) + A = sparse.kron(poisson2d(150),ones((2,2))).tobsr(blocksize=(2,2)) matrices.append( ('Block2x2', A.tocsr()) ) matrices.append( ('Block2x2', A) ) - A = spkron(poisson2d(100),ones((3,3))).tobsr(blocksize=(3,3)) + A = sparse.kron(poisson2d(100),ones((3,3))).tobsr(blocksize=(3,3)) matrices.append( ('Block3x3', A.tocsr()) ) matrices.append( ('Block3x3', A) ) @@ -178,7 +177,7 @@ """build matrices by inserting single values""" matrices = [] matrices.append( ('Empty',csr_matrix((10000,10000))) ) - matrices.append( ('Identity',spidentity(10000)) ) + matrices.append( ('Identity',sparse.identity(10000)) ) matrices.append( ('Poisson5pt', poisson2d(100)) ) print @@ -250,31 +249,31 @@ print output -class TestLarge(TestCase): - def bench_large(self): - # Create a 100x100 matrix with 100 non-zero elements - # and play around with it - #TODO move this out of Common since it doesn't use spmatrix - random.seed(0) - A = dok_matrix((100,100)) - for k in range(100): - i = random.randrange(100) - j = random.randrange(100) - A[i,j] = 1. - csr = A.tocsr() - csc = A.tocsc() - csc2 = csr.tocsc() - coo = A.tocoo() - csr2 = coo.tocsr() - assert_array_equal(A.transpose().todense(), csr.transpose().todense()) - assert_array_equal(csc.todense(), csr.todense()) - assert_array_equal(csr.todense(), csr2.todense()) - assert_array_equal(csr2.todense().transpose(), coo.transpose().todense()) - assert_array_equal(csr2.todense(), csc2.todense()) - csr_plus_csc = csr + csc - csc_plus_csr = csc + csr - assert_array_equal(csr_plus_csc.todense(), (2*A).todense()) - assert_array_equal(csr_plus_csc.todense(), csc_plus_csr.todense()) +#class TestLarge(TestCase): +# def bench_large(self): +# # Create a 100x100 matrix with 100 non-zero elements +# # and play around with it +# #TODO move this out of Common since it doesn't use spmatrix +# random.seed(0) +# A = dok_matrix((100,100)) +# for k in range(100): +# i = random.randrange(100) +# j = random.randrange(100) +# A[i,j] = 1. +# csr = A.tocsr() +# csc = A.tocsc() +# csc2 = csr.tocsc() +# coo = A.tocoo() +# csr2 = coo.tocsr() +# assert_array_equal(A.transpose().todense(), csr.transpose().todense()) +# assert_array_equal(csc.todense(), csr.todense()) +# assert_array_equal(csr.todense(), csr2.todense()) +# assert_array_equal(csr2.todense().transpose(), coo.transpose().todense()) +# assert_array_equal(csr2.todense(), csc2.todense()) +# csr_plus_csc = csr + csc +# csc_plus_csr = csc + csr +# assert_array_equal(csr_plus_csc.todense(), (2*A).todense()) +# assert_array_equal(csr_plus_csc.todense(), csc_plus_csr.todense()) if __name__ == "__main__": From scipy-svn at scipy.org Mon Mar 17 10:59:40 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Mon, 17 Mar 2008 09:59:40 -0500 (CDT) Subject: [Scipy-svn] r4029 - trunk/scipy/ndimage Message-ID: <20080317145940.3013F39C103@new.scipy.org> Author: tom.waite Date: 2008-03-17 09:59:12 -0500 (Mon, 17 Mar 2008) New Revision: 4029 Modified: trunk/scipy/ndimage/_registration.py Log: updates and bug fixes Modified: trunk/scipy/ndimage/_registration.py =================================================================== --- trunk/scipy/ndimage/_registration.py 2008-03-17 13:38:19 UTC (rev 4028) +++ trunk/scipy/ndimage/_registration.py 2008-03-17 14:59:12 UTC (rev 4029) @@ -1032,6 +1032,33 @@ def demo_MRI_volume_align(scale=2, alpha=3.0, beta=4.0, gamma=5.0, Tx = 0.0, Ty = 0.0, Tz = 0.0): + """ + demo with (must have file ANAT1_V0001.img) + + image1, image2, imdata = reg.demo_MRI_volume_align() + x = reg.python_coreg(image1, image2, imdata, method='ncc', lite=1) + image2r = reg.remap_image(image2, x, resample='cubic') + image2rz = reg.resize_image(image2r, image1['mat']) + + + slice1 = image1['data'][45, :, :] + slice2 = image2['data'][45/2, :, :] + slice2r = image2r['data'][45/2, :, :] + slice2rz = image2rz['data'][45, :, :] + + pylab.figure(1) + pylab.bone() + pylab.imshow(slice1) + pylab.imshow(slice1) + pylab.figure(2) + pylab.imshow(slice2) + pylab.figure(3) + pylab.imshow(slice2r) + pylab.figure(4) + pylab.imshow(slice2rz) + pylab.show() + + """ # # this is for coreg MRI / fMRI scale test. The volume is anatomical MRI. # the image is rotated in 3D. after rotation the image is scaled. @@ -1077,6 +1104,30 @@ return image def demo_MRI_coregistration(optimizer_method='powell', histo_method=1, smooth_histo=0, smooth_image=0, ftype=1): + """ + demo with (must have file ANAT1_V0001.img and fMRI directory fMRIData) + + measures, imageF_anat, fmri_series = reg.demo_MRI_coregistration() + + show results with + + In [59]: measures[25]['cost'] + Out[59]: -0.48607185 + + In [60]: measures[25]['align_cost'] + Out[60]: -0.99514639 + + In [61]: measures[25]['align_rotate'] + Out[61]: + array([ 1.94480181, 5.64703989, 5.35002136, -5.00544405, -2.2712214, -1.42249691], dtype=float32) + + In [62]: measures[25]['rotate'] + Out[62]: + array([ 1.36566341, 4.70644331, 4.68198586, -4.32256889, -2.47607017, -2.39173937], dtype=float32) + + + """ + # demo of alignment of fMRI series with anatomical MRI # in this demo, each fMRI volume is first perturbed (rotated, translated) # by a random value. The initial registration is measured, then the optimal From scipy-svn at scipy.org Mon Mar 17 11:01:24 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Mon, 17 Mar 2008 10:01:24 -0500 (CDT) Subject: [Scipy-svn] r4030 - trunk/scipy/ndimage Message-ID: <20080317150124.DBFA439C103@new.scipy.org> Author: tom.waite Date: 2008-03-17 10:01:14 -0500 (Mon, 17 Mar 2008) New Revision: 4030 Modified: trunk/scipy/ndimage/_segmenter.py Log: bug fixes and enhancements Modified: trunk/scipy/ndimage/_segmenter.py =================================================================== --- trunk/scipy/ndimage/_segmenter.py 2008-03-17 14:59:12 UTC (rev 4029) +++ trunk/scipy/ndimage/_segmenter.py 2008-03-17 15:01:14 UTC (rev 4030) @@ -1,5 +1,6 @@ import math import numpy as N +import pylab as P import scipy.ndimage._segment as S _objstruct = N.dtype([('L', 'i'), @@ -25,6 +26,15 @@ ) +# Issue warning regarding heavy development status of this module +import warnings +_msg = "The segmentation code is under heavy development and therefore the \ +public API will change in the future. The NIPY group is actively working on \ +this code, and has every intention of generalizing this for the Scipy \ +community. Use this module minimally, if at all, until it this warning is \ +removed." +warnings.warn(_msg, UserWarning) + def canny_hysteresis(magnitude, canny_stats): """ edge_image = canny_hysteresis(magnitude, canny_stats) @@ -231,8 +241,8 @@ input[inflate:rgrows+inflate,inflate:rgcols+inflate] + # accumulate overlaps set back to binary at later date mat_image[:, :] = thin_edge_image[:, :] - # accumulate overlaps set back to 1 return mat_image @@ -361,24 +371,111 @@ [rows, cols] = filtered_slice.shape sobel_edge_image = N.zeros(rows*cols, dtype=N.float64).reshape(rows, cols) pAve, min_value, max_value = S.sobel_image(filtered_slice, sobel_edge_image) + + # replace this with numpy calls for the image stats. but C ext is faster + # S.sobel_image(filtered_slice, sobel_edge_image) + # pAve = sobel_edge_image[sobel_edge_image>0].mean() + # min_value = sobel_edge_image[sobel_edge_image>0].min() + # max_value = sobel_edge_image[sobel_edge_image>0].max() + sobel_stats= {'ave_gt0' : pAve, 'min_gt0': min_value, 'max_gt0': max_value} return sobel_edge_image, sobel_stats -def pre_filter(slice, filter, low_threshold=2048+220, high_threshold=600+2048): +def pre_filter(slice, filter, low_threshold=2048+220, high_threshold=600+2048, conv_binary=0): """ take 2D image slice and filter and pre-filter and threshold prior to segmentation """ + # make sure the input is 16 bits. this is input to edge machine + # so can handle raw and 8 bit scaled inputs + slice = slice.astype(N.int16) [rows, cols] = slice.shape edge_image = N.zeros(rows*cols, dtype=N.float64).reshape(rows, cols) S.edge_prefilter(low_threshold, high_threshold, filter['kernelSize'], filter['kernel'], slice, edge_image) + if conv_binary == 1: + edge_image[edge_image>0] = 1 + edge_image = edge_image.astype(N.uint16) + return edge_image +def get_max_bounding_box(ROI): + max_area = ROI[:]['Area'].max() + indices = range(0, ROI.size) + for i in indices: + if ROI[i]['Area'] == max_area: + left = ROI[i]['L'] + right = ROI[i]['R'] + top = ROI[i]['T'] + bottom = ROI[i]['B'] + bounding_box = {'left' : left, 'right' : right, 'top' : top, 'bottom' : bottom} + + return bounding_box + +def set_draw_bounding_box(bounding_box): + x = N.zeros(5, dtype=N.uint16) + y = N.zeros(5, dtype=N.uint16) + + x[0] = bounding_box['left'] + x[1] = bounding_box['right'] + x[2] = bounding_box['right'] + x[3] = bounding_box['left'] + x[4] = bounding_box['left'] + + y[0] = bounding_box['bottom'] + y[1] = bounding_box['bottom'] + y[2] = bounding_box['top'] + y[3] = bounding_box['top'] + y[4] = bounding_box['bottom'] + + return x, y + +def get_all_bounding_boxes(ROI): + number = ROI.size + indices = range(0, ROI.size) + _shortstruct = N.dtype([('left', 'i'), + ('right', 'i'), + ('top', 'i'), + ('bottom', 'i')]) + measures = N.zeros(number, dtype=_shortstruct) + for i in indices: + measures[i]['left'] = ROI[i]['L'] + measures[i]['right'] = ROI[i]['R'] + measures[i]['top'] = ROI[i]['T'] + measures[i]['bottom'] = ROI[i]['B'] + + return measures + +def draw_all_bounding_boxes(measures): + number = measures.size + indices = range(0, measures.size) + for i in indices: + x, y = set_draw_bounding_box(measures[i]) + P.plot(x, y) + +def build_test_discs(): + + radius = 50 + rows = 512 + cols = 512 + test_image = N.zeros(rows*cols, dtype=N.int16).reshape(rows, cols) + y_indices = N.array(range(-radius, radius+1)) + center_x = rows / 4 + center_y = cols / 4 + + for i in y_indices: + x = math.sqrt(float(radius)**2 - float(i)**2) + test_image[1*center_y+i, 1*center_x-x:1*center_x+x] = 100 + test_image[1*center_y+i, 3*center_x-x:3*center_x+x] = 100 + test_image[3*center_y+i, 1*center_x-x:1*center_x+x] = 100 + test_image[3*center_y+i, 3*center_x-x:3*center_x+x] = 100 + + return test_image + def get_slice(imageName='slice112.raw', bytes=2, rows=512, columns=512): # clip the ends for this test CT image file as the spine runs off the end of the image ImageSlice = N.fromfile(imageName, dtype=N.uint16).reshape(rows, columns) From scipy-svn at scipy.org Mon Mar 17 18:59:46 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Mon, 17 Mar 2008 17:59:46 -0500 (CDT) Subject: [Scipy-svn] r4031 - trunk/scipy/sandbox/newoptimize Message-ID: <20080317225946.9591B39C03A@new.scipy.org> Author: jarrod.millman Date: 2008-03-17 17:59:42 -0500 (Mon, 17 Mar 2008) New Revision: 4031 Removed: trunk/scipy/sandbox/newoptimize/tnc.py trunk/scipy/sandbox/newoptimize/tnc/ Log: tnc 1.3 is already out of the sandbox Deleted: trunk/scipy/sandbox/newoptimize/tnc.py =================================================================== --- trunk/scipy/sandbox/newoptimize/tnc.py 2008-03-17 15:01:14 UTC (rev 4030) +++ trunk/scipy/sandbox/newoptimize/tnc.py 2008-03-17 22:59:42 UTC (rev 4031) @@ -1,355 +0,0 @@ -# TNC Python interface -# @(#) $Jeannot: tnc.py,v 1.11 2005/01/28 18:27:31 js Exp $ - -# Copyright (c) 2004-2005, Jean-Sebastien Roy (js at jeannot.org) - -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: - -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -""" -TNC: A python interface to the TNC non-linear optimizer - -TNC is a non-linear optimizer. To use it, you must provide a function to -minimize. The function must take one argument: the list of coordinates where to -evaluate the function; and it must return either a tuple, whose first element is the -value of the function, and whose second argument is the gradient of the function -(as a list of values); or None, to abort the minimization. -""" - -import moduleTNC -from numpy import asarray - -MSG_NONE = 0 # No messages -MSG_ITER = 1 # One line per iteration -MSG_INFO = 2 # Informational messages -MSG_VERS = 4 # Version info -MSG_EXIT = 8 # Exit reasons -MSG_ALL = MSG_ITER + MSG_INFO + MSG_VERS + MSG_EXIT - -MSGS = { - MSG_NONE : "No messages", - MSG_ITER : "One line per iteration", - MSG_INFO : "Informational messages", - MSG_VERS : "Version info", - MSG_EXIT : "Exit reasons", - MSG_ALL : "All messages" -} - -HUGE_VAL=1e200*1e200 # No standard representation of Infinity in Python 2.3.3 - # FIXME: can we use inf now that we have numpy and IEEE floats? - -INFEASIBLE = -1 # Infeasible (low > up) -LOCALMINIMUM = 0 # Local minima reach (|pg| ~= 0) -FCONVERGED = 1 # Converged (|f_n-f_(n-1)| ~= 0) -XCONVERGED = 2 # Converged (|x_n-x_(n-1)| ~= 0) -MAXFUN = 3 # Max. number of function evaluations reach -LSFAIL = 4 # Linear search failed -CONSTANT = 5 # All lower bounds are equal to the upper bounds -NOPROGRESS = 6 # Unable to progress -USERABORT = 7 # User requested end of minimization - -RCSTRINGS = { - INFEASIBLE : "Infeasible (low > up)", - LOCALMINIMUM : "Local minima reach (|pg| ~= 0)", - FCONVERGED : "Converged (|f_n-f_(n-1)| ~= 0)", - XCONVERGED : "Converged (|x_n-x_(n-1)| ~= 0)", - MAXFUN : "Max. number of function evaluations reach", - LSFAIL : "Linear search failed", - CONSTANT : "All lower bounds are equal to the upper bounds", - NOPROGRESS : "Unable to progress", - USERABORT : "User requested end of minimization" -} - -# Changes to interface made by Travis Oliphant, Apr. 2004 for inclusion in -# SciPy - -import optimize -approx_fprime = optimize.approx_fprime - -def fmin_tnc(func, x0, fprime=None, args=(), approx_grad=0, bounds=None, epsilon=1e-8, - scale=None, offset=None, messages=MSG_ALL, maxCGit=-1, maxfun=None, eta=-1, - stepmx=0, accuracy=0, fmin=0, ftol=-1, xtol=-1, pgtol=-1, rescale=-1): - """Minimize a function with variables subject to bounds, using gradient - information. - - returns (rc, nfeval, x). - - Inputs: - func : the function to minimize. Must take one argument, x and return - f and g, where f is the value of the function and g its - gradient (a list of floats). - if the function returns None, the minimization is aborted. - x0 : initial estimate (a list of floats) - fprime : gradient of func. If None, then func returns the function - value and the gradient ( f, g = func(x, *args) ). - Called as fprime(x, *args) - args : arguments to pass to function - approx_grad : if true, approximate the gradient numerically - bounds : a list of (min, max) pairs for each element in x, defining - the bounds on that parameter. Use None for one of min or max - when there is no bound in that direction - scale : scaling factors to apply to each variable (a list of floats) - if None, the factors are up-low for interval bounded variables - and 1+|x] fo the others. - defaults to None - offset : constant to substract to each variable - if None, the constant are (up+low)/2 for interval bounded - variables and x for the others. - messages : bit mask used to select messages display during minimization - values defined in the MSGS dict. - defaults to MGS_ALL - maxCGit : max. number of hessian*vector evaluation per main iteration - if maxCGit == 0, the direction chosen is -gradient - if maxCGit < 0, maxCGit is set to max(1,min(50,n/2)) - defaults to -1 - maxfun : max. number of function evaluation - if None, maxfun is set to max(100, 10*len(x0)) - defaults to None - eta : severity of the line search. if < 0 or > 1, set to 0.25 - defaults to -1 - stepmx : maximum step for the line search. may be increased during call - if too small, will be set to 10.0 - defaults to 0 - accuracy : relative precision for finite difference calculations - if <= machine_precision, set to sqrt(machine_precision) - defaults to 0 - fmin : minimum function value estimate - defaults to 0 - ftol : precision goal for the value of f in the stoping criterion - if ftol < 0.0, ftol is set to 0.0 - defaults to -1 - xtol : precision goal for the value of x in the stopping criterion - (after applying x scaling factors) - if xtol < 0.0, xtol is set to sqrt(machine_precision) - defaults to -1 - pgtol : precision goal for the value of the projected gradient in the - stopping criterion (after applying x scaling factors) - if pgtol < 0.0, pgtol is set to 1e-2 * sqrt(accuracy) - setting it to 0.0 is not recommended. - defaults to -1 - rescale : f scaling factor (in log10) used to trigger f value rescaling - if 0, rescale at each iteration - if a large value, never rescale - if < 0, rescale is set to 1.3 - - Outputs: - x : the solution (a list of floats) - nfeval : the number of function evaluations - rc : return code as defined in the RCSTRINGS dict - -See also: - - fmin, fmin_powell, fmin_cg, - fmin_bfgs, fmin_ncg -- multivariate local optimizers - leastsq -- nonlinear least squares minimizer - - fmin_l_bfgs_b, fmin_tnc, - fmin_cobyla -- constrained multivariate optimizers - - anneal, brute -- global optimizers - - fminbound, brent, golden, bracket -- local scalar minimizers - - fsolve -- n-dimenstional root-finding - - brentq, brenth, ridder, bisect, newton -- one-dimensional root-finding - - fixed_point -- scalar fixed-point finder -""" - - n = len(x0) - - if bounds is None: - bounds = [(None,None)] * n - if len(bounds) != n: - raise ValueError('length of x0 != length of bounds') - - if approx_grad: - def func_and_grad(x): - x = asarray(x) - f = func(x, *args) - g = approx_fprime(x, func, epsilon, *args) - return f, list(g) - elif fprime is None: - def func_and_grad(x): - x = asarray(x) - f, g = func(x, *args) - return f, list(g) - else: - def func_and_grad(x): - x = asarray(x) - f = func(x, *args) - g = fprime(x, *args) - return f, list(g) - - """ - low, up : the bounds (lists of floats) - set low[i] to -HUGE_VAL to remove the lower bound - set up[i] to HUGE_VAL to remove the upper bound - if low is None, the lower bounds are removed. - if up is None, the upper bounds are removed. - low and up defaults to None - """ - low = [0]*n - up = [0]*n - for i in range(n): - l,u = bounds[i] - if l is None: - low[i] = -HUGE_VAL - else: - low[i] = l - if u is None: - up[i] = HUGE_VAL - else: - up[i] = u - - if scale is None: - scale = [] - - if offset is None: - offset = [] - - if maxfun is None: - maxfun = max(100, 10*len(x0)) - - return moduleTNC.minimize(func_and_grad, x0, low, up, scale, offset, - messages, maxCGit, maxfun, eta, stepmx, accuracy, - fmin, ftol, xtol, pgtol, rescale) - -if __name__ == '__main__': - # Examples for TNC - - def example(): - print "Example" - # A function to minimize - def function(x): - f = pow(x[0],2.0)+pow(abs(x[1]),3.0) - g = [0,0] - g[0] = 2.0*x[0] - g[1] = 3.0*pow(abs(x[1]),2.0) - if x[1]<0: - g[1] = -g[1] - return f, g - - # Optimizer call - rc, nf, x = fmin_tnc(function, [-7, 3], bounds=([-10, 1], [10, 10])) - - print "After", nf, "function evaluations, TNC returned:", RCSTRINGS[rc] - print "x =", x - print "exact value = [0, 1]" - print - - example() - - # Tests - # These tests are taken from Prof. K. Schittkowski test examples for - # constrained nonlinear programming. - # http://www.uni-bayreuth.de/departments/math/~kschittkowski/home.htm - tests = [] - def test1fg(x): - f = 100.0*pow((x[1]-pow(x[0],2)),2)+pow(1.0-x[0],2) - dif = [0,0] - dif[1] = 200.0*(x[1]-pow(x[0],2)) - dif[0] = -2.0*(x[0]*(dif[1]-1.0)+1.0) - return f, dif - tests.append ((test1fg, [-2,1], [-HUGE_VAL, -1.5], None, [1,1])) - - def test2fg(x): - f = 100.0*pow((x[1]-pow(x[0],2)),2)+pow(1.0-x[0],2) - dif = [0,0] - dif[1] = 200.0*(x[1]-pow(x[0],2)) - dif[0] = -2.0*(x[0]*(dif[1]-1.0)+1.0) - return f, dif - tests.append ((test2fg, [-2,1], [-HUGE_VAL, 1.5], None, [-1.2210262419616387,1.5])) - - def test3fg(x): - f = x[1]+pow(x[1]-x[0],2)*1.0e-5 - dif = [0,0] - dif[0] = -2.0*(x[1]-x[0])*1.0e-5 - dif[1] = 1.0-dif[0] - return f, dif - tests.append ((test3fg, [10,1], [-HUGE_VAL, 0.0], None, [0,0])) - - def test4fg(x): - f = pow(x[0]+1.0,3)/3.0+x[1] - dif = [0,0] - dif[0] = pow(x[0]+1.0,2) - dif[1] = 1.0 - return f, dif - tests.append ((test4fg, [1.125,0.125], [1, 0], None, [1,0])) - - from math import * - - def test5fg(x): - f = sin(x[0]+x[1])+pow(x[0]-x[1],2)-1.5*x[0]+2.5*x[1]+1.0 - dif = [0,0] - v1 = cos(x[0]+x[1]); - v2 = 2.0*(x[0]-x[1]); - - dif[0] = v1+v2-1.5; - dif[1] = v1-v2+2.5; - return f, dif - tests.append ((test5fg, [0,0], [-1.5, -3], [4,3], [-0.54719755119659763, -1.5471975511965976])) - - def test38fg(x): - f = (100.0*pow(x[1]-pow(x[0],2),2)+pow(1.0-x[0],2)+90.0*pow(x[3]-pow(x[2],2),2) \ - +pow(1.0-x[2],2)+10.1*(pow(x[1]-1.0,2)+pow(x[3]-1.0,2)) \ - +19.8*(x[1]-1.0)*(x[3]-1.0))*1.0e-5 - dif = [0,0,0,0] - dif[0] = (-400.0*x[0]*(x[1]-pow(x[0],2))-2.0*(1.0-x[0]))*1.0e-5 - dif[1] = (200.0*(x[1]-pow(x[0],2))+20.2*(x[1]-1.0)+19.8*(x[3]-1.0))*1.0e-5 - dif[2] = (-360.0*x[2]*(x[3]-pow(x[2],2))-2.0*(1.0-x[2]))*1.0e-5 - dif[3] = (180.0*(x[3]-pow(x[2],2))+20.2*(x[3]-1.0)+19.8*(x[1]-1.0))*1.0e-5 - return f, dif - tests.append ((test38fg, [-3,-1,-3,-1], [-10]*4, [10]*4, [1]*4)) - - def test45fg(x): - f = 2.0-x[0]*x[1]*x[2]*x[3]*x[4]/120.0 - dif = [0]*5 - dif[0] = -x[1]*x[2]*x[3]*x[4]/120.0 - dif[1] = -x[0]*x[2]*x[3]*x[4]/120.0 - dif[2] = -x[0]*x[1]*x[3]*x[4]/120.0 - dif[3] = -x[0]*x[1]*x[2]*x[4]/120.0 - dif[4] = -x[0]*x[1]*x[2]*x[3]/120.0 - return f, dif - tests.append ((test45fg, [2]*5, [0]*5, [1,2,3,4,5], [1,2,3,4,5])) - - def test(fg, x, bounds, xopt): - print "** Test", fg.__name__ - rc, nf, x = fmin_tnc(fg, x, bounds=bounds, messages = MSG_NONE, maxnfeval = 200) - print "After", nf, "function evaluations, TNC returned:", RCSTRINGS[rc] - print "x =", x - print "exact value =", xopt - enorm = 0.0 - norm = 1.0 - for y,yo in zip(x, xopt): - enorm += (y-yo)*(y-yo) - norm += yo*yo - ex = pow(enorm/norm, 0.5) - print "X Error =", ex - ef = abs(fg(xopt)[0] - fg(x)[0]) - print "F Error =", ef - if ef > 1e-8: - raise "Test "+fg.__name__+" failed" - - for fg, x, bounds, xopt in tests: - test(fg, x, bounds, xopt) - - print - print "** All TNC tests passed." From scipy-svn at scipy.org Mon Mar 17 19:03:05 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Mon, 17 Mar 2008 18:03:05 -0500 (CDT) Subject: [Scipy-svn] r4032 - trunk/scipy/sandbox Message-ID: <20080317230305.B03AB39C03A@new.scipy.org> Author: jarrod.millman Date: 2008-03-17 18:03:01 -0500 (Mon, 17 Mar 2008) New Revision: 4032 Removed: trunk/scipy/sandbox/maskedarray/ Log: removed maskedarray now that it depends on the numpy trunk From scipy-svn at scipy.org Tue Mar 18 06:37:18 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Tue, 18 Mar 2008 05:37:18 -0500 (CDT) Subject: [Scipy-svn] r4033 - in trunk/scipy/sparse: . sparsetools Message-ID: <20080318103718.4718839C1E4@new.scipy.org> Author: wnbell Date: 2008-03-18 05:37:04 -0500 (Tue, 18 Mar 2008) New Revision: 4033 Modified: trunk/scipy/sparse/bsr.py trunk/scipy/sparse/sparsetools/sparsetools.h trunk/scipy/sparse/sparsetools/sparsetools.i trunk/scipy/sparse/sparsetools/sparsetools.py trunk/scipy/sparse/sparsetools/sparsetools_wrap.cxx Log: added two BSR methods to sparsetools use CSR for 1x1 BSR problems Modified: trunk/scipy/sparse/bsr.py =================================================================== --- trunk/scipy/sparse/bsr.py 2008-03-17 23:03:01 UTC (rev 4032) +++ trunk/scipy/sparse/bsr.py 2008-03-18 10:37:04 UTC (rev 4033) @@ -16,7 +16,7 @@ upcast import sparsetools from sparsetools import bsr_matvec, csr_matmat_pass1, csr_matmat_pass2, \ - bsr_matmat_pass2 + bsr_matmat_pass2, bsr_transpose, bsr_sort_indices class bsr_matrix(_cs_matrix): """Block Sparse Row matrix @@ -303,7 +303,7 @@ #output array if output is None: - y = empty( self.shape[0], dtype=upcast(self.dtype,other.dtype) ) + y = zeros( self.shape[0], dtype=upcast(self.dtype,other.dtype) ) else: if output.shape != (M,) and output.shape != (M,1): raise ValueError, "output array has improper dimensions" @@ -369,17 +369,10 @@ indices = empty( bnnz, dtype=intc) data = empty( R*C*bnnz, dtype=upcast(self.dtype,other.dtype)) - if (R,C,n) == (1,1,1): - #use CSR * CSR when possible - csr_matmat_pass2( M, N, \ - self.indptr, self.indices, ravel(self.data), \ - other.indptr, other.indices, ravel(other.data), \ - indptr, indices, data) - else: - bsr_matmat_pass2( M/R, N/C, R, C, n, \ - self.indptr, self.indices, ravel(self.data), \ - other.indptr, other.indices, ravel(other.data), \ - indptr, indices, data) + bsr_matmat_pass2( M/R, N/C, R, C, n, \ + self.indptr, self.indices, ravel(self.data), \ + other.indptr, other.indices, ravel(other.data), \ + indptr, indices, data) data = data.reshape(-1,R,C) #TODO eliminate zeros @@ -445,20 +438,29 @@ R,C = self.blocksize M,N = self.shape + NBLK = self.nnz/(R*C) if self.nnz == 0: return bsr_matrix((N,M),blocksize=(C,R)) - #use CSR.T to determine a permutation for BSR.T - from csr import csr_matrix - data = arange(len(self.indices), dtype=self.indices.dtype) - proxy = csr_matrix((data,self.indices,self.indptr),shape=(M/R,N/C)) - proxy = proxy.tocsc() + indptr = empty( N/C + 1, dtype=self.indptr.dtype) + indices = empty( NBLK, dtype=self.indices.dtype) + data = empty( (NBLK,C,R), dtype=self.data.dtype) - data = self.data.swapaxes(1,2)[proxy.data] #permute data + bsr_transpose(M/R, N/C, R, C, \ + self.indptr, self.indices, self.data.ravel(), \ + indptr, indices, data.ravel()) - indices = proxy.indices - indptr = proxy.indptr + ##use CSR.T to determine a permutation for BSR.T + #from csr import csr_matrix + #data = arange(len(self.indices), dtype=self.indices.dtype) + #proxy = csr_matrix((data,self.indices,self.indptr),shape=(M/R,N/C)) + #proxy = proxy.tocsc() + + #data = self.data.swapaxes(1,2)[proxy.data] #permute data + + #indices = proxy.indices + #indptr = proxy.indptr return bsr_matrix( (data,indices,indptr), shape=(N,M) ) @@ -506,14 +508,17 @@ if self.nnz == 0: return - #use CSR.sort_indices to determine a permutation for BSR blocks - data = arange(len(self.indices), dtype=self.indices.dtype) - proxy = csr_matrix((data,self.indices,self.indptr),shape=(M/R,N/C)) - proxy.sort_indices() + bsr_sort_indices(M/R, N/C, R, C, self.indptr, self.indices, self.data.ravel()) - self.data[:] = self.data[proxy.data] - self.indices[:] = proxy.indices + ##use CSR.sort_indices to determine a permutation for BSR blocks + #data = arange(len(self.indices), dtype=self.indices.dtype) + #proxy = csr_matrix((data,self.indices,self.indptr),shape=(M/R,N/C)) + #proxy.sort_indices() + + #self.data[:] = self.data[proxy.data] + #self.indices[:] = proxy.indices + self.has_sorted_indices = True def prune(self): Modified: trunk/scipy/sparse/sparsetools/sparsetools.h =================================================================== --- trunk/scipy/sparse/sparsetools/sparsetools.h 2008-03-17 23:03:01 UTC (rev 4032) +++ trunk/scipy/sparse/sparsetools/sparsetools.h 2008-03-18 10:37:04 UTC (rev 4033) @@ -431,7 +431,59 @@ } } + /* + * Sort the column block indices of a BSR matrix inplace + * + * Input Arguments: + * I n_brow - number of row blocks in A + * I n_bcol - number of column blocks in A + * I R - rows per block + * I C - columns per block + * I Ap[n_brow+1] - row pointer + * I Aj[nblk(A)] - column indices + * T Ax[nnz(A)] - nonzeros + * + */ +template +void bsr_sort_indices(const I n_brow, + const I n_bcol, + const I R, + const I C, + I Ap[], + I Aj[], + T Ax[]) +{ + if( R == 1 && C == 1 ){ + csr_sort_indices(n_brow, Ap, Aj, Ax); + return; + } + + + const I nblks = Ap[n_brow]; + const I RC = R*C; + const I nnz = RC*nblks; + + //compute permutation of blocks using tranpose(CSR) + std::vector perm(nblks); + + for(I i = 0; i < nblks; i++) + perm[i] = i; + + csr_sort_indices(n_brow, Ap, Aj, &perm[0]); + + std::vector Ax_copy(nnz); + std::copy(Ax, Ax + nnz, Ax_copy.begin()); + + for(I i = 0; i < nblks; i++){ + const T * input = &Ax_copy[RC * perm[i]]; + T * output = Ax + RC*i; + std::copy(input, input + RC, output); + } +} + + +/* * Compute B = A for CSR matrix A, CSC matrix B * * Also, with the appropriate arguments can also be used to: @@ -509,10 +561,69 @@ +/* + * Compute transpose(A) BSR matrix A + * + * Input Arguments: + * I n_brow - number of row blocks in A + * I n_bcol - number of column blocks in A + * I R - rows per block + * I C - columns per block + * I Ap[n_brow+1] - row pointer + * I Aj[nblk(A)] - column indices + * T Ax[nnz(A)] - nonzeros + * + * Output Arguments: + * I Bp[n_col+1] - row pointer + * I Bj[nblk(A)] - column indices + * T Bx[nnz(A)] - nonzeros + * + * Note: + * Output arrays Bp, Bj, Bx must be preallocated + * + * Note: + * Input: column indices *are not* assumed to be in sorted order + * Output: row indices *will be* in sorted order + * + * Complexity: Linear. Specifically O(nnz(A) + max(n_row,n_col)) + * + */ +template +void bsr_transpose(const I n_brow, + const I n_bcol, + const I R, + const I C, + const I Ap[], + const I Aj[], + const T Ax[], + I Bp[], + I Bj[], + T Bx[]) +{ + const I nblks = Ap[n_brow]; + const I RC = R*C; + //compute permutation of blocks using tranpose(CSR) + std::vector perm_in (nblks); + std::vector perm_out(nblks); + for(I i = 0; i < nblks; i++) + perm_in[i] = i; + csr_tocsc(n_brow, n_bcol, Ap, Aj, &perm_in[0], Bp, Bj, &perm_out[0]); + for(I i = 0; i < nblks; i++){ + const T * Ax_blk = Ax + RC * perm_out[i]; + T * Bx_blk = Bx + RC * i; + for(I r = 0; r < R; r++){ + for(I c = 0; c < C; c++){ + Bx_blk[c * R + r] = Ax_blk[r * C + c]; + } + } + } +} + + /* * Compute C = A*B for CSR matrices A,B * @@ -814,6 +925,11 @@ #undef F #endif + if( R == 1 && N == 1 && C == 1 ){ + csr_matmat_pass2(n_brow, n_bcol, Ap, Aj, Ax, Bp, Bj, Bx, Cp, Cj, Cx); + return; + } + const I RC = R*C; const I RN = R*N; const I NC = N*C; @@ -899,6 +1015,13 @@ I Cp[], I Cj[], T Cx[], const bin_op& op) { + assert( R > 0 && C > 0); + + if( R == 1 && C == 1 ){ + csr_binop_csr(n_brow, n_bcol, Ap, Aj, Ax, Bp, Bj, Bx, Cp, Cj, Cx, op); //use CSR for 1x1 blocksize + return; + } + const I RC = R*C; T * result = Cx; @@ -1560,6 +1683,11 @@ { assert(R > 0 && C > 0); + if( R == 1 && C == 1 ){ + csr_matvec(n_brow, n_bcol, Ap, Aj, Ax, Xx, Yx); //use CSR for 1x1 blocksize + return; + } + #ifdef SPARSETOOLS_TESTING #define F(X,Y) bsr_matvec_fixed @@ -1584,6 +1712,7 @@ #endif //otherwise use general method + for(I i = 0; i < R*n_brow; i++){ Yx[i] = 0; } Modified: trunk/scipy/sparse/sparsetools/sparsetools.i =================================================================== --- trunk/scipy/sparse/sparsetools/sparsetools.i 2008-03-17 23:03:01 UTC (rev 4032) +++ trunk/scipy/sparse/sparsetools/sparsetools.i 2008-03-18 10:37:04 UTC (rev 4033) @@ -213,6 +213,7 @@ INSTANTIATE_ALL(csr_tocsc) INSTANTIATE_ALL(csc_tocsr) INSTANTIATE_ALL(csr_tobsr) +INSTANTIATE_ALL(bsr_transpose) /* * CSR<->COO and CSC<->COO @@ -268,6 +269,7 @@ */ %template(csr_has_sorted_indices) csr_has_sorted_indices; INSTANTIATE_ALL(csr_sort_indices) +INSTANTIATE_ALL(bsr_sort_indices) /* Modified: trunk/scipy/sparse/sparsetools/sparsetools.py =================================================================== --- trunk/scipy/sparse/sparsetools/sparsetools.py 2008-03-17 23:03:01 UTC (rev 4032) +++ trunk/scipy/sparse/sparsetools/sparsetools.py 2008-03-18 10:37:04 UTC (rev 4033) @@ -391,6 +391,40 @@ """ return _sparsetools.csr_tobsr(*args) +def bsr_transpose(*args): + """ + bsr_transpose(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, + signed char Ax, int Bp, int Bj, signed char Bx) + bsr_transpose(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, + unsigned char Ax, int Bp, int Bj, unsigned char Bx) + bsr_transpose(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, + short Ax, int Bp, int Bj, short Bx) + bsr_transpose(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, + unsigned short Ax, int Bp, int Bj, unsigned short Bx) + bsr_transpose(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, + int Ax, int Bp, int Bj, int Bx) + bsr_transpose(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, + unsigned int Ax, int Bp, int Bj, unsigned int Bx) + bsr_transpose(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, + long long Ax, int Bp, int Bj, long long Bx) + bsr_transpose(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, + unsigned long long Ax, int Bp, int Bj, unsigned long long Bx) + bsr_transpose(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, + float Ax, int Bp, int Bj, float Bx) + bsr_transpose(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, + double Ax, int Bp, int Bj, double Bx) + bsr_transpose(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, + long double Ax, int Bp, int Bj, long double Bx) + bsr_transpose(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, + npy_cfloat_wrapper Ax, int Bp, int Bj, npy_cfloat_wrapper Bx) + bsr_transpose(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, + npy_cdouble_wrapper Ax, int Bp, int Bj, npy_cdouble_wrapper Bx) + bsr_transpose(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, + npy_clongdouble_wrapper Ax, int Bp, int Bj, + npy_clongdouble_wrapper Bx) + """ + return _sparsetools.bsr_transpose(*args) + def coo_tocsr(*args): """ coo_tocsr(int n_row, int n_col, int nnz, int Ai, int Aj, signed char Ax, @@ -1284,6 +1318,39 @@ """ return _sparsetools.csr_sort_indices(*args) +def bsr_sort_indices(*args): + """ + bsr_sort_indices(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, + signed char Ax) + bsr_sort_indices(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, + unsigned char Ax) + bsr_sort_indices(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, + short Ax) + bsr_sort_indices(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, + unsigned short Ax) + bsr_sort_indices(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, + int Ax) + bsr_sort_indices(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, + unsigned int Ax) + bsr_sort_indices(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, + long long Ax) + bsr_sort_indices(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, + unsigned long long Ax) + bsr_sort_indices(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, + float Ax) + bsr_sort_indices(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, + double Ax) + bsr_sort_indices(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, + long double Ax) + bsr_sort_indices(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, + npy_cfloat_wrapper Ax) + bsr_sort_indices(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, + npy_cdouble_wrapper Ax) + bsr_sort_indices(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, + npy_clongdouble_wrapper Ax) + """ + return _sparsetools.bsr_sort_indices(*args) + def csr_eliminate_zeros(*args): """ csr_eliminate_zeros(int n_row, int n_col, int Ap, int Aj, signed char Ax) Modified: trunk/scipy/sparse/sparsetools/sparsetools_wrap.cxx =================================================================== --- trunk/scipy/sparse/sparsetools/sparsetools_wrap.cxx 2008-03-17 23:03:01 UTC (rev 4032) +++ trunk/scipy/sparse/sparsetools/sparsetools_wrap.cxx 2008-03-18 10:37:04 UTC (rev 4033) @@ -24972,6 +24972,2698 @@ } +SWIGINTERN PyObject *_wrap_bsr_transpose__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + int arg1 ; + int arg2 ; + int arg3 ; + int arg4 ; + int *arg5 ; + int *arg6 ; + signed char *arg7 ; + int *arg8 ; + int *arg9 ; + signed char *arg10 ; + int val1 ; + int ecode1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + PyArrayObject *array5 = NULL ; + int is_new_object5 ; + PyArrayObject *array6 = NULL ; + int is_new_object6 ; + PyArrayObject *array7 = NULL ; + int is_new_object7 ; + PyArrayObject *temp8 = NULL ; + PyArrayObject *temp9 = NULL ; + PyArrayObject *temp10 = NULL ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + PyObject * obj7 = 0 ; + PyObject * obj8 = 0 ; + PyObject * obj9 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOOO:bsr_transpose",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9)) SWIG_fail; + ecode1 = SWIG_AsVal_int(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "bsr_transpose" "', argument " "1"" of type '" "int""'"); + } + arg1 = static_cast< int >(val1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bsr_transpose" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "bsr_transpose" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "bsr_transpose" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + { + npy_intp size[1] = { + -1 + }; + array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_INT, &is_new_object5); + if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1) + || !require_contiguous(array5) || !require_native(array5)) SWIG_fail; + + arg5 = (int*) array5->data; + } + { + npy_intp size[1] = { + -1 + }; + array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_INT, &is_new_object6); + if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1) + || !require_contiguous(array6) || !require_native(array6)) SWIG_fail; + + arg6 = (int*) array6->data; + } + { + npy_intp size[1] = { + -1 + }; + array7 = obj_to_array_contiguous_allow_conversion(obj6, PyArray_BYTE, &is_new_object7); + if (!array7 || !require_dimensions(array7,1) || !require_size(array7,size,1) + || !require_contiguous(array7) || !require_native(array7)) SWIG_fail; + + arg7 = (signed char*) array7->data; + } + { + temp8 = obj_to_array_no_conversion(obj7,PyArray_INT); + if (!temp8 || !require_contiguous(temp8) || !require_native(temp8)) SWIG_fail; + arg8 = (int*) array_data(temp8); + } + { + temp9 = obj_to_array_no_conversion(obj8,PyArray_INT); + if (!temp9 || !require_contiguous(temp9) || !require_native(temp9)) SWIG_fail; + arg9 = (int*) array_data(temp9); + } + { + temp10 = obj_to_array_no_conversion(obj9,PyArray_BYTE); + if (!temp10 || !require_contiguous(temp10) || !require_native(temp10)) SWIG_fail; + arg10 = (signed char*) array_data(temp10); + } + bsr_transpose< int,signed char >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(signed char const (*))arg7,arg8,arg9,arg10); + resultobj = SWIG_Py_Void(); + { + if (is_new_object5 && array5) Py_DECREF(array5); + } + { + if (is_new_object6 && array6) Py_DECREF(array6); + } + { + if (is_new_object7 && array7) Py_DECREF(array7); + } + return resultobj; +fail: + { + if (is_new_object5 && array5) Py_DECREF(array5); + } + { + if (is_new_object6 && array6) Py_DECREF(array6); + } + { + if (is_new_object7 && array7) Py_DECREF(array7); + } + return NULL; +} + + +SWIGINTERN PyObject *_wrap_bsr_transpose__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + int arg1 ; + int arg2 ; + int arg3 ; + int arg4 ; + int *arg5 ; + int *arg6 ; + unsigned char *arg7 ; + int *arg8 ; + int *arg9 ; + unsigned char *arg10 ; + int val1 ; + int ecode1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + PyArrayObject *array5 = NULL ; + int is_new_object5 ; + PyArrayObject *array6 = NULL ; + int is_new_object6 ; + PyArrayObject *array7 = NULL ; + int is_new_object7 ; + PyArrayObject *temp8 = NULL ; + PyArrayObject *temp9 = NULL ; + PyArrayObject *temp10 = NULL ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + PyObject * obj7 = 0 ; + PyObject * obj8 = 0 ; + PyObject * obj9 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOOO:bsr_transpose",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9)) SWIG_fail; + ecode1 = SWIG_AsVal_int(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "bsr_transpose" "', argument " "1"" of type '" "int""'"); + } + arg1 = static_cast< int >(val1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bsr_transpose" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "bsr_transpose" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "bsr_transpose" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + { + npy_intp size[1] = { + -1 + }; + array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_INT, &is_new_object5); + if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1) + || !require_contiguous(array5) || !require_native(array5)) SWIG_fail; + + arg5 = (int*) array5->data; + } + { + npy_intp size[1] = { + -1 + }; + array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_INT, &is_new_object6); + if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1) + || !require_contiguous(array6) || !require_native(array6)) SWIG_fail; + + arg6 = (int*) array6->data; + } + { + npy_intp size[1] = { + -1 + }; + array7 = obj_to_array_contiguous_allow_conversion(obj6, PyArray_UBYTE, &is_new_object7); + if (!array7 || !require_dimensions(array7,1) || !require_size(array7,size,1) + || !require_contiguous(array7) || !require_native(array7)) SWIG_fail; + + arg7 = (unsigned char*) array7->data; + } + { + temp8 = obj_to_array_no_conversion(obj7,PyArray_INT); + if (!temp8 || !require_contiguous(temp8) || !require_native(temp8)) SWIG_fail; + arg8 = (int*) array_data(temp8); + } + { + temp9 = obj_to_array_no_conversion(obj8,PyArray_INT); + if (!temp9 || !require_contiguous(temp9) || !require_native(temp9)) SWIG_fail; + arg9 = (int*) array_data(temp9); + } + { + temp10 = obj_to_array_no_conversion(obj9,PyArray_UBYTE); + if (!temp10 || !require_contiguous(temp10) || !require_native(temp10)) SWIG_fail; + arg10 = (unsigned char*) array_data(temp10); + } + bsr_transpose< int,unsigned char >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(unsigned char const (*))arg7,arg8,arg9,arg10); + resultobj = SWIG_Py_Void(); + { + if (is_new_object5 && array5) Py_DECREF(array5); + } + { + if (is_new_object6 && array6) Py_DECREF(array6); + } + { + if (is_new_object7 && array7) Py_DECREF(array7); + } + return resultobj; +fail: + { + if (is_new_object5 && array5) Py_DECREF(array5); + } + { + if (is_new_object6 && array6) Py_DECREF(array6); + } + { + if (is_new_object7 && array7) Py_DECREF(array7); + } + return NULL; +} + + +SWIGINTERN PyObject *_wrap_bsr_transpose__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + int arg1 ; + int arg2 ; + int arg3 ; + int arg4 ; + int *arg5 ; + int *arg6 ; + short *arg7 ; + int *arg8 ; + int *arg9 ; + short *arg10 ; + int val1 ; + int ecode1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + PyArrayObject *array5 = NULL ; + int is_new_object5 ; + PyArrayObject *array6 = NULL ; + int is_new_object6 ; + PyArrayObject *array7 = NULL ; + int is_new_object7 ; + PyArrayObject *temp8 = NULL ; + PyArrayObject *temp9 = NULL ; + PyArrayObject *temp10 = NULL ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + PyObject * obj7 = 0 ; + PyObject * obj8 = 0 ; + PyObject * obj9 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOOO:bsr_transpose",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9)) SWIG_fail; + ecode1 = SWIG_AsVal_int(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "bsr_transpose" "', argument " "1"" of type '" "int""'"); + } + arg1 = static_cast< int >(val1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bsr_transpose" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "bsr_transpose" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "bsr_transpose" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + { + npy_intp size[1] = { + -1 + }; + array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_INT, &is_new_object5); + if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1) + || !require_contiguous(array5) || !require_native(array5)) SWIG_fail; + + arg5 = (int*) array5->data; + } + { + npy_intp size[1] = { + -1 + }; + array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_INT, &is_new_object6); + if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1) + || !require_contiguous(array6) || !require_native(array6)) SWIG_fail; + + arg6 = (int*) array6->data; + } + { + npy_intp size[1] = { + -1 + }; + array7 = obj_to_array_contiguous_allow_conversion(obj6, PyArray_SHORT, &is_new_object7); + if (!array7 || !require_dimensions(array7,1) || !require_size(array7,size,1) + || !require_contiguous(array7) || !require_native(array7)) SWIG_fail; + + arg7 = (short*) array7->data; + } + { + temp8 = obj_to_array_no_conversion(obj7,PyArray_INT); + if (!temp8 || !require_contiguous(temp8) || !require_native(temp8)) SWIG_fail; + arg8 = (int*) array_data(temp8); + } + { + temp9 = obj_to_array_no_conversion(obj8,PyArray_INT); + if (!temp9 || !require_contiguous(temp9) || !require_native(temp9)) SWIG_fail; + arg9 = (int*) array_data(temp9); + } + { + temp10 = obj_to_array_no_conversion(obj9,PyArray_SHORT); + if (!temp10 || !require_contiguous(temp10) || !require_native(temp10)) SWIG_fail; + arg10 = (short*) array_data(temp10); + } + bsr_transpose< int,short >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(short const (*))arg7,arg8,arg9,arg10); + resultobj = SWIG_Py_Void(); + { + if (is_new_object5 && array5) Py_DECREF(array5); + } + { + if (is_new_object6 && array6) Py_DECREF(array6); + } + { + if (is_new_object7 && array7) Py_DECREF(array7); + } + return resultobj; +fail: + { + if (is_new_object5 && array5) Py_DECREF(array5); + } + { + if (is_new_object6 && array6) Py_DECREF(array6); + } + { + if (is_new_object7 && array7) Py_DECREF(array7); + } + return NULL; +} + + +SWIGINTERN PyObject *_wrap_bsr_transpose__SWIG_4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + int arg1 ; + int arg2 ; + int arg3 ; + int arg4 ; + int *arg5 ; + int *arg6 ; + unsigned short *arg7 ; + int *arg8 ; + int *arg9 ; + unsigned short *arg10 ; + int val1 ; + int ecode1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + PyArrayObject *array5 = NULL ; + int is_new_object5 ; + PyArrayObject *array6 = NULL ; + int is_new_object6 ; + PyArrayObject *array7 = NULL ; + int is_new_object7 ; + PyArrayObject *temp8 = NULL ; + PyArrayObject *temp9 = NULL ; + PyArrayObject *temp10 = NULL ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + PyObject * obj7 = 0 ; + PyObject * obj8 = 0 ; + PyObject * obj9 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOOO:bsr_transpose",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9)) SWIG_fail; + ecode1 = SWIG_AsVal_int(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "bsr_transpose" "', argument " "1"" of type '" "int""'"); + } + arg1 = static_cast< int >(val1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bsr_transpose" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "bsr_transpose" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "bsr_transpose" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + { + npy_intp size[1] = { + -1 + }; + array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_INT, &is_new_object5); + if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1) + || !require_contiguous(array5) || !require_native(array5)) SWIG_fail; + + arg5 = (int*) array5->data; + } + { + npy_intp size[1] = { + -1 + }; + array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_INT, &is_new_object6); + if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1) + || !require_contiguous(array6) || !require_native(array6)) SWIG_fail; + + arg6 = (int*) array6->data; + } + { + npy_intp size[1] = { + -1 + }; + array7 = obj_to_array_contiguous_allow_conversion(obj6, PyArray_USHORT, &is_new_object7); + if (!array7 || !require_dimensions(array7,1) || !require_size(array7,size,1) + || !require_contiguous(array7) || !require_native(array7)) SWIG_fail; + + arg7 = (unsigned short*) array7->data; + } + { + temp8 = obj_to_array_no_conversion(obj7,PyArray_INT); + if (!temp8 || !require_contiguous(temp8) || !require_native(temp8)) SWIG_fail; + arg8 = (int*) array_data(temp8); + } + { + temp9 = obj_to_array_no_conversion(obj8,PyArray_INT); + if (!temp9 || !require_contiguous(temp9) || !require_native(temp9)) SWIG_fail; + arg9 = (int*) array_data(temp9); + } + { + temp10 = obj_to_array_no_conversion(obj9,PyArray_USHORT); + if (!temp10 || !require_contiguous(temp10) || !require_native(temp10)) SWIG_fail; + arg10 = (unsigned short*) array_data(temp10); + } + bsr_transpose< int,unsigned short >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(unsigned short const (*))arg7,arg8,arg9,arg10); + resultobj = SWIG_Py_Void(); + { + if (is_new_object5 && array5) Py_DECREF(array5); + } + { + if (is_new_object6 && array6) Py_DECREF(array6); + } + { + if (is_new_object7 && array7) Py_DECREF(array7); + } + return resultobj; +fail: + { + if (is_new_object5 && array5) Py_DECREF(array5); + } + { + if (is_new_object6 && array6) Py_DECREF(array6); + } + { + if (is_new_object7 && array7) Py_DECREF(array7); + } + return NULL; +} + + +SWIGINTERN PyObject *_wrap_bsr_transpose__SWIG_5(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + int arg1 ; + int arg2 ; + int arg3 ; + int arg4 ; + int *arg5 ; + int *arg6 ; + int *arg7 ; + int *arg8 ; + int *arg9 ; + int *arg10 ; + int val1 ; + int ecode1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + PyArrayObject *array5 = NULL ; + int is_new_object5 ; + PyArrayObject *array6 = NULL ; + int is_new_object6 ; + PyArrayObject *array7 = NULL ; + int is_new_object7 ; + PyArrayObject *temp8 = NULL ; + PyArrayObject *temp9 = NULL ; + PyArrayObject *temp10 = NULL ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + PyObject * obj7 = 0 ; + PyObject * obj8 = 0 ; + PyObject * obj9 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOOO:bsr_transpose",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9)) SWIG_fail; + ecode1 = SWIG_AsVal_int(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "bsr_transpose" "', argument " "1"" of type '" "int""'"); + } + arg1 = static_cast< int >(val1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bsr_transpose" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "bsr_transpose" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "bsr_transpose" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + { + npy_intp size[1] = { + -1 + }; + array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_INT, &is_new_object5); + if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1) + || !require_contiguous(array5) || !require_native(array5)) SWIG_fail; + + arg5 = (int*) array5->data; + } + { + npy_intp size[1] = { + -1 + }; + array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_INT, &is_new_object6); + if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1) + || !require_contiguous(array6) || !require_native(array6)) SWIG_fail; + + arg6 = (int*) array6->data; + } + { + npy_intp size[1] = { + -1 + }; + array7 = obj_to_array_contiguous_allow_conversion(obj6, PyArray_INT, &is_new_object7); + if (!array7 || !require_dimensions(array7,1) || !require_size(array7,size,1) + || !require_contiguous(array7) || !require_native(array7)) SWIG_fail; + + arg7 = (int*) array7->data; + } + { + temp8 = obj_to_array_no_conversion(obj7,PyArray_INT); + if (!temp8 || !require_contiguous(temp8) || !require_native(temp8)) SWIG_fail; + arg8 = (int*) array_data(temp8); + } + { + temp9 = obj_to_array_no_conversion(obj8,PyArray_INT); + if (!temp9 || !require_contiguous(temp9) || !require_native(temp9)) SWIG_fail; + arg9 = (int*) array_data(temp9); + } + { + temp10 = obj_to_array_no_conversion(obj9,PyArray_INT); + if (!temp10 || !require_contiguous(temp10) || !require_native(temp10)) SWIG_fail; + arg10 = (int*) array_data(temp10); + } + bsr_transpose< int,int >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(int const (*))arg7,arg8,arg9,arg10); + resultobj = SWIG_Py_Void(); + { + if (is_new_object5 && array5) Py_DECREF(array5); + } + { + if (is_new_object6 && array6) Py_DECREF(array6); + } + { + if (is_new_object7 && array7) Py_DECREF(array7); + } + return resultobj; +fail: + { + if (is_new_object5 && array5) Py_DECREF(array5); + } + { + if (is_new_object6 && array6) Py_DECREF(array6); + } + { + if (is_new_object7 && array7) Py_DECREF(array7); + } + return NULL; +} + + +SWIGINTERN PyObject *_wrap_bsr_transpose__SWIG_6(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + int arg1 ; + int arg2 ; + int arg3 ; + int arg4 ; + int *arg5 ; + int *arg6 ; + unsigned int *arg7 ; + int *arg8 ; + int *arg9 ; + unsigned int *arg10 ; + int val1 ; + int ecode1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + PyArrayObject *array5 = NULL ; + int is_new_object5 ; + PyArrayObject *array6 = NULL ; + int is_new_object6 ; + PyArrayObject *array7 = NULL ; + int is_new_object7 ; + PyArrayObject *temp8 = NULL ; + PyArrayObject *temp9 = NULL ; + PyArrayObject *temp10 = NULL ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + PyObject * obj7 = 0 ; + PyObject * obj8 = 0 ; + PyObject * obj9 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOOO:bsr_transpose",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9)) SWIG_fail; + ecode1 = SWIG_AsVal_int(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "bsr_transpose" "', argument " "1"" of type '" "int""'"); + } + arg1 = static_cast< int >(val1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bsr_transpose" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "bsr_transpose" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "bsr_transpose" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + { + npy_intp size[1] = { + -1 + }; + array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_INT, &is_new_object5); + if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1) + || !require_contiguous(array5) || !require_native(array5)) SWIG_fail; + + arg5 = (int*) array5->data; + } + { + npy_intp size[1] = { + -1 + }; + array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_INT, &is_new_object6); + if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1) + || !require_contiguous(array6) || !require_native(array6)) SWIG_fail; + + arg6 = (int*) array6->data; + } + { + npy_intp size[1] = { + -1 + }; + array7 = obj_to_array_contiguous_allow_conversion(obj6, PyArray_UINT, &is_new_object7); + if (!array7 || !require_dimensions(array7,1) || !require_size(array7,size,1) + || !require_contiguous(array7) || !require_native(array7)) SWIG_fail; + + arg7 = (unsigned int*) array7->data; + } + { + temp8 = obj_to_array_no_conversion(obj7,PyArray_INT); + if (!temp8 || !require_contiguous(temp8) || !require_native(temp8)) SWIG_fail; + arg8 = (int*) array_data(temp8); + } + { + temp9 = obj_to_array_no_conversion(obj8,PyArray_INT); + if (!temp9 || !require_contiguous(temp9) || !require_native(temp9)) SWIG_fail; + arg9 = (int*) array_data(temp9); + } + { + temp10 = obj_to_array_no_conversion(obj9,PyArray_UINT); + if (!temp10 || !require_contiguous(temp10) || !require_native(temp10)) SWIG_fail; + arg10 = (unsigned int*) array_data(temp10); + } + bsr_transpose< int,unsigned int >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(unsigned int const (*))arg7,arg8,arg9,arg10); + resultobj = SWIG_Py_Void(); + { + if (is_new_object5 && array5) Py_DECREF(array5); + } + { + if (is_new_object6 && array6) Py_DECREF(array6); + } + { + if (is_new_object7 && array7) Py_DECREF(array7); + } + return resultobj; +fail: + { + if (is_new_object5 && array5) Py_DECREF(array5); + } + { + if (is_new_object6 && array6) Py_DECREF(array6); + } + { + if (is_new_object7 && array7) Py_DECREF(array7); + } + return NULL; +} + + +SWIGINTERN PyObject *_wrap_bsr_transpose__SWIG_7(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + int arg1 ; + int arg2 ; + int arg3 ; + int arg4 ; + int *arg5 ; + int *arg6 ; + long long *arg7 ; + int *arg8 ; + int *arg9 ; + long long *arg10 ; + int val1 ; + int ecode1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + PyArrayObject *array5 = NULL ; + int is_new_object5 ; + PyArrayObject *array6 = NULL ; + int is_new_object6 ; + PyArrayObject *array7 = NULL ; + int is_new_object7 ; + PyArrayObject *temp8 = NULL ; + PyArrayObject *temp9 = NULL ; + PyArrayObject *temp10 = NULL ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + PyObject * obj7 = 0 ; + PyObject * obj8 = 0 ; + PyObject * obj9 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOOO:bsr_transpose",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9)) SWIG_fail; + ecode1 = SWIG_AsVal_int(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "bsr_transpose" "', argument " "1"" of type '" "int""'"); + } + arg1 = static_cast< int >(val1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bsr_transpose" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "bsr_transpose" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "bsr_transpose" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + { + npy_intp size[1] = { + -1 + }; + array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_INT, &is_new_object5); + if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1) + || !require_contiguous(array5) || !require_native(array5)) SWIG_fail; + + arg5 = (int*) array5->data; + } + { + npy_intp size[1] = { + -1 + }; + array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_INT, &is_new_object6); + if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1) + || !require_contiguous(array6) || !require_native(array6)) SWIG_fail; + + arg6 = (int*) array6->data; + } + { + npy_intp size[1] = { + -1 + }; + array7 = obj_to_array_contiguous_allow_conversion(obj6, PyArray_LONGLONG, &is_new_object7); + if (!array7 || !require_dimensions(array7,1) || !require_size(array7,size,1) + || !require_contiguous(array7) || !require_native(array7)) SWIG_fail; + + arg7 = (long long*) array7->data; + } + { + temp8 = obj_to_array_no_conversion(obj7,PyArray_INT); + if (!temp8 || !require_contiguous(temp8) || !require_native(temp8)) SWIG_fail; + arg8 = (int*) array_data(temp8); + } + { + temp9 = obj_to_array_no_conversion(obj8,PyArray_INT); + if (!temp9 || !require_contiguous(temp9) || !require_native(temp9)) SWIG_fail; + arg9 = (int*) array_data(temp9); + } + { + temp10 = obj_to_array_no_conversion(obj9,PyArray_LONGLONG); + if (!temp10 || !require_contiguous(temp10) || !require_native(temp10)) SWIG_fail; + arg10 = (long long*) array_data(temp10); + } + bsr_transpose< int,long long >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(long long const (*))arg7,arg8,arg9,arg10); + resultobj = SWIG_Py_Void(); + { + if (is_new_object5 && array5) Py_DECREF(array5); + } + { + if (is_new_object6 && array6) Py_DECREF(array6); + } + { + if (is_new_object7 && array7) Py_DECREF(array7); + } + return resultobj; +fail: + { + if (is_new_object5 && array5) Py_DECREF(array5); + } + { + if (is_new_object6 && array6) Py_DECREF(array6); + } + { + if (is_new_object7 && array7) Py_DECREF(array7); + } + return NULL; +} + + +SWIGINTERN PyObject *_wrap_bsr_transpose__SWIG_8(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + int arg1 ; + int arg2 ; + int arg3 ; + int arg4 ; + int *arg5 ; + int *arg6 ; + unsigned long long *arg7 ; + int *arg8 ; + int *arg9 ; + unsigned long long *arg10 ; + int val1 ; + int ecode1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + PyArrayObject *array5 = NULL ; + int is_new_object5 ; + PyArrayObject *array6 = NULL ; + int is_new_object6 ; + PyArrayObject *array7 = NULL ; + int is_new_object7 ; + PyArrayObject *temp8 = NULL ; + PyArrayObject *temp9 = NULL ; + PyArrayObject *temp10 = NULL ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + PyObject * obj7 = 0 ; + PyObject * obj8 = 0 ; + PyObject * obj9 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOOO:bsr_transpose",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9)) SWIG_fail; + ecode1 = SWIG_AsVal_int(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "bsr_transpose" "', argument " "1"" of type '" "int""'"); + } + arg1 = static_cast< int >(val1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bsr_transpose" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "bsr_transpose" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "bsr_transpose" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + { + npy_intp size[1] = { + -1 + }; + array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_INT, &is_new_object5); + if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1) + || !require_contiguous(array5) || !require_native(array5)) SWIG_fail; + + arg5 = (int*) array5->data; + } + { + npy_intp size[1] = { + -1 + }; + array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_INT, &is_new_object6); + if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1) + || !require_contiguous(array6) || !require_native(array6)) SWIG_fail; + + arg6 = (int*) array6->data; + } + { + npy_intp size[1] = { + -1 + }; + array7 = obj_to_array_contiguous_allow_conversion(obj6, PyArray_ULONGLONG, &is_new_object7); + if (!array7 || !require_dimensions(array7,1) || !require_size(array7,size,1) + || !require_contiguous(array7) || !require_native(array7)) SWIG_fail; + + arg7 = (unsigned long long*) array7->data; + } + { + temp8 = obj_to_array_no_conversion(obj7,PyArray_INT); + if (!temp8 || !require_contiguous(temp8) || !require_native(temp8)) SWIG_fail; + arg8 = (int*) array_data(temp8); + } + { + temp9 = obj_to_array_no_conversion(obj8,PyArray_INT); + if (!temp9 || !require_contiguous(temp9) || !require_native(temp9)) SWIG_fail; + arg9 = (int*) array_data(temp9); + } + { + temp10 = obj_to_array_no_conversion(obj9,PyArray_ULONGLONG); + if (!temp10 || !require_contiguous(temp10) || !require_native(temp10)) SWIG_fail; + arg10 = (unsigned long long*) array_data(temp10); + } + bsr_transpose< int,unsigned long long >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(unsigned long long const (*))arg7,arg8,arg9,arg10); + resultobj = SWIG_Py_Void(); + { + if (is_new_object5 && array5) Py_DECREF(array5); + } + { + if (is_new_object6 && array6) Py_DECREF(array6); + } + { + if (is_new_object7 && array7) Py_DECREF(array7); + } + return resultobj; +fail: + { + if (is_new_object5 && array5) Py_DECREF(array5); + } + { + if (is_new_object6 && array6) Py_DECREF(array6); + } + { + if (is_new_object7 && array7) Py_DECREF(array7); + } + return NULL; +} + + +SWIGINTERN PyObject *_wrap_bsr_transpose__SWIG_9(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + int arg1 ; + int arg2 ; + int arg3 ; + int arg4 ; + int *arg5 ; + int *arg6 ; + float *arg7 ; + int *arg8 ; + int *arg9 ; + float *arg10 ; + int val1 ; + int ecode1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + PyArrayObject *array5 = NULL ; + int is_new_object5 ; + PyArrayObject *array6 = NULL ; + int is_new_object6 ; + PyArrayObject *array7 = NULL ; + int is_new_object7 ; + PyArrayObject *temp8 = NULL ; + PyArrayObject *temp9 = NULL ; + PyArrayObject *temp10 = NULL ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + PyObject * obj7 = 0 ; + PyObject * obj8 = 0 ; + PyObject * obj9 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOOO:bsr_transpose",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9)) SWIG_fail; + ecode1 = SWIG_AsVal_int(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "bsr_transpose" "', argument " "1"" of type '" "int""'"); + } + arg1 = static_cast< int >(val1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bsr_transpose" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "bsr_transpose" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "bsr_transpose" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + { + npy_intp size[1] = { + -1 + }; + array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_INT, &is_new_object5); + if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1) + || !require_contiguous(array5) || !require_native(array5)) SWIG_fail; + + arg5 = (int*) array5->data; + } + { + npy_intp size[1] = { + -1 + }; + array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_INT, &is_new_object6); + if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1) + || !require_contiguous(array6) || !require_native(array6)) SWIG_fail; + + arg6 = (int*) array6->data; + } + { + npy_intp size[1] = { + -1 + }; + array7 = obj_to_array_contiguous_allow_conversion(obj6, PyArray_FLOAT, &is_new_object7); + if (!array7 || !require_dimensions(array7,1) || !require_size(array7,size,1) + || !require_contiguous(array7) || !require_native(array7)) SWIG_fail; + + arg7 = (float*) array7->data; + } + { + temp8 = obj_to_array_no_conversion(obj7,PyArray_INT); + if (!temp8 || !require_contiguous(temp8) || !require_native(temp8)) SWIG_fail; + arg8 = (int*) array_data(temp8); + } + { + temp9 = obj_to_array_no_conversion(obj8,PyArray_INT); + if (!temp9 || !require_contiguous(temp9) || !require_native(temp9)) SWIG_fail; + arg9 = (int*) array_data(temp9); + } + { + temp10 = obj_to_array_no_conversion(obj9,PyArray_FLOAT); + if (!temp10 || !require_contiguous(temp10) || !require_native(temp10)) SWIG_fail; + arg10 = (float*) array_data(temp10); + } + bsr_transpose< int,float >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(float const (*))arg7,arg8,arg9,arg10); + resultobj = SWIG_Py_Void(); + { + if (is_new_object5 && array5) Py_DECREF(array5); + } + { + if (is_new_object6 && array6) Py_DECREF(array6); + } + { + if (is_new_object7 && array7) Py_DECREF(array7); + } + return resultobj; +fail: + { + if (is_new_object5 && array5) Py_DECREF(array5); + } + { + if (is_new_object6 && array6) Py_DECREF(array6); + } + { + if (is_new_object7 && array7) Py_DECREF(array7); + } + return NULL; +} + + +SWIGINTERN PyObject *_wrap_bsr_transpose__SWIG_10(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + int arg1 ; + int arg2 ; + int arg3 ; + int arg4 ; + int *arg5 ; + int *arg6 ; + double *arg7 ; + int *arg8 ; + int *arg9 ; + double *arg10 ; + int val1 ; + int ecode1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + PyArrayObject *array5 = NULL ; + int is_new_object5 ; + PyArrayObject *array6 = NULL ; + int is_new_object6 ; + PyArrayObject *array7 = NULL ; + int is_new_object7 ; + PyArrayObject *temp8 = NULL ; + PyArrayObject *temp9 = NULL ; + PyArrayObject *temp10 = NULL ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + PyObject * obj7 = 0 ; + PyObject * obj8 = 0 ; + PyObject * obj9 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOOO:bsr_transpose",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9)) SWIG_fail; + ecode1 = SWIG_AsVal_int(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "bsr_transpose" "', argument " "1"" of type '" "int""'"); + } + arg1 = static_cast< int >(val1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bsr_transpose" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "bsr_transpose" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "bsr_transpose" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + { + npy_intp size[1] = { + -1 + }; + array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_INT, &is_new_object5); + if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1) + || !require_contiguous(array5) || !require_native(array5)) SWIG_fail; + + arg5 = (int*) array5->data; + } + { + npy_intp size[1] = { + -1 + }; + array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_INT, &is_new_object6); + if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1) + || !require_contiguous(array6) || !require_native(array6)) SWIG_fail; + + arg6 = (int*) array6->data; + } + { + npy_intp size[1] = { + -1 + }; + array7 = obj_to_array_contiguous_allow_conversion(obj6, PyArray_DOUBLE, &is_new_object7); + if (!array7 || !require_dimensions(array7,1) || !require_size(array7,size,1) + || !require_contiguous(array7) || !require_native(array7)) SWIG_fail; + + arg7 = (double*) array7->data; + } + { + temp8 = obj_to_array_no_conversion(obj7,PyArray_INT); + if (!temp8 || !require_contiguous(temp8) || !require_native(temp8)) SWIG_fail; + arg8 = (int*) array_data(temp8); + } + { + temp9 = obj_to_array_no_conversion(obj8,PyArray_INT); + if (!temp9 || !require_contiguous(temp9) || !require_native(temp9)) SWIG_fail; + arg9 = (int*) array_data(temp9); + } + { + temp10 = obj_to_array_no_conversion(obj9,PyArray_DOUBLE); + if (!temp10 || !require_contiguous(temp10) || !require_native(temp10)) SWIG_fail; + arg10 = (double*) array_data(temp10); + } + bsr_transpose< int,double >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(double const (*))arg7,arg8,arg9,arg10); + resultobj = SWIG_Py_Void(); + { + if (is_new_object5 && array5) Py_DECREF(array5); + } + { + if (is_new_object6 && array6) Py_DECREF(array6); + } + { + if (is_new_object7 && array7) Py_DECREF(array7); + } + return resultobj; +fail: + { + if (is_new_object5 && array5) Py_DECREF(array5); + } + { + if (is_new_object6 && array6) Py_DECREF(array6); + } + { + if (is_new_object7 && array7) Py_DECREF(array7); + } + return NULL; +} + + +SWIGINTERN PyObject *_wrap_bsr_transpose__SWIG_11(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + int arg1 ; + int arg2 ; + int arg3 ; + int arg4 ; + int *arg5 ; + int *arg6 ; + long double *arg7 ; + int *arg8 ; + int *arg9 ; + long double *arg10 ; + int val1 ; + int ecode1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + PyArrayObject *array5 = NULL ; + int is_new_object5 ; + PyArrayObject *array6 = NULL ; + int is_new_object6 ; + PyArrayObject *array7 = NULL ; + int is_new_object7 ; + PyArrayObject *temp8 = NULL ; + PyArrayObject *temp9 = NULL ; + PyArrayObject *temp10 = NULL ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + PyObject * obj7 = 0 ; + PyObject * obj8 = 0 ; + PyObject * obj9 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOOO:bsr_transpose",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9)) SWIG_fail; + ecode1 = SWIG_AsVal_int(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "bsr_transpose" "', argument " "1"" of type '" "int""'"); + } + arg1 = static_cast< int >(val1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bsr_transpose" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "bsr_transpose" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "bsr_transpose" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + { + npy_intp size[1] = { + -1 + }; + array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_INT, &is_new_object5); + if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1) + || !require_contiguous(array5) || !require_native(array5)) SWIG_fail; + + arg5 = (int*) array5->data; + } + { + npy_intp size[1] = { + -1 + }; + array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_INT, &is_new_object6); + if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1) + || !require_contiguous(array6) || !require_native(array6)) SWIG_fail; + + arg6 = (int*) array6->data; + } + { + npy_intp size[1] = { + -1 + }; + array7 = obj_to_array_contiguous_allow_conversion(obj6, PyArray_LONGDOUBLE, &is_new_object7); + if (!array7 || !require_dimensions(array7,1) || !require_size(array7,size,1) + || !require_contiguous(array7) || !require_native(array7)) SWIG_fail; + + arg7 = (long double*) array7->data; + } + { + temp8 = obj_to_array_no_conversion(obj7,PyArray_INT); + if (!temp8 || !require_contiguous(temp8) || !require_native(temp8)) SWIG_fail; + arg8 = (int*) array_data(temp8); + } + { + temp9 = obj_to_array_no_conversion(obj8,PyArray_INT); + if (!temp9 || !require_contiguous(temp9) || !require_native(temp9)) SWIG_fail; + arg9 = (int*) array_data(temp9); + } + { + temp10 = obj_to_array_no_conversion(obj9,PyArray_LONGDOUBLE); + if (!temp10 || !require_contiguous(temp10) || !require_native(temp10)) SWIG_fail; + arg10 = (long double*) array_data(temp10); + } + bsr_transpose< int,long double >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(long double const (*))arg7,arg8,arg9,arg10); + resultobj = SWIG_Py_Void(); + { + if (is_new_object5 && array5) Py_DECREF(array5); + } + { + if (is_new_object6 && array6) Py_DECREF(array6); + } + { + if (is_new_object7 && array7) Py_DECREF(array7); + } + return resultobj; +fail: + { + if (is_new_object5 && array5) Py_DECREF(array5); + } + { + if (is_new_object6 && array6) Py_DECREF(array6); + } + { + if (is_new_object7 && array7) Py_DECREF(array7); + } + return NULL; +} + + +SWIGINTERN PyObject *_wrap_bsr_transpose__SWIG_12(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + int arg1 ; + int arg2 ; + int arg3 ; + int arg4 ; + int *arg5 ; + int *arg6 ; + npy_cfloat_wrapper *arg7 ; + int *arg8 ; + int *arg9 ; + npy_cfloat_wrapper *arg10 ; + int val1 ; + int ecode1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + PyArrayObject *array5 = NULL ; + int is_new_object5 ; + PyArrayObject *array6 = NULL ; + int is_new_object6 ; + PyArrayObject *array7 = NULL ; + int is_new_object7 ; + PyArrayObject *temp8 = NULL ; + PyArrayObject *temp9 = NULL ; + PyArrayObject *temp10 = NULL ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + PyObject * obj7 = 0 ; + PyObject * obj8 = 0 ; + PyObject * obj9 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOOO:bsr_transpose",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9)) SWIG_fail; + ecode1 = SWIG_AsVal_int(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "bsr_transpose" "', argument " "1"" of type '" "int""'"); + } + arg1 = static_cast< int >(val1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bsr_transpose" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "bsr_transpose" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "bsr_transpose" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + { + npy_intp size[1] = { + -1 + }; + array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_INT, &is_new_object5); + if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1) + || !require_contiguous(array5) || !require_native(array5)) SWIG_fail; + + arg5 = (int*) array5->data; + } + { + npy_intp size[1] = { + -1 + }; + array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_INT, &is_new_object6); + if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1) + || !require_contiguous(array6) || !require_native(array6)) SWIG_fail; + + arg6 = (int*) array6->data; + } + { + npy_intp size[1] = { + -1 + }; + array7 = obj_to_array_contiguous_allow_conversion(obj6, PyArray_CFLOAT, &is_new_object7); + if (!array7 || !require_dimensions(array7,1) || !require_size(array7,size,1) + || !require_contiguous(array7) || !require_native(array7)) SWIG_fail; + + arg7 = (npy_cfloat_wrapper*) array7->data; + } + { + temp8 = obj_to_array_no_conversion(obj7,PyArray_INT); + if (!temp8 || !require_contiguous(temp8) || !require_native(temp8)) SWIG_fail; + arg8 = (int*) array_data(temp8); + } + { + temp9 = obj_to_array_no_conversion(obj8,PyArray_INT); + if (!temp9 || !require_contiguous(temp9) || !require_native(temp9)) SWIG_fail; + arg9 = (int*) array_data(temp9); + } + { + temp10 = obj_to_array_no_conversion(obj9,PyArray_CFLOAT); + if (!temp10 || !require_contiguous(temp10) || !require_native(temp10)) SWIG_fail; + arg10 = (npy_cfloat_wrapper*) array_data(temp10); + } + bsr_transpose< int,npy_cfloat_wrapper >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(npy_cfloat_wrapper const (*))arg7,arg8,arg9,arg10); + resultobj = SWIG_Py_Void(); + { + if (is_new_object5 && array5) Py_DECREF(array5); + } + { + if (is_new_object6 && array6) Py_DECREF(array6); + } + { + if (is_new_object7 && array7) Py_DECREF(array7); + } + return resultobj; +fail: + { + if (is_new_object5 && array5) Py_DECREF(array5); + } + { + if (is_new_object6 && array6) Py_DECREF(array6); + } + { + if (is_new_object7 && array7) Py_DECREF(array7); + } + return NULL; +} + + +SWIGINTERN PyObject *_wrap_bsr_transpose__SWIG_13(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + int arg1 ; + int arg2 ; + int arg3 ; + int arg4 ; + int *arg5 ; + int *arg6 ; + npy_cdouble_wrapper *arg7 ; + int *arg8 ; + int *arg9 ; + npy_cdouble_wrapper *arg10 ; + int val1 ; + int ecode1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + PyArrayObject *array5 = NULL ; + int is_new_object5 ; + PyArrayObject *array6 = NULL ; + int is_new_object6 ; + PyArrayObject *array7 = NULL ; + int is_new_object7 ; + PyArrayObject *temp8 = NULL ; + PyArrayObject *temp9 = NULL ; + PyArrayObject *temp10 = NULL ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + PyObject * obj7 = 0 ; + PyObject * obj8 = 0 ; + PyObject * obj9 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOOO:bsr_transpose",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9)) SWIG_fail; + ecode1 = SWIG_AsVal_int(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "bsr_transpose" "', argument " "1"" of type '" "int""'"); + } + arg1 = static_cast< int >(val1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bsr_transpose" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "bsr_transpose" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "bsr_transpose" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + { + npy_intp size[1] = { + -1 + }; + array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_INT, &is_new_object5); + if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1) + || !require_contiguous(array5) || !require_native(array5)) SWIG_fail; + + arg5 = (int*) array5->data; + } + { + npy_intp size[1] = { + -1 + }; + array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_INT, &is_new_object6); + if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1) + || !require_contiguous(array6) || !require_native(array6)) SWIG_fail; + + arg6 = (int*) array6->data; + } + { + npy_intp size[1] = { + -1 + }; + array7 = obj_to_array_contiguous_allow_conversion(obj6, PyArray_CDOUBLE, &is_new_object7); + if (!array7 || !require_dimensions(array7,1) || !require_size(array7,size,1) + || !require_contiguous(array7) || !require_native(array7)) SWIG_fail; + + arg7 = (npy_cdouble_wrapper*) array7->data; + } + { + temp8 = obj_to_array_no_conversion(obj7,PyArray_INT); + if (!temp8 || !require_contiguous(temp8) || !require_native(temp8)) SWIG_fail; + arg8 = (int*) array_data(temp8); + } + { + temp9 = obj_to_array_no_conversion(obj8,PyArray_INT); + if (!temp9 || !require_contiguous(temp9) || !require_native(temp9)) SWIG_fail; + arg9 = (int*) array_data(temp9); + } + { + temp10 = obj_to_array_no_conversion(obj9,PyArray_CDOUBLE); + if (!temp10 || !require_contiguous(temp10) || !require_native(temp10)) SWIG_fail; + arg10 = (npy_cdouble_wrapper*) array_data(temp10); + } + bsr_transpose< int,npy_cdouble_wrapper >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(npy_cdouble_wrapper const (*))arg7,arg8,arg9,arg10); + resultobj = SWIG_Py_Void(); + { + if (is_new_object5 && array5) Py_DECREF(array5); + } + { + if (is_new_object6 && array6) Py_DECREF(array6); + } + { + if (is_new_object7 && array7) Py_DECREF(array7); + } + return resultobj; +fail: + { + if (is_new_object5 && array5) Py_DECREF(array5); + } + { + if (is_new_object6 && array6) Py_DECREF(array6); + } + { + if (is_new_object7 && array7) Py_DECREF(array7); + } + return NULL; +} + + +SWIGINTERN PyObject *_wrap_bsr_transpose__SWIG_14(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + int arg1 ; + int arg2 ; + int arg3 ; + int arg4 ; + int *arg5 ; + int *arg6 ; + npy_clongdouble_wrapper *arg7 ; + int *arg8 ; + int *arg9 ; + npy_clongdouble_wrapper *arg10 ; + int val1 ; + int ecode1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + PyArrayObject *array5 = NULL ; + int is_new_object5 ; + PyArrayObject *array6 = NULL ; + int is_new_object6 ; + PyArrayObject *array7 = NULL ; + int is_new_object7 ; + PyArrayObject *temp8 = NULL ; + PyArrayObject *temp9 = NULL ; + PyArrayObject *temp10 = NULL ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + PyObject * obj7 = 0 ; + PyObject * obj8 = 0 ; + PyObject * obj9 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOOO:bsr_transpose",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9)) SWIG_fail; + ecode1 = SWIG_AsVal_int(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "bsr_transpose" "', argument " "1"" of type '" "int""'"); + } + arg1 = static_cast< int >(val1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bsr_transpose" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "bsr_transpose" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "bsr_transpose" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + { + npy_intp size[1] = { + -1 + }; + array5 = obj_to_array_contiguous_allow_conversion(obj4, PyArray_INT, &is_new_object5); + if (!array5 || !require_dimensions(array5,1) || !require_size(array5,size,1) + || !require_contiguous(array5) || !require_native(array5)) SWIG_fail; + + arg5 = (int*) array5->data; + } + { + npy_intp size[1] = { + -1 + }; + array6 = obj_to_array_contiguous_allow_conversion(obj5, PyArray_INT, &is_new_object6); + if (!array6 || !require_dimensions(array6,1) || !require_size(array6,size,1) + || !require_contiguous(array6) || !require_native(array6)) SWIG_fail; + + arg6 = (int*) array6->data; + } + { + npy_intp size[1] = { + -1 + }; + array7 = obj_to_array_contiguous_allow_conversion(obj6, PyArray_CLONGDOUBLE, &is_new_object7); + if (!array7 || !require_dimensions(array7,1) || !require_size(array7,size,1) + || !require_contiguous(array7) || !require_native(array7)) SWIG_fail; + + arg7 = (npy_clongdouble_wrapper*) array7->data; + } + { + temp8 = obj_to_array_no_conversion(obj7,PyArray_INT); + if (!temp8 || !require_contiguous(temp8) || !require_native(temp8)) SWIG_fail; + arg8 = (int*) array_data(temp8); + } + { + temp9 = obj_to_array_no_conversion(obj8,PyArray_INT); + if (!temp9 || !require_contiguous(temp9) || !require_native(temp9)) SWIG_fail; + arg9 = (int*) array_data(temp9); + } + { + temp10 = obj_to_array_no_conversion(obj9,PyArray_CLONGDOUBLE); + if (!temp10 || !require_contiguous(temp10) || !require_native(temp10)) SWIG_fail; + arg10 = (npy_clongdouble_wrapper*) array_data(temp10); + } + bsr_transpose< int,npy_clongdouble_wrapper >(arg1,arg2,arg3,arg4,(int const (*))arg5,(int const (*))arg6,(npy_clongdouble_wrapper const (*))arg7,arg8,arg9,arg10); + resultobj = SWIG_Py_Void(); + { + if (is_new_object5 && array5) Py_DECREF(array5); + } + { + if (is_new_object6 && array6) Py_DECREF(array6); + } + { + if (is_new_object7 && array7) Py_DECREF(array7); + } + return resultobj; +fail: + { + if (is_new_object5 && array5) Py_DECREF(array5); + } + { + if (is_new_object6 && array6) Py_DECREF(array6); + } + { + if (is_new_object7 && array7) Py_DECREF(array7); + } + return NULL; +} + + +SWIGINTERN PyObject *_wrap_bsr_transpose(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[11]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = (int)PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 10); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 10) { + int _v; + { + int res = SWIG_AsVal_int(argv[0], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[3], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_BYTE)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[7]) && PyArray_CanCastSafely(PyArray_TYPE(argv[7]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[8]) && PyArray_CanCastSafely(PyArray_TYPE(argv[8]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[9]) && PyArray_CanCastSafely(PyArray_TYPE(argv[9]),PyArray_BYTE)) ? 1 : 0; + } + if (_v) { + return _wrap_bsr_transpose__SWIG_1(self, args); + } + } + } + } + } + } + } + } + } + } + } + if (argc == 10) { + int _v; + { + int res = SWIG_AsVal_int(argv[0], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[3], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_UBYTE)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[7]) && PyArray_CanCastSafely(PyArray_TYPE(argv[7]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[8]) && PyArray_CanCastSafely(PyArray_TYPE(argv[8]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[9]) && PyArray_CanCastSafely(PyArray_TYPE(argv[9]),PyArray_UBYTE)) ? 1 : 0; + } + if (_v) { + return _wrap_bsr_transpose__SWIG_2(self, args); + } + } + } + } + } + } + } + } + } + } + } + if (argc == 10) { + int _v; + { + int res = SWIG_AsVal_int(argv[0], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[3], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_SHORT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[7]) && PyArray_CanCastSafely(PyArray_TYPE(argv[7]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[8]) && PyArray_CanCastSafely(PyArray_TYPE(argv[8]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[9]) && PyArray_CanCastSafely(PyArray_TYPE(argv[9]),PyArray_SHORT)) ? 1 : 0; + } + if (_v) { + return _wrap_bsr_transpose__SWIG_3(self, args); + } + } + } + } + } + } + } + } + } + } + } + if (argc == 10) { + int _v; + { + int res = SWIG_AsVal_int(argv[0], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[3], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_USHORT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[7]) && PyArray_CanCastSafely(PyArray_TYPE(argv[7]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[8]) && PyArray_CanCastSafely(PyArray_TYPE(argv[8]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[9]) && PyArray_CanCastSafely(PyArray_TYPE(argv[9]),PyArray_USHORT)) ? 1 : 0; + } + if (_v) { + return _wrap_bsr_transpose__SWIG_4(self, args); + } + } + } + } + } + } + } + } + } + } + } + if (argc == 10) { + int _v; + { + int res = SWIG_AsVal_int(argv[0], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[3], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[7]) && PyArray_CanCastSafely(PyArray_TYPE(argv[7]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[8]) && PyArray_CanCastSafely(PyArray_TYPE(argv[8]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[9]) && PyArray_CanCastSafely(PyArray_TYPE(argv[9]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + return _wrap_bsr_transpose__SWIG_5(self, args); + } + } + } + } + } + } + } + } + } + } + } + if (argc == 10) { + int _v; + { + int res = SWIG_AsVal_int(argv[0], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[3], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_UINT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[7]) && PyArray_CanCastSafely(PyArray_TYPE(argv[7]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[8]) && PyArray_CanCastSafely(PyArray_TYPE(argv[8]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[9]) && PyArray_CanCastSafely(PyArray_TYPE(argv[9]),PyArray_UINT)) ? 1 : 0; + } + if (_v) { + return _wrap_bsr_transpose__SWIG_6(self, args); + } + } + } + } + } + } + } + } + } + } + } + if (argc == 10) { + int _v; + { + int res = SWIG_AsVal_int(argv[0], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[3], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_LONGLONG)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[7]) && PyArray_CanCastSafely(PyArray_TYPE(argv[7]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[8]) && PyArray_CanCastSafely(PyArray_TYPE(argv[8]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[9]) && PyArray_CanCastSafely(PyArray_TYPE(argv[9]),PyArray_LONGLONG)) ? 1 : 0; + } + if (_v) { + return _wrap_bsr_transpose__SWIG_7(self, args); + } + } + } + } + } + } + } + } + } + } + } + if (argc == 10) { + int _v; + { + int res = SWIG_AsVal_int(argv[0], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[3], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_ULONGLONG)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[7]) && PyArray_CanCastSafely(PyArray_TYPE(argv[7]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[8]) && PyArray_CanCastSafely(PyArray_TYPE(argv[8]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[9]) && PyArray_CanCastSafely(PyArray_TYPE(argv[9]),PyArray_ULONGLONG)) ? 1 : 0; + } + if (_v) { + return _wrap_bsr_transpose__SWIG_8(self, args); + } + } + } + } + } + } + } + } + } + } + } + if (argc == 10) { + int _v; + { + int res = SWIG_AsVal_int(argv[0], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[3], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_FLOAT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[7]) && PyArray_CanCastSafely(PyArray_TYPE(argv[7]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[8]) && PyArray_CanCastSafely(PyArray_TYPE(argv[8]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[9]) && PyArray_CanCastSafely(PyArray_TYPE(argv[9]),PyArray_FLOAT)) ? 1 : 0; + } + if (_v) { + return _wrap_bsr_transpose__SWIG_9(self, args); + } + } + } + } + } + } + } + } + } + } + } + if (argc == 10) { + int _v; + { + int res = SWIG_AsVal_int(argv[0], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[3], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_DOUBLE)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[7]) && PyArray_CanCastSafely(PyArray_TYPE(argv[7]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[8]) && PyArray_CanCastSafely(PyArray_TYPE(argv[8]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[9]) && PyArray_CanCastSafely(PyArray_TYPE(argv[9]),PyArray_DOUBLE)) ? 1 : 0; + } + if (_v) { + return _wrap_bsr_transpose__SWIG_10(self, args); + } + } + } + } + } + } + } + } + } + } + } + if (argc == 10) { + int _v; + { + int res = SWIG_AsVal_int(argv[0], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[3], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_LONGDOUBLE)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[7]) && PyArray_CanCastSafely(PyArray_TYPE(argv[7]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[8]) && PyArray_CanCastSafely(PyArray_TYPE(argv[8]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[9]) && PyArray_CanCastSafely(PyArray_TYPE(argv[9]),PyArray_LONGDOUBLE)) ? 1 : 0; + } + if (_v) { + return _wrap_bsr_transpose__SWIG_11(self, args); + } + } + } + } + } + } + } + } + } + } + } + if (argc == 10) { + int _v; + { + int res = SWIG_AsVal_int(argv[0], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[3], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_CFLOAT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[7]) && PyArray_CanCastSafely(PyArray_TYPE(argv[7]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[8]) && PyArray_CanCastSafely(PyArray_TYPE(argv[8]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[9]) && PyArray_CanCastSafely(PyArray_TYPE(argv[9]),PyArray_CFLOAT)) ? 1 : 0; + } + if (_v) { + return _wrap_bsr_transpose__SWIG_12(self, args); + } + } + } + } + } + } + } + } + } + } + } + if (argc == 10) { + int _v; + { + int res = SWIG_AsVal_int(argv[0], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[3], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_CDOUBLE)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[7]) && PyArray_CanCastSafely(PyArray_TYPE(argv[7]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[8]) && PyArray_CanCastSafely(PyArray_TYPE(argv[8]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[9]) && PyArray_CanCastSafely(PyArray_TYPE(argv[9]),PyArray_CDOUBLE)) ? 1 : 0; + } + if (_v) { + return _wrap_bsr_transpose__SWIG_13(self, args); + } + } + } + } + } + } + } + } + } + } + } + if (argc == 10) { + int _v; + { + int res = SWIG_AsVal_int(argv[0], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[3], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_CLONGDOUBLE)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[7]) && PyArray_CanCastSafely(PyArray_TYPE(argv[7]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[8]) && PyArray_CanCastSafely(PyArray_TYPE(argv[8]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[9]) && PyArray_CanCastSafely(PyArray_TYPE(argv[9]),PyArray_CLONGDOUBLE)) ? 1 : 0; + } + if (_v) { + return _wrap_bsr_transpose__SWIG_14(self, args); + } + } + } + } + } + } + } + } + } + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'bsr_transpose'.\n" + " Possible C/C++ prototypes are:\n" + " bsr_transpose< int,signed char >(int const,int const,int const,int const,int const [],int const [],signed char const [],int [],int [],signed char [])\n" + " bsr_transpose< int,unsigned char >(int const,int const,int const,int const,int const [],int const [],unsigned char const [],int [],int [],unsigned char [])\n" + " bsr_transpose< int,short >(int const,int const,int const,int const,int const [],int const [],short const [],int [],int [],short [])\n" + " bsr_transpose< int,unsigned short >(int const,int const,int const,int const,int const [],int const [],unsigned short const [],int [],int [],unsigned short [])\n" + " bsr_transpose< int,int >(int const,int const,int const,int const,int const [],int const [],int const [],int [],int [],int [])\n" + " bsr_transpose< int,unsigned int >(int const,int const,int const,int const,int const [],int const [],unsigned int const [],int [],int [],unsigned int [])\n" + " bsr_transpose< int,long long >(int const,int const,int const,int const,int const [],int const [],long long const [],int [],int [],long long [])\n" + " bsr_transpose< int,unsigned long long >(int const,int const,int const,int const,int const [],int const [],unsigned long long const [],int [],int [],unsigned long long [])\n" + " bsr_transpose< int,float >(int const,int const,int const,int const,int const [],int const [],float const [],int [],int [],float [])\n" + " bsr_transpose< int,double >(int const,int const,int const,int const,int const [],int const [],double const [],int [],int [],double [])\n" + " bsr_transpose< int,long double >(int const,int const,int const,int const,int const [],int const [],long double const [],int [],int [],long double [])\n" + " bsr_transpose< int,npy_cfloat_wrapper >(int const,int const,int const,int const,int const [],int const [],npy_cfloat_wrapper const [],int [],int [],npy_cfloat_wrapper [])\n" + " bsr_transpose< int,npy_cdouble_wrapper >(int const,int const,int const,int const,int const [],int const [],npy_cdouble_wrapper const [],int [],int [],npy_cdouble_wrapper [])\n" + " bsr_transpose< int,npy_clongdouble_wrapper >(int const,int const,int const,int const,int const [],int const [],npy_clongdouble_wrapper const [],int [],int [],npy_clongdouble_wrapper [])\n"); + return NULL; +} + + SWIGINTERN PyObject *_wrap_expandptr(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; int arg1 ; @@ -93200,6 +95892,1648 @@ } +SWIGINTERN PyObject *_wrap_bsr_sort_indices__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + int arg1 ; + int arg2 ; + int arg3 ; + int arg4 ; + int *arg5 ; + int *arg6 ; + signed char *arg7 ; + int val1 ; + int ecode1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + PyArrayObject *temp5 = NULL ; + PyArrayObject *temp6 = NULL ; + PyArrayObject *temp7 = NULL ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:bsr_sort_indices",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; + ecode1 = SWIG_AsVal_int(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "bsr_sort_indices" "', argument " "1"" of type '" "int""'"); + } + arg1 = static_cast< int >(val1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bsr_sort_indices" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "bsr_sort_indices" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "bsr_sort_indices" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + { + temp5 = obj_to_array_no_conversion(obj4,PyArray_INT); + if (!temp5 || !require_contiguous(temp5) || !require_native(temp5)) SWIG_fail; + arg5 = (int*) array_data(temp5); + } + { + temp6 = obj_to_array_no_conversion(obj5,PyArray_INT); + if (!temp6 || !require_contiguous(temp6) || !require_native(temp6)) SWIG_fail; + arg6 = (int*) array_data(temp6); + } + { + temp7 = obj_to_array_no_conversion(obj6,PyArray_BYTE); + if (!temp7 || !require_contiguous(temp7) || !require_native(temp7)) SWIG_fail; + arg7 = (signed char*) array_data(temp7); + } + bsr_sort_indices< int,signed char >(arg1,arg2,arg3,arg4,arg5,arg6,arg7); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_bsr_sort_indices__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + int arg1 ; + int arg2 ; + int arg3 ; + int arg4 ; + int *arg5 ; + int *arg6 ; + unsigned char *arg7 ; + int val1 ; + int ecode1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + PyArrayObject *temp5 = NULL ; + PyArrayObject *temp6 = NULL ; + PyArrayObject *temp7 = NULL ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:bsr_sort_indices",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; + ecode1 = SWIG_AsVal_int(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "bsr_sort_indices" "', argument " "1"" of type '" "int""'"); + } + arg1 = static_cast< int >(val1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bsr_sort_indices" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "bsr_sort_indices" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "bsr_sort_indices" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + { + temp5 = obj_to_array_no_conversion(obj4,PyArray_INT); + if (!temp5 || !require_contiguous(temp5) || !require_native(temp5)) SWIG_fail; + arg5 = (int*) array_data(temp5); + } + { + temp6 = obj_to_array_no_conversion(obj5,PyArray_INT); + if (!temp6 || !require_contiguous(temp6) || !require_native(temp6)) SWIG_fail; + arg6 = (int*) array_data(temp6); + } + { + temp7 = obj_to_array_no_conversion(obj6,PyArray_UBYTE); + if (!temp7 || !require_contiguous(temp7) || !require_native(temp7)) SWIG_fail; + arg7 = (unsigned char*) array_data(temp7); + } + bsr_sort_indices< int,unsigned char >(arg1,arg2,arg3,arg4,arg5,arg6,arg7); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_bsr_sort_indices__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + int arg1 ; + int arg2 ; + int arg3 ; + int arg4 ; + int *arg5 ; + int *arg6 ; + short *arg7 ; + int val1 ; + int ecode1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + PyArrayObject *temp5 = NULL ; + PyArrayObject *temp6 = NULL ; + PyArrayObject *temp7 = NULL ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:bsr_sort_indices",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; + ecode1 = SWIG_AsVal_int(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "bsr_sort_indices" "', argument " "1"" of type '" "int""'"); + } + arg1 = static_cast< int >(val1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bsr_sort_indices" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "bsr_sort_indices" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "bsr_sort_indices" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + { + temp5 = obj_to_array_no_conversion(obj4,PyArray_INT); + if (!temp5 || !require_contiguous(temp5) || !require_native(temp5)) SWIG_fail; + arg5 = (int*) array_data(temp5); + } + { + temp6 = obj_to_array_no_conversion(obj5,PyArray_INT); + if (!temp6 || !require_contiguous(temp6) || !require_native(temp6)) SWIG_fail; + arg6 = (int*) array_data(temp6); + } + { + temp7 = obj_to_array_no_conversion(obj6,PyArray_SHORT); + if (!temp7 || !require_contiguous(temp7) || !require_native(temp7)) SWIG_fail; + arg7 = (short*) array_data(temp7); + } + bsr_sort_indices< int,short >(arg1,arg2,arg3,arg4,arg5,arg6,arg7); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_bsr_sort_indices__SWIG_4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + int arg1 ; + int arg2 ; + int arg3 ; + int arg4 ; + int *arg5 ; + int *arg6 ; + unsigned short *arg7 ; + int val1 ; + int ecode1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + PyArrayObject *temp5 = NULL ; + PyArrayObject *temp6 = NULL ; + PyArrayObject *temp7 = NULL ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:bsr_sort_indices",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; + ecode1 = SWIG_AsVal_int(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "bsr_sort_indices" "', argument " "1"" of type '" "int""'"); + } + arg1 = static_cast< int >(val1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bsr_sort_indices" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "bsr_sort_indices" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "bsr_sort_indices" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + { + temp5 = obj_to_array_no_conversion(obj4,PyArray_INT); + if (!temp5 || !require_contiguous(temp5) || !require_native(temp5)) SWIG_fail; + arg5 = (int*) array_data(temp5); + } + { + temp6 = obj_to_array_no_conversion(obj5,PyArray_INT); + if (!temp6 || !require_contiguous(temp6) || !require_native(temp6)) SWIG_fail; + arg6 = (int*) array_data(temp6); + } + { + temp7 = obj_to_array_no_conversion(obj6,PyArray_USHORT); + if (!temp7 || !require_contiguous(temp7) || !require_native(temp7)) SWIG_fail; + arg7 = (unsigned short*) array_data(temp7); + } + bsr_sort_indices< int,unsigned short >(arg1,arg2,arg3,arg4,arg5,arg6,arg7); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_bsr_sort_indices__SWIG_5(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + int arg1 ; + int arg2 ; + int arg3 ; + int arg4 ; + int *arg5 ; + int *arg6 ; + int *arg7 ; + int val1 ; + int ecode1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + PyArrayObject *temp5 = NULL ; + PyArrayObject *temp6 = NULL ; + PyArrayObject *temp7 = NULL ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:bsr_sort_indices",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; + ecode1 = SWIG_AsVal_int(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "bsr_sort_indices" "', argument " "1"" of type '" "int""'"); + } + arg1 = static_cast< int >(val1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bsr_sort_indices" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "bsr_sort_indices" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "bsr_sort_indices" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + { + temp5 = obj_to_array_no_conversion(obj4,PyArray_INT); + if (!temp5 || !require_contiguous(temp5) || !require_native(temp5)) SWIG_fail; + arg5 = (int*) array_data(temp5); + } + { + temp6 = obj_to_array_no_conversion(obj5,PyArray_INT); + if (!temp6 || !require_contiguous(temp6) || !require_native(temp6)) SWIG_fail; + arg6 = (int*) array_data(temp6); + } + { + temp7 = obj_to_array_no_conversion(obj6,PyArray_INT); + if (!temp7 || !require_contiguous(temp7) || !require_native(temp7)) SWIG_fail; + arg7 = (int*) array_data(temp7); + } + bsr_sort_indices< int,int >(arg1,arg2,arg3,arg4,arg5,arg6,arg7); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_bsr_sort_indices__SWIG_6(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + int arg1 ; + int arg2 ; + int arg3 ; + int arg4 ; + int *arg5 ; + int *arg6 ; + unsigned int *arg7 ; + int val1 ; + int ecode1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + PyArrayObject *temp5 = NULL ; + PyArrayObject *temp6 = NULL ; + PyArrayObject *temp7 = NULL ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:bsr_sort_indices",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; + ecode1 = SWIG_AsVal_int(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "bsr_sort_indices" "', argument " "1"" of type '" "int""'"); + } + arg1 = static_cast< int >(val1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bsr_sort_indices" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "bsr_sort_indices" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "bsr_sort_indices" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + { + temp5 = obj_to_array_no_conversion(obj4,PyArray_INT); + if (!temp5 || !require_contiguous(temp5) || !require_native(temp5)) SWIG_fail; + arg5 = (int*) array_data(temp5); + } + { + temp6 = obj_to_array_no_conversion(obj5,PyArray_INT); + if (!temp6 || !require_contiguous(temp6) || !require_native(temp6)) SWIG_fail; + arg6 = (int*) array_data(temp6); + } + { + temp7 = obj_to_array_no_conversion(obj6,PyArray_UINT); + if (!temp7 || !require_contiguous(temp7) || !require_native(temp7)) SWIG_fail; + arg7 = (unsigned int*) array_data(temp7); + } + bsr_sort_indices< int,unsigned int >(arg1,arg2,arg3,arg4,arg5,arg6,arg7); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_bsr_sort_indices__SWIG_7(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + int arg1 ; + int arg2 ; + int arg3 ; + int arg4 ; + int *arg5 ; + int *arg6 ; + long long *arg7 ; + int val1 ; + int ecode1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + PyArrayObject *temp5 = NULL ; + PyArrayObject *temp6 = NULL ; + PyArrayObject *temp7 = NULL ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:bsr_sort_indices",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; + ecode1 = SWIG_AsVal_int(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "bsr_sort_indices" "', argument " "1"" of type '" "int""'"); + } + arg1 = static_cast< int >(val1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bsr_sort_indices" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "bsr_sort_indices" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "bsr_sort_indices" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + { + temp5 = obj_to_array_no_conversion(obj4,PyArray_INT); + if (!temp5 || !require_contiguous(temp5) || !require_native(temp5)) SWIG_fail; + arg5 = (int*) array_data(temp5); + } + { + temp6 = obj_to_array_no_conversion(obj5,PyArray_INT); + if (!temp6 || !require_contiguous(temp6) || !require_native(temp6)) SWIG_fail; + arg6 = (int*) array_data(temp6); + } + { + temp7 = obj_to_array_no_conversion(obj6,PyArray_LONGLONG); + if (!temp7 || !require_contiguous(temp7) || !require_native(temp7)) SWIG_fail; + arg7 = (long long*) array_data(temp7); + } + bsr_sort_indices< int,long long >(arg1,arg2,arg3,arg4,arg5,arg6,arg7); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_bsr_sort_indices__SWIG_8(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + int arg1 ; + int arg2 ; + int arg3 ; + int arg4 ; + int *arg5 ; + int *arg6 ; + unsigned long long *arg7 ; + int val1 ; + int ecode1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + PyArrayObject *temp5 = NULL ; + PyArrayObject *temp6 = NULL ; + PyArrayObject *temp7 = NULL ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:bsr_sort_indices",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; + ecode1 = SWIG_AsVal_int(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "bsr_sort_indices" "', argument " "1"" of type '" "int""'"); + } + arg1 = static_cast< int >(val1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bsr_sort_indices" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "bsr_sort_indices" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "bsr_sort_indices" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + { + temp5 = obj_to_array_no_conversion(obj4,PyArray_INT); + if (!temp5 || !require_contiguous(temp5) || !require_native(temp5)) SWIG_fail; + arg5 = (int*) array_data(temp5); + } + { + temp6 = obj_to_array_no_conversion(obj5,PyArray_INT); + if (!temp6 || !require_contiguous(temp6) || !require_native(temp6)) SWIG_fail; + arg6 = (int*) array_data(temp6); + } + { + temp7 = obj_to_array_no_conversion(obj6,PyArray_ULONGLONG); + if (!temp7 || !require_contiguous(temp7) || !require_native(temp7)) SWIG_fail; + arg7 = (unsigned long long*) array_data(temp7); + } + bsr_sort_indices< int,unsigned long long >(arg1,arg2,arg3,arg4,arg5,arg6,arg7); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_bsr_sort_indices__SWIG_9(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + int arg1 ; + int arg2 ; + int arg3 ; + int arg4 ; + int *arg5 ; + int *arg6 ; + float *arg7 ; + int val1 ; + int ecode1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + PyArrayObject *temp5 = NULL ; + PyArrayObject *temp6 = NULL ; + PyArrayObject *temp7 = NULL ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:bsr_sort_indices",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; + ecode1 = SWIG_AsVal_int(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "bsr_sort_indices" "', argument " "1"" of type '" "int""'"); + } + arg1 = static_cast< int >(val1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bsr_sort_indices" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "bsr_sort_indices" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "bsr_sort_indices" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + { + temp5 = obj_to_array_no_conversion(obj4,PyArray_INT); + if (!temp5 || !require_contiguous(temp5) || !require_native(temp5)) SWIG_fail; + arg5 = (int*) array_data(temp5); + } + { + temp6 = obj_to_array_no_conversion(obj5,PyArray_INT); + if (!temp6 || !require_contiguous(temp6) || !require_native(temp6)) SWIG_fail; + arg6 = (int*) array_data(temp6); + } + { + temp7 = obj_to_array_no_conversion(obj6,PyArray_FLOAT); + if (!temp7 || !require_contiguous(temp7) || !require_native(temp7)) SWIG_fail; + arg7 = (float*) array_data(temp7); + } + bsr_sort_indices< int,float >(arg1,arg2,arg3,arg4,arg5,arg6,arg7); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_bsr_sort_indices__SWIG_10(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + int arg1 ; + int arg2 ; + int arg3 ; + int arg4 ; + int *arg5 ; + int *arg6 ; + double *arg7 ; + int val1 ; + int ecode1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + PyArrayObject *temp5 = NULL ; + PyArrayObject *temp6 = NULL ; + PyArrayObject *temp7 = NULL ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:bsr_sort_indices",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; + ecode1 = SWIG_AsVal_int(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "bsr_sort_indices" "', argument " "1"" of type '" "int""'"); + } + arg1 = static_cast< int >(val1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bsr_sort_indices" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "bsr_sort_indices" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "bsr_sort_indices" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + { + temp5 = obj_to_array_no_conversion(obj4,PyArray_INT); + if (!temp5 || !require_contiguous(temp5) || !require_native(temp5)) SWIG_fail; + arg5 = (int*) array_data(temp5); + } + { + temp6 = obj_to_array_no_conversion(obj5,PyArray_INT); + if (!temp6 || !require_contiguous(temp6) || !require_native(temp6)) SWIG_fail; + arg6 = (int*) array_data(temp6); + } + { + temp7 = obj_to_array_no_conversion(obj6,PyArray_DOUBLE); + if (!temp7 || !require_contiguous(temp7) || !require_native(temp7)) SWIG_fail; + arg7 = (double*) array_data(temp7); + } + bsr_sort_indices< int,double >(arg1,arg2,arg3,arg4,arg5,arg6,arg7); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_bsr_sort_indices__SWIG_11(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + int arg1 ; + int arg2 ; + int arg3 ; + int arg4 ; + int *arg5 ; + int *arg6 ; + long double *arg7 ; + int val1 ; + int ecode1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + PyArrayObject *temp5 = NULL ; + PyArrayObject *temp6 = NULL ; + PyArrayObject *temp7 = NULL ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:bsr_sort_indices",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; + ecode1 = SWIG_AsVal_int(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "bsr_sort_indices" "', argument " "1"" of type '" "int""'"); + } + arg1 = static_cast< int >(val1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bsr_sort_indices" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "bsr_sort_indices" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "bsr_sort_indices" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + { + temp5 = obj_to_array_no_conversion(obj4,PyArray_INT); + if (!temp5 || !require_contiguous(temp5) || !require_native(temp5)) SWIG_fail; + arg5 = (int*) array_data(temp5); + } + { + temp6 = obj_to_array_no_conversion(obj5,PyArray_INT); + if (!temp6 || !require_contiguous(temp6) || !require_native(temp6)) SWIG_fail; + arg6 = (int*) array_data(temp6); + } + { + temp7 = obj_to_array_no_conversion(obj6,PyArray_LONGDOUBLE); + if (!temp7 || !require_contiguous(temp7) || !require_native(temp7)) SWIG_fail; + arg7 = (long double*) array_data(temp7); + } + bsr_sort_indices< int,long double >(arg1,arg2,arg3,arg4,arg5,arg6,arg7); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_bsr_sort_indices__SWIG_12(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + int arg1 ; + int arg2 ; + int arg3 ; + int arg4 ; + int *arg5 ; + int *arg6 ; + npy_cfloat_wrapper *arg7 ; + int val1 ; + int ecode1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + PyArrayObject *temp5 = NULL ; + PyArrayObject *temp6 = NULL ; + PyArrayObject *temp7 = NULL ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:bsr_sort_indices",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; + ecode1 = SWIG_AsVal_int(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "bsr_sort_indices" "', argument " "1"" of type '" "int""'"); + } + arg1 = static_cast< int >(val1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bsr_sort_indices" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "bsr_sort_indices" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "bsr_sort_indices" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + { + temp5 = obj_to_array_no_conversion(obj4,PyArray_INT); + if (!temp5 || !require_contiguous(temp5) || !require_native(temp5)) SWIG_fail; + arg5 = (int*) array_data(temp5); + } + { + temp6 = obj_to_array_no_conversion(obj5,PyArray_INT); + if (!temp6 || !require_contiguous(temp6) || !require_native(temp6)) SWIG_fail; + arg6 = (int*) array_data(temp6); + } + { + temp7 = obj_to_array_no_conversion(obj6,PyArray_CFLOAT); + if (!temp7 || !require_contiguous(temp7) || !require_native(temp7)) SWIG_fail; + arg7 = (npy_cfloat_wrapper*) array_data(temp7); + } + bsr_sort_indices< int,npy_cfloat_wrapper >(arg1,arg2,arg3,arg4,arg5,arg6,arg7); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_bsr_sort_indices__SWIG_13(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + int arg1 ; + int arg2 ; + int arg3 ; + int arg4 ; + int *arg5 ; + int *arg6 ; + npy_cdouble_wrapper *arg7 ; + int val1 ; + int ecode1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + PyArrayObject *temp5 = NULL ; + PyArrayObject *temp6 = NULL ; + PyArrayObject *temp7 = NULL ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:bsr_sort_indices",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; + ecode1 = SWIG_AsVal_int(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "bsr_sort_indices" "', argument " "1"" of type '" "int""'"); + } + arg1 = static_cast< int >(val1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bsr_sort_indices" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "bsr_sort_indices" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "bsr_sort_indices" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + { + temp5 = obj_to_array_no_conversion(obj4,PyArray_INT); + if (!temp5 || !require_contiguous(temp5) || !require_native(temp5)) SWIG_fail; + arg5 = (int*) array_data(temp5); + } + { + temp6 = obj_to_array_no_conversion(obj5,PyArray_INT); + if (!temp6 || !require_contiguous(temp6) || !require_native(temp6)) SWIG_fail; + arg6 = (int*) array_data(temp6); + } + { + temp7 = obj_to_array_no_conversion(obj6,PyArray_CDOUBLE); + if (!temp7 || !require_contiguous(temp7) || !require_native(temp7)) SWIG_fail; + arg7 = (npy_cdouble_wrapper*) array_data(temp7); + } + bsr_sort_indices< int,npy_cdouble_wrapper >(arg1,arg2,arg3,arg4,arg5,arg6,arg7); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_bsr_sort_indices__SWIG_14(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + int arg1 ; + int arg2 ; + int arg3 ; + int arg4 ; + int *arg5 ; + int *arg6 ; + npy_clongdouble_wrapper *arg7 ; + int val1 ; + int ecode1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + PyArrayObject *temp5 = NULL ; + PyArrayObject *temp6 = NULL ; + PyArrayObject *temp7 = NULL ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:bsr_sort_indices",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; + ecode1 = SWIG_AsVal_int(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "bsr_sort_indices" "', argument " "1"" of type '" "int""'"); + } + arg1 = static_cast< int >(val1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bsr_sort_indices" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "bsr_sort_indices" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "bsr_sort_indices" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + { + temp5 = obj_to_array_no_conversion(obj4,PyArray_INT); + if (!temp5 || !require_contiguous(temp5) || !require_native(temp5)) SWIG_fail; + arg5 = (int*) array_data(temp5); + } + { + temp6 = obj_to_array_no_conversion(obj5,PyArray_INT); + if (!temp6 || !require_contiguous(temp6) || !require_native(temp6)) SWIG_fail; + arg6 = (int*) array_data(temp6); + } + { + temp7 = obj_to_array_no_conversion(obj6,PyArray_CLONGDOUBLE); + if (!temp7 || !require_contiguous(temp7) || !require_native(temp7)) SWIG_fail; + arg7 = (npy_clongdouble_wrapper*) array_data(temp7); + } + bsr_sort_indices< int,npy_clongdouble_wrapper >(arg1,arg2,arg3,arg4,arg5,arg6,arg7); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_bsr_sort_indices(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[8]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = (int)PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 7); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 7) { + int _v; + { + int res = SWIG_AsVal_int(argv[0], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[3], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_BYTE)) ? 1 : 0; + } + if (_v) { + return _wrap_bsr_sort_indices__SWIG_1(self, args); + } + } + } + } + } + } + } + } + if (argc == 7) { + int _v; + { + int res = SWIG_AsVal_int(argv[0], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[3], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_UBYTE)) ? 1 : 0; + } + if (_v) { + return _wrap_bsr_sort_indices__SWIG_2(self, args); + } + } + } + } + } + } + } + } + if (argc == 7) { + int _v; + { + int res = SWIG_AsVal_int(argv[0], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[3], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_SHORT)) ? 1 : 0; + } + if (_v) { + return _wrap_bsr_sort_indices__SWIG_3(self, args); + } + } + } + } + } + } + } + } + if (argc == 7) { + int _v; + { + int res = SWIG_AsVal_int(argv[0], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[3], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_USHORT)) ? 1 : 0; + } + if (_v) { + return _wrap_bsr_sort_indices__SWIG_4(self, args); + } + } + } + } + } + } + } + } + if (argc == 7) { + int _v; + { + int res = SWIG_AsVal_int(argv[0], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[3], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + return _wrap_bsr_sort_indices__SWIG_5(self, args); + } + } + } + } + } + } + } + } + if (argc == 7) { + int _v; + { + int res = SWIG_AsVal_int(argv[0], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[3], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_UINT)) ? 1 : 0; + } + if (_v) { + return _wrap_bsr_sort_indices__SWIG_6(self, args); + } + } + } + } + } + } + } + } + if (argc == 7) { + int _v; + { + int res = SWIG_AsVal_int(argv[0], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[3], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_LONGLONG)) ? 1 : 0; + } + if (_v) { + return _wrap_bsr_sort_indices__SWIG_7(self, args); + } + } + } + } + } + } + } + } + if (argc == 7) { + int _v; + { + int res = SWIG_AsVal_int(argv[0], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[3], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_ULONGLONG)) ? 1 : 0; + } + if (_v) { + return _wrap_bsr_sort_indices__SWIG_8(self, args); + } + } + } + } + } + } + } + } + if (argc == 7) { + int _v; + { + int res = SWIG_AsVal_int(argv[0], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[3], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_FLOAT)) ? 1 : 0; + } + if (_v) { + return _wrap_bsr_sort_indices__SWIG_9(self, args); + } + } + } + } + } + } + } + } + if (argc == 7) { + int _v; + { + int res = SWIG_AsVal_int(argv[0], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[3], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_DOUBLE)) ? 1 : 0; + } + if (_v) { + return _wrap_bsr_sort_indices__SWIG_10(self, args); + } + } + } + } + } + } + } + } + if (argc == 7) { + int _v; + { + int res = SWIG_AsVal_int(argv[0], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[3], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_LONGDOUBLE)) ? 1 : 0; + } + if (_v) { + return _wrap_bsr_sort_indices__SWIG_11(self, args); + } + } + } + } + } + } + } + } + if (argc == 7) { + int _v; + { + int res = SWIG_AsVal_int(argv[0], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[3], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_CFLOAT)) ? 1 : 0; + } + if (_v) { + return _wrap_bsr_sort_indices__SWIG_12(self, args); + } + } + } + } + } + } + } + } + if (argc == 7) { + int _v; + { + int res = SWIG_AsVal_int(argv[0], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[3], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_CDOUBLE)) ? 1 : 0; + } + if (_v) { + return _wrap_bsr_sort_indices__SWIG_13(self, args); + } + } + } + } + } + } + } + } + if (argc == 7) { + int _v; + { + int res = SWIG_AsVal_int(argv[0], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[3], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + _v = (is_array(argv[4]) && PyArray_CanCastSafely(PyArray_TYPE(argv[4]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[5]) && PyArray_CanCastSafely(PyArray_TYPE(argv[5]),PyArray_INT)) ? 1 : 0; + } + if (_v) { + { + _v = (is_array(argv[6]) && PyArray_CanCastSafely(PyArray_TYPE(argv[6]),PyArray_CLONGDOUBLE)) ? 1 : 0; + } + if (_v) { + return _wrap_bsr_sort_indices__SWIG_14(self, args); + } + } + } + } + } + } + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'bsr_sort_indices'.\n" + " Possible C/C++ prototypes are:\n" + " bsr_sort_indices< int,signed char >(int const,int const,int const,int const,int [],int [],signed char [])\n" + " bsr_sort_indices< int,unsigned char >(int const,int const,int const,int const,int [],int [],unsigned char [])\n" + " bsr_sort_indices< int,short >(int const,int const,int const,int const,int [],int [],short [])\n" + " bsr_sort_indices< int,unsigned short >(int const,int const,int const,int const,int [],int [],unsigned short [])\n" + " bsr_sort_indices< int,int >(int const,int const,int const,int const,int [],int [],int [])\n" + " bsr_sort_indices< int,unsigned int >(int const,int const,int const,int const,int [],int [],unsigned int [])\n" + " bsr_sort_indices< int,long long >(int const,int const,int const,int const,int [],int [],long long [])\n" + " bsr_sort_indices< int,unsigned long long >(int const,int const,int const,int const,int [],int [],unsigned long long [])\n" + " bsr_sort_indices< int,float >(int const,int const,int const,int const,int [],int [],float [])\n" + " bsr_sort_indices< int,double >(int const,int const,int const,int const,int [],int [],double [])\n" + " bsr_sort_indices< int,long double >(int const,int const,int const,int const,int [],int [],long double [])\n" + " bsr_sort_indices< int,npy_cfloat_wrapper >(int const,int const,int const,int const,int [],int [],npy_cfloat_wrapper [])\n" + " bsr_sort_indices< int,npy_cdouble_wrapper >(int const,int const,int const,int const,int [],int [],npy_cdouble_wrapper [])\n" + " bsr_sort_indices< int,npy_clongdouble_wrapper >(int const,int const,int const,int const,int [],int [],npy_clongdouble_wrapper [])\n"); + return NULL; +} + + SWIGINTERN PyObject *_wrap_csr_eliminate_zeros__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; int arg1 ; @@ -101160,6 +105494,37 @@ " npy_clongdouble_wrapper Ax, int Bp, int Bj, \n" " npy_clongdouble_wrapper Bx)\n" ""}, + { (char *)"bsr_transpose", _wrap_bsr_transpose, METH_VARARGS, (char *)"\n" + "bsr_transpose(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, \n" + " signed char Ax, int Bp, int Bj, signed char Bx)\n" + "bsr_transpose(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, \n" + " unsigned char Ax, int Bp, int Bj, unsigned char Bx)\n" + "bsr_transpose(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, \n" + " short Ax, int Bp, int Bj, short Bx)\n" + "bsr_transpose(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, \n" + " unsigned short Ax, int Bp, int Bj, unsigned short Bx)\n" + "bsr_transpose(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, \n" + " int Ax, int Bp, int Bj, int Bx)\n" + "bsr_transpose(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, \n" + " unsigned int Ax, int Bp, int Bj, unsigned int Bx)\n" + "bsr_transpose(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, \n" + " long long Ax, int Bp, int Bj, long long Bx)\n" + "bsr_transpose(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, \n" + " unsigned long long Ax, int Bp, int Bj, unsigned long long Bx)\n" + "bsr_transpose(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, \n" + " float Ax, int Bp, int Bj, float Bx)\n" + "bsr_transpose(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, \n" + " double Ax, int Bp, int Bj, double Bx)\n" + "bsr_transpose(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, \n" + " long double Ax, int Bp, int Bj, long double Bx)\n" + "bsr_transpose(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, \n" + " npy_cfloat_wrapper Ax, int Bp, int Bj, npy_cfloat_wrapper Bx)\n" + "bsr_transpose(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, \n" + " npy_cdouble_wrapper Ax, int Bp, int Bj, npy_cdouble_wrapper Bx)\n" + "bsr_transpose(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, \n" + " npy_clongdouble_wrapper Ax, int Bp, int Bj, \n" + " npy_clongdouble_wrapper Bx)\n" + ""}, { (char *)"expandptr", _wrap_expandptr, METH_VARARGS, (char *)"expandptr(int n_row, int Ap, int Bi)"}, { (char *)"coo_tocsr", _wrap_coo_tocsr, METH_VARARGS, (char *)"\n" "coo_tocsr(int n_row, int n_col, int nnz, int Ai, int Aj, signed char Ax, \n" @@ -101998,6 +106363,36 @@ "csr_sort_indices(int n_row, int Ap, int Aj, npy_cdouble_wrapper Ax)\n" "csr_sort_indices(int n_row, int Ap, int Aj, npy_clongdouble_wrapper Ax)\n" ""}, + { (char *)"bsr_sort_indices", _wrap_bsr_sort_indices, METH_VARARGS, (char *)"\n" + "bsr_sort_indices(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, \n" + " signed char Ax)\n" + "bsr_sort_indices(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, \n" + " unsigned char Ax)\n" + "bsr_sort_indices(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, \n" + " short Ax)\n" + "bsr_sort_indices(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, \n" + " unsigned short Ax)\n" + "bsr_sort_indices(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, \n" + " int Ax)\n" + "bsr_sort_indices(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, \n" + " unsigned int Ax)\n" + "bsr_sort_indices(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, \n" + " long long Ax)\n" + "bsr_sort_indices(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, \n" + " unsigned long long Ax)\n" + "bsr_sort_indices(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, \n" + " float Ax)\n" + "bsr_sort_indices(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, \n" + " double Ax)\n" + "bsr_sort_indices(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, \n" + " long double Ax)\n" + "bsr_sort_indices(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, \n" + " npy_cfloat_wrapper Ax)\n" + "bsr_sort_indices(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, \n" + " npy_cdouble_wrapper Ax)\n" + "bsr_sort_indices(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, \n" + " npy_clongdouble_wrapper Ax)\n" + ""}, { (char *)"csr_eliminate_zeros", _wrap_csr_eliminate_zeros, METH_VARARGS, (char *)"\n" "csr_eliminate_zeros(int n_row, int n_col, int Ap, int Aj, signed char Ax)\n" "csr_eliminate_zeros(int n_row, int n_col, int Ap, int Aj, unsigned char Ax)\n" From scipy-svn at scipy.org Tue Mar 18 06:57:00 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Tue, 18 Mar 2008 05:57:00 -0500 (CDT) Subject: [Scipy-svn] r4034 - trunk/scipy/sparse Message-ID: <20080318105700.1507939C384@new.scipy.org> Author: wnbell Date: 2008-03-18 05:56:47 -0500 (Tue, 18 Mar 2008) New Revision: 4034 Modified: trunk/scipy/sparse/bsr.py Log: removed unused CSR code Modified: trunk/scipy/sparse/bsr.py =================================================================== --- trunk/scipy/sparse/bsr.py 2008-03-18 10:37:04 UTC (rev 4033) +++ trunk/scipy/sparse/bsr.py 2008-03-18 10:56:47 UTC (rev 4034) @@ -451,17 +451,6 @@ self.indptr, self.indices, self.data.ravel(), \ indptr, indices, data.ravel()) - ##use CSR.T to determine a permutation for BSR.T - #from csr import csr_matrix - #data = arange(len(self.indices), dtype=self.indices.dtype) - #proxy = csr_matrix((data,self.indices,self.indptr),shape=(M/R,N/C)) - #proxy = proxy.tocsc() - - #data = self.data.swapaxes(1,2)[proxy.data] #permute data - - #indices = proxy.indices - #indptr = proxy.indptr - return bsr_matrix( (data,indices,indptr), shape=(N,M) ) @@ -500,25 +489,11 @@ if self.has_sorted_indices: return - from csr import csr_matrix - R,C = self.blocksize M,N = self.shape - if self.nnz == 0: - return - bsr_sort_indices(M/R, N/C, R, C, self.indptr, self.indices, self.data.ravel()) - - ##use CSR.sort_indices to determine a permutation for BSR blocks - #data = arange(len(self.indices), dtype=self.indices.dtype) - #proxy = csr_matrix((data,self.indices,self.indptr),shape=(M/R,N/C)) - #proxy.sort_indices() - - #self.data[:] = self.data[proxy.data] - #self.indices[:] = proxy.indices - self.has_sorted_indices = True def prune(self): From scipy-svn at scipy.org Tue Mar 18 07:48:41 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Tue, 18 Mar 2008 06:48:41 -0500 (CDT) Subject: [Scipy-svn] r4035 - trunk/scipy/sparse/sparsetools Message-ID: <20080318114841.2364B39C310@new.scipy.org> Author: wnbell Date: 2008-03-18 06:48:06 -0500 (Tue, 18 Mar 2008) New Revision: 4035 Added: trunk/scipy/sparse/sparsetools/bsr.h trunk/scipy/sparse/sparsetools/coo.h trunk/scipy/sparse/sparsetools/csc.h trunk/scipy/sparse/sparsetools/csr.h trunk/scipy/sparse/sparsetools/dia.h trunk/scipy/sparse/sparsetools/scratch.h Modified: trunk/scipy/sparse/sparsetools/sparsetools.h trunk/scipy/sparse/sparsetools/sparsetools.i Log: split sparsetools into several files Added: trunk/scipy/sparse/sparsetools/bsr.h =================================================================== --- trunk/scipy/sparse/sparsetools/bsr.h 2008-03-18 10:56:47 UTC (rev 4034) +++ trunk/scipy/sparse/sparsetools/bsr.h 2008-03-18 11:48:06 UTC (rev 4035) @@ -0,0 +1,721 @@ +#ifndef __BSR_H__ +#define __BSR_H__ + +#include +#include +#include + +#include "csr.h" +#include "fixed_size.h" + + +template +void bsr_diagonal(const I n_brow, + const I n_bcol, + const I R, + const I C, + const I Ap[], + const I Aj[], + const T Ax[], + T Yx[]) +{ + const I N = std::min(R*n_brow, C*n_bcol); + const I RC = R*C; + + for(I i = 0; i < N; i++){ + Yx[i] = 0; + } + + if ( R == C ){ + //main diagonal with square blocks + const I end = std::min(n_brow,n_bcol); + for(I i = 0; i < end; i++){ + for(I jj = Ap[i]; jj < Ap[i+1]; jj++){ + if (i == Aj[jj]){ + I row = R*i; + const T * val = Ax + RC*jj; + for(I bi = 0; bi < R; bi++){ + Yx[row + bi] = *val; + val += C + 1; + } + } + } + } + } + else + { + //This could be made faster + const I end = (N/R) + (N % R == 0 ? 0 : 1); + for(I i = 0; i < end; i++){ + for(I jj = Ap[i]; jj < Ap[i+1]; jj++){ + const I base_row = R*i; + const I base_col = C*Aj[jj]; + const T * base_val = Ax + RC*jj; + + for(I bi = 0; bi < R; bi++){ + const I row = base_row + bi; + if (row >= N) break; + + for(I bj = 0; bj < C; bj++){ + const I col = base_col + bj; + if (row == col){ + Yx[row] = base_val[bi*C + bj]; + } + } + } + } + } + } +} + + + +/* + * Scale the rows of a BSR matrix *in place* + * + * A[i,:] *= X[i] + * + */ +template +void bsr_scale_rows(const I n_brow, + const I n_bcol, + const I R, + const I C, + const I Ap[], + const I Aj[], + T Ax[], + const T Xx[]) +{ + const I RC = R*C; + for(I i = 0; i < n_brow; i++){ + for(I jj = Ap[i]; jj < Ap[i+1]; jj++){ + for(I bi = 0; bi < R; bi++){ + const T s = Xx[R*i + bi]; + T * block_row = Ax + RC*jj + C*bi; + + for(I bj = 0; bj < C; bj++){ + block_row[bj] *= s; + } + + } + } + } +} + +/* + * Scale the columns of a BSR matrix *in place* + * + * A[:,i] *= X[i] + * + */ +template +void bsr_scale_columns(const I n_brow, + const I n_bcol, + const I R, + const I C, + const I Ap[], + const I Aj[], + T Ax[], + const T Xx[]) +{ + const I bnnz = Ap[n_brow]; + const I RC = R*C; + for(I i = 0; i < bnnz; i++){ + const T * scales = Xx + C*Aj[i] ; + T * block = Ax + RC*i; + + for(I bi = 0; bi < R; bi++){ + for(I bj = 0; bj < C; bj++){ + block[C*bi + bj] *= scales[bj]; + } + } + + } +} + + + +/* + * Sort the column block indices of a BSR matrix inplace + * + * Input Arguments: + * I n_brow - number of row blocks in A + * I n_bcol - number of column blocks in A + * I R - rows per block + * I C - columns per block + * I Ap[n_brow+1] - row pointer + * I Aj[nblk(A)] - column indices + * T Ax[nnz(A)] - nonzeros + * + */ +template +void bsr_sort_indices(const I n_brow, + const I n_bcol, + const I R, + const I C, + I Ap[], + I Aj[], + T Ax[]) +{ + if( R == 1 && C == 1 ){ + csr_sort_indices(n_brow, Ap, Aj, Ax); + return; + } + + + const I nblks = Ap[n_brow]; + const I RC = R*C; + const I nnz = RC*nblks; + + //compute permutation of blocks using tranpose(CSR) + std::vector perm(nblks); + + for(I i = 0; i < nblks; i++) + perm[i] = i; + + csr_sort_indices(n_brow, Ap, Aj, &perm[0]); + + std::vector Ax_copy(nnz); + std::copy(Ax, Ax + nnz, Ax_copy.begin()); + + for(I i = 0; i < nblks; i++){ + const T * input = &Ax_copy[RC * perm[i]]; + T * output = Ax + RC*i; + std::copy(input, input + RC, output); + } +} + + +/* + * Compute transpose(A) BSR matrix A + * + * Input Arguments: + * I n_brow - number of row blocks in A + * I n_bcol - number of column blocks in A + * I R - rows per block + * I C - columns per block + * I Ap[n_brow+1] - row pointer + * I Aj[nblk(A)] - column indices + * T Ax[nnz(A)] - nonzeros + * + * Output Arguments: + * I Bp[n_col+1] - row pointer + * I Bj[nblk(A)] - column indices + * T Bx[nnz(A)] - nonzeros + * + * Note: + * Output arrays Bp, Bj, Bx must be preallocated + * + * Note: + * Input: column indices *are not* assumed to be in sorted order + * Output: row indices *will be* in sorted order + * + * Complexity: Linear. Specifically O(nnz(A) + max(n_row,n_col)) + * + */ +template +void bsr_transpose(const I n_brow, + const I n_bcol, + const I R, + const I C, + const I Ap[], + const I Aj[], + const T Ax[], + I Bp[], + I Bj[], + T Bx[]) +{ + const I nblks = Ap[n_brow]; + const I RC = R*C; + + //compute permutation of blocks using tranpose(CSR) + std::vector perm_in (nblks); + std::vector perm_out(nblks); + + for(I i = 0; i < nblks; i++) + perm_in[i] = i; + + csr_tocsc(n_brow, n_bcol, Ap, Aj, &perm_in[0], Bp, Bj, &perm_out[0]); + + for(I i = 0; i < nblks; i++){ + const T * Ax_blk = Ax + RC * perm_out[i]; + T * Bx_blk = Bx + RC * i; + for(I r = 0; r < R; r++){ + for(I c = 0; c < C; c++){ + Bx_blk[c * R + r] = Ax_blk[r * C + c]; + } + } + } +} + + +template +void bsr_matmat_pass2_fixed(const I n_brow, const I n_bcol, + const I Ap[], const I Aj[], const T Ax[], + const I Bp[], const I Bj[], const T Bx[], + I Cp[], I Cj[], T Cx[]) +{ + const I RC = R*C; + const I RN = R*N; + const I NC = N*C; + const I SIZE = RC*Cp[n_brow]; + + for(I i = 0; i < SIZE; i++){ + Cx[i] = 0; + } + + std::vector next(n_bcol,-1); + std::vector mats(n_bcol); + + + I nnz = 0; + + Cp[0] = 0; + + for(I i = 0; i < n_brow; i++){ + I head = -2; + I length = 0; + + I jj_start = Ap[i]; + I jj_end = Ap[i+1]; + for(I jj = jj_start; jj < jj_end; jj++){ + I j = Aj[jj]; + + I kk_start = Bp[j]; + I kk_end = Bp[j+1]; + for(I kk = kk_start; kk < kk_end; kk++){ + I k = Bj[kk]; + + if(next[k] == -1){ + next[k] = head; + head = k; + Cj[nnz] = k; + mats[k] = Cx + RC*nnz; + nnz++; + length++; + } + + const T * A = Ax + jj*RN; + const T * B = Bx + kk*NC; + T * result = mats[k]; + matmat(A,B,result); + } + } + + for(I jj = 0; jj < length; jj++){ + I temp = head; + head = next[head]; + next[temp] = -1; //clear arrays + } + + } + +} + + +template +void bsr_matmat_pass2(const I n_brow, const I n_bcol, + const I R, const I C, const I N, + const I Ap[], const I Aj[], const T Ax[], + const I Bp[], const I Bj[], const T Bx[], + I Cp[], I Cj[], T Cx[]) +{ + assert(R > 0 && C > 0 && N > 0); + +#ifdef SPARSETOOLS_TESTING +#define F(X,Y,Z) bsr_matmat_pass2_fixed + + void (*dispatch[4][4][4])(I,I,const I*,const I*,const T*, + const I*,const I*,const T*, + I*, I*, T*) = \ + { + { { F(1,1,1), F(1,1,2), F(1,1,3), F(1,1,4) }, + { F(1,2,1), F(1,2,2), F(1,2,3), F(1,2,4) }, + { F(1,3,1), F(1,3,2), F(1,3,3), F(1,3,4) }, + { F(1,4,1), F(1,4,2), F(1,4,3), F(1,4,4) }, + }, + { { F(2,1,1), F(2,1,2), F(2,1,3), F(2,1,4) }, + { F(2,2,1), F(2,2,2), F(2,2,3), F(2,2,4) }, + { F(2,3,1), F(2,3,2), F(2,3,3), F(2,3,4) }, + { F(2,4,1), F(2,4,2), F(2,4,3), F(2,4,4) }, + }, + { { F(3,1,1), F(3,1,2), F(3,1,3), F(3,1,4) }, + { F(3,2,1), F(3,2,2), F(3,2,3), F(3,2,4) }, + { F(3,3,1), F(3,3,2), F(3,3,3), F(3,3,4) }, + { F(3,4,1), F(3,4,2), F(3,4,3), F(3,4,4) }, + }, + { { F(4,1,1), F(4,1,2), F(4,1,3), F(4,1,4) }, + { F(4,2,1), F(4,2,2), F(4,2,3), F(4,2,4) }, + { F(4,3,1), F(4,3,2), F(4,3,3), F(4,3,4) }, + { F(4,4,1), F(4,4,2), F(4,4,3), F(4,4,4) }, + } + }; + + if (R <= 4 && C <= 4 && N <= 4){ + dispatch[R-1][N-1][C-1](n_brow,n_bcol,Ap,Aj,Ax,Bp,Bj,Bx,Cp,Cj,Cx); + return; + } + +#undef F +#endif + + if( R == 1 && N == 1 && C == 1 ){ + csr_matmat_pass2(n_brow, n_bcol, Ap, Aj, Ax, Bp, Bj, Bx, Cp, Cj, Cx); + return; + } + + const I RC = R*C; + const I RN = R*N; + const I NC = N*C; + const I SIZE = RC*Cp[n_brow]; + + + for(I i = 0; i < SIZE; i++){ + Cx[i] = 0; + } + + std::vector next(n_bcol,-1); + std::vector mats(n_bcol); + + I nnz = 0; + Cp[0] = 0; + + for(I i = 0; i < n_brow; i++){ + I head = -2; + I length = 0; + + I jj_start = Ap[i]; + I jj_end = Ap[i+1]; + for(I jj = jj_start; jj < jj_end; jj++){ + I j = Aj[jj]; + + I kk_start = Bp[j]; + I kk_end = Bp[j+1]; + for(I kk = kk_start; kk < kk_end; kk++){ + I k = Bj[kk]; + + if(next[k] == -1){ + next[k] = head; + head = k; + Cj[nnz] = k; + mats[k] = Cx + RC*nnz; + nnz++; + length++; + } + + const T * A = Ax + jj*RN; + const T * B = Bx + kk*NC; + T * result = mats[k]; + for(I r = 0; r < R; r++){ + for(I c = 0; c < C; c++){ + for(I n = 0; n < N; n++){ + result[C*r + c] += A[N*r + n] * B[C*n + c]; + + } + } + } + } + } + + for(I jj = 0; jj < length; jj++){ + I temp = head; + head = next[head]; + next[temp] = -1; //clear arrays + } + + } +} + + + + +template +bool is_nonzero_block(const T block[], const I blocksize){ + for(I i = 0; i < blocksize; i++){ + if(block[i] != 0){ + return true; + } + } + return false; +} + + + +template +void bsr_binop_bsr(const I n_brow, const I n_bcol, + const I R, const I C, + const I Ap[], const I Aj[], const T Ax[], + const I Bp[], const I Bj[], const T Bx[], + I Cp[], I Cj[], T Cx[], + const bin_op& op) +{ + assert( R > 0 && C > 0); + + if( R == 1 && C == 1 ){ + csr_binop_csr(n_brow, n_bcol, Ap, Aj, Ax, Bp, Bj, Bx, Cp, Cj, Cx, op); //use CSR for 1x1 blocksize + return; + } + + const I RC = R*C; + T * result = Cx; + + Cp[0] = 0; + I nnz = 0; + + for(I i = 0; i < n_brow; i++){ + I A_pos = Ap[i]; + I B_pos = Bp[i]; + I A_end = Ap[i+1]; + I B_end = Bp[i+1]; + + I A_j = Aj[A_pos]; + I B_j = Bj[B_pos]; + + //while not finished with either row + while(A_pos < A_end && B_pos < B_end){ + if(A_j == B_j){ + for(I n = 0; n < RC; n++){ + result[n] = op(Ax[RC*A_pos + n],Bx[RC*B_pos + n]); + } + + if( is_nonzero_block(result,RC) ){ + Cj[nnz] = A_j; + result += RC; + nnz++; + } + + A_j = Aj[++A_pos]; + B_j = Bj[++B_pos]; + + } else if (A_j < B_j) { + for(I n = 0; n < RC; n++){ + result[n] = op(Ax[RC*A_pos + n],0); + } + + if(is_nonzero_block(result,RC)){ + Cj[nnz] = A_j; + result += RC; + nnz++; + } + + A_j = Aj[++A_pos]; + + } else { + //B_j < A_j + for(I n = 0; n < RC; n++){ + result[n] = op(0,Bx[RC*B_pos + n]); + } + if(is_nonzero_block(result,RC)){ + Cj[nnz] = B_j; + result += RC; + nnz++; + } + + B_j = Bj[++B_pos]; + + } + } + + //tail + while(A_pos < A_end){ + + for(I n = 0; n < RC; n++){ + result[n] = op(Ax[RC*A_pos + n],0); + } + + if(is_nonzero_block(result,RC)){ + Cj[nnz] = A_j; + result += RC; + nnz++; + } + + A_j = Aj[++A_pos]; + + } + while(B_pos < B_end){ + for(I n = 0; n < RC; n++){ + result[n] = op(0,Bx[RC*B_pos + n]); + } + + if(is_nonzero_block(result,RC)){ + Cj[nnz] = B_j; + result += RC; + nnz++; + } + + B_j = Bj[++B_pos]; + + } + + Cp[i+1] = nnz; + } +} + +/* element-wise binary operations */ +template +void bsr_elmul_bsr(const I n_row, const I n_col, const I R, const I C, + const I Ap[], const I Aj[], const T Ax[], + const I Bp[], const I Bj[], const T Bx[], + I Cp[], I Cj[], T Cx[]) +{ + bsr_binop_bsr(n_row,n_col,R,C,Ap,Aj,Ax,Bp,Bj,Bx,Cp,Cj,Cx,std::multiplies()); +} + +template +void bsr_eldiv_bsr(const I n_row, const I n_col, const I R, const I C, + const I Ap[], const I Aj[], const T Ax[], + const I Bp[], const I Bj[], const T Bx[], + I Cp[], I Cj[], T Cx[]) +{ + bsr_binop_bsr(n_row,n_col,R,C,Ap,Aj,Ax,Bp,Bj,Bx,Cp,Cj,Cx,std::divides()); +} + + +template +void bsr_plus_bsr(const I n_row, const I n_col, const I R, const I C, + const I Ap[], const I Aj[], const T Ax[], + const I Bp[], const I Bj[], const T Bx[], + I Cp[], I Cj[], T Cx[]) +{ + bsr_binop_bsr(n_row,n_col,R,C,Ap,Aj,Ax,Bp,Bj,Bx,Cp,Cj,Cx,std::plus()); +} + +template +void bsr_minus_bsr(const I n_row, const I n_col, const I R, const I C, + const I Ap[], const I Aj[], const T Ax[], + const I Bp[], const I Bj[], const T Bx[], + I Cp[], I Cj[], T Cx[]) +{ + bsr_binop_bsr(n_row,n_col,R,C,Ap,Aj,Ax,Bp,Bj,Bx,Cp,Cj,Cx,std::minus()); +} + + + + + +//template +//void bsr_tocsr(const I n_brow, +// const I n_bcol, +// const I R, +// const I C, +// const I Ap[], +// const I Aj[], +// const T Ax[], +// I Bp[], +// I Bj[] +// T Bx[]) +//{ +// const I RC = R*C; +// +// for(I brow = 0; brow < n_brow; brow++){ +// I row_size = C * (Ap[brow + 1] - Ap[brow]); +// for(I r = 0; r < R; r++){ +// Bp[R*brow + r] = RC * Ap[brow] + r * row_size +// } +// } +//} + +template +void bsr_matvec_fixed(const I n_brow, + const I n_bcol, + const I Ap[], + const I Aj[], + const T Ax[], + const T Xx[], + T Yx[]) +{ + for(I i = 0; i < R*n_brow; i++){ + Yx[i] = 0; + } + + for(I i = 0; i < n_brow; i++) { + for(I jj = Ap[i]; jj < Ap[i+1]; jj++) { + I j = Aj[jj]; + matvec(Ax + jj*R*C, Xx + j*C, Yx + i*R); + } + } +} + +/* + * Generate the table below with: + * out = '' + * N = 8 + * for i in range(N): + * out += '{' + * for j in range(N-1): + * out += ' F(%d,%d),' % (i+1,j+1) + * out += ' F(%d,%d) },\n' % (i+1,j+2) + * out = out[:-2] + * + */ + + +template +void bsr_matvec(const I n_brow, + const I n_bcol, + const I R, + const I C, + const I Ap[], + const I Aj[], + const T Ax[], + const T Xx[], + T Yx[]) +{ + assert(R > 0 && C > 0); + + if( R == 1 && C == 1 ){ + csr_matvec(n_brow, n_bcol, Ap, Aj, Ax, Xx, Yx); //use CSR for 1x1 blocksize + return; + } + +#ifdef SPARSETOOLS_TESTING +#define F(X,Y) bsr_matvec_fixed + + void (*dispatch[8][8])(I,I,const I*,const I*,const T*,const T*,T*) = \ + { + { F(1,1), F(1,2), F(1,3), F(1,4), F(1,5), F(1,6), F(1,7), F(1,8) }, + { F(2,1), F(2,2), F(2,3), F(2,4), F(2,5), F(2,6), F(2,7), F(2,8) }, + { F(3,1), F(3,2), F(3,3), F(3,4), F(3,5), F(3,6), F(3,7), F(3,8) }, + { F(4,1), F(4,2), F(4,3), F(4,4), F(4,5), F(4,6), F(4,7), F(4,8) }, + { F(5,1), F(5,2), F(5,3), F(5,4), F(5,5), F(5,6), F(5,7), F(5,8) }, + { F(6,1), F(6,2), F(6,3), F(6,4), F(6,5), F(6,6), F(6,7), F(6,8) }, + { F(7,1), F(7,2), F(7,3), F(7,4), F(7,5), F(7,6), F(7,7), F(7,8) }, + { F(8,1), F(8,2), F(8,3), F(8,4), F(8,5), F(8,6), F(8,7), F(8,8) } + }; + + if (R <= 8 && C <= 8){ + dispatch[R-1][C-1](n_brow,n_bcol,Ap,Aj,Ax,Xx,Yx); + return; + } + +#undef F +#endif + + //otherwise use general method + + for(I i = 0; i < R*n_brow; i++){ + Yx[i] = 0; + } + + for(I i = 0; i < n_brow; i++){ + const T * A = Ax + R * C * Ap[i]; + T * y = Yx + R * i; + for(I jj = Ap[i]; jj < Ap[i+1]; jj++){ + const T * x = Xx + C*Aj[jj]; + + //TODO replace this with a proper matvec + for( I r = 0; r < R; r++ ){ + T sum = 0; + for( I c = 0; c < C; c++ ){ + sum += (*A) * x[c]; + A++; + } + y[r] += sum; + } + + } + } +} + + +#endif Added: trunk/scipy/sparse/sparsetools/coo.h =================================================================== --- trunk/scipy/sparse/sparsetools/coo.h 2008-03-18 10:56:47 UTC (rev 4034) +++ trunk/scipy/sparse/sparsetools/coo.h 2008-03-18 11:48:06 UTC (rev 4035) @@ -0,0 +1,109 @@ +#ifndef __COO_H__ +#define __COO_H__ + +#include + +/* + * Compute B = A for COO matrix A, CSR matrix B + * + * + * Input Arguments: + * I n_row - number of rows in A + * I n_col - number of columns in A + * I nnz - number of nonzeros in A + * I Ai[nnz(A)] - row indices + * I Aj[nnz(A)] - column indices + * T Ax[nnz(A)] - nonzeros + * Output Arguments: + * I Bp - row pointer + * I Bj - column indices + * T Bx - nonzeros + * + * Note: + * Output arrays Bp, Bj, and Bx must be preallocated + * + * Note: + * Input: row and column indices *are not* assumed to be ordered + * + * Note: duplicate entries are carried over to the CSR represention + * + * Complexity: Linear. Specifically O(nnz(A) + max(n_row,n_col)) + * + */ +template +void coo_tocsr(const I n_row, + const I n_col, + const I nnz, + const I Ai[], + const I Aj[], + const T Ax[], + I Bp[], + I Bj[], + T Bx[]) +{ + //compute number of non-zero entries per row of A + std::fill(Bp, Bp + n_row, 0); + + for (I n = 0; n < nnz; n++){ + Bp[Ai[n]]++; + } + + //cumsum the nnz per row to get Bp[] + for(I i = 0, cumsum = 0; i < n_row; i++){ + I temp = Bp[i]; + Bp[i] = cumsum; + cumsum += temp; + } + Bp[n_row] = nnz; + + //write Aj,Ax into Bj,Bx + for(I n = 0; n < nnz; n++){ + I row = Ai[n]; + I dest = Bp[row]; + + Bj[dest] = Aj[n]; + Bx[dest] = Ax[n]; + + Bp[row]++; + } + + for(I i = 0, last = 0; i <= n_row; i++){ + I temp = Bp[i]; + Bp[i] = last; + last = temp; + } + + //now Bp,Bj,Bx form a CSR representation (with possible duplicates) +} + + +/* + * Compute B += A for COO matrix A, dense matrix B + * + * Input Arguments: + * I n_row - number of rows in A + * I n_col - number of columns in A + * I nnz - number of nonzeros in A + * I Ai[nnz(A)] - row indices + * I Aj[nnz(A)] - column indices + * T Ax[nnz(A)] - nonzeros + * T Bx[n_row*n_col] - dense matrix + * + */ +template +void coo_todense(const I n_row, + const I n_col, + const I nnz, + const I Ai[], + const I Aj[], + const T Ax[], + T Bx[]) +{ + for(I n = 0; n < nnz; n++){ + Bx[ n_col * Ai[n] + Aj[n] ] += Ax[n]; + } +} + + + +#endif Added: trunk/scipy/sparse/sparsetools/csc.h =================================================================== --- trunk/scipy/sparse/sparsetools/csc.h 2008-03-18 10:56:47 UTC (rev 4034) +++ trunk/scipy/sparse/sparsetools/csc.h 2008-03-18 11:48:06 UTC (rev 4035) @@ -0,0 +1,153 @@ +#ifndef __CSC_H__ +#define __CSC_H__ + + +#include "csr.h" + + +/* + * Compute Y += A*X for CSC matrix A and dense vectors X,Y + * + * + * Input Arguments: + * I n_row - number of rows in A + * I n_col - number of columns in A + * I Ap[n_row+1] - column pointer + * I Ai[nnz(A)] - row indices + * T Ax[n_col] - nonzeros + * T Xx[n_col] - input vector + * + * Output Arguments: + * T Yx[n_row] - output vector + * + * Note: + * Output array Yx must be preallocated + * + * Complexity: Linear. Specifically O(nnz(A) + n_col) + * + */ +template +void csc_matvec(const I n_row, + const I n_col, + const I Ap[], + const I Ai[], + const T Ax[], + const T Xx[], + T Yx[]) +{ + for(I j = 0; j < n_col; j++){ + I col_start = Ap[j]; + I col_end = Ap[j+1]; + + for(I ii = col_start; ii < col_end; ii++){ + I row = Ai[ii]; + Yx[row] += Ax[ii] * Xx[j]; + } + } +} + + +/* + * Derived methods + */ +template +void csc_diagonal(const I n_row, + const I n_col, + const I Ap[], + const I Aj[], + const T Ax[], + T Yx[]) +{ csr_diagonal(n_col, n_row, Ap, Aj, Ax, Yx); } + + +template +void csc_tocsr(const I n_row, + const I n_col, + const I Ap[], + const I Ai[], + const T Ax[], + I Bp[], + I Bj[], + T Bx[]) +{ csr_tocsc(n_col, n_row, Ap, Ai, Ax, Bp, Bj, Bx); } + + +template +void csc_matmat_pass1(const I n_row, + const I n_col, + const I Ap[], + const I Ai[], + const I Bp[], + const I Bi[], + I Cp[]) +{ csr_matmat_pass1(n_col, n_row, Bp, Bi, Ap, Ai, Cp); } + +template +void csc_matmat_pass2(const I n_row, + const I n_col, + const I Ap[], + const I Ai[], + const T Ax[], + const I Bp[], + const I Bi[], + const T Bx[], + I Cp[], + I Ci[], + T Cx[]) +{ csr_matmat_pass2(n_col, n_row, Bp, Bi, Bx, Ap, Ai, Ax, Cp, Ci, Cx); } + + +template +void coo_tocsc(const I n_row, + const I n_col, + const I nnz, + const I Ai[], + const I Aj[], + const T Ax[], + I Bp[], + I Bi[], + T Bx[]) +{ coo_tocsr(n_col, n_row, nnz, Aj, Ai, Ax, Bp, Bi, Bx); } + + + +template +void csc_elmul_csc(const I n_row, const I n_col, + const I Ap[], const I Ai[], const T Ax[], + const I Bp[], const I Bi[], const T Bx[], + I Cp[], I Ci[], T Cx[]) +{ + csr_elmul_csr(n_col, n_row, Ap, Ai, Ax, Bp, Bi, Bx, Cp, Ci, Cx); +} + +template +void csc_eldiv_csc(const I n_row, const I n_col, + const I Ap[], const I Ai[], const T Ax[], + const I Bp[], const I Bi[], const T Bx[], + I Cp[], I Ci[], T Cx[]) +{ + csr_eldiv_csr(n_col, n_row, Ap, Ai, Ax, Bp, Bi, Bx, Cp, Ci, Cx); +} + + +template +void csc_plus_csc(const I n_row, const I n_col, + const I Ap[], const I Ai[], const T Ax[], + const I Bp[], const I Bi[], const T Bx[], + I Cp[], I Ci[], T Cx[]) +{ + csr_plus_csr(n_col, n_row, Ap, Ai, Ax, Bp, Bi, Bx, Cp, Ci, Cx); +} + +template +void csc_minus_csc(const I n_row, const I n_col, + const I Ap[], const I Ai[], const T Ax[], + const I Bp[], const I Bi[], const T Bx[], + I Cp[], I Ci[], T Cx[]) +{ + csr_minus_csr(n_col, n_row, Ap, Ai, Ax, Bp, Bi, Bx, Cp, Ci, Cx); +} + + + +#endif Added: trunk/scipy/sparse/sparsetools/csr.h =================================================================== --- trunk/scipy/sparse/sparsetools/csr.h 2008-03-18 10:56:47 UTC (rev 4034) +++ trunk/scipy/sparse/sparsetools/csr.h 2008-03-18 11:48:06 UTC (rev 4035) @@ -0,0 +1,914 @@ +#ifndef __CSR_H__ +#define __CSR_H__ + +#include +#include +#include + +/* + * Extract main diagonal of CSR matrix A + * + * Input Arguments: + * I n_row - number of rows in A + * I n_col - number of columns in A + * I Ap[n_row+1] - row pointer + * I Aj[nnz(A)] - column indices + * T Ax[n_col] - nonzeros + * + * Output Arguments: + * T Yx[min(n_row,n_col)] - diagonal entries + * + * Note: + * Output array Yx must be preallocated + * + * Duplicate entries will be summed. + * + * Complexity: Linear. Specifically O(nnz(A) + min(n_row,n_col)) + * + */ +template +void csr_diagonal(const I n_row, + const I n_col, + const I Ap[], + const I Aj[], + const T Ax[], + T Yx[]) +{ + const I N = std::min(n_row, n_col); + + for(I i = 0; i < N; i++){ + I row_start = Ap[i]; + I row_end = Ap[i+1]; + + T diag = 0; + for(I jj = row_start; jj < row_end; jj++){ + if (Aj[jj] == i) + diag += Ax[jj]; + } + + Yx[i] = diag; + } +} + + +/* + * Expand a compressed row pointer into a row array + * + * Input Arguments: + * I n_row - number of rows in A + * I Ap[n_row+1] - row pointer + * + * Output Arguments: + * Bi - row indices + * + * Note: + * Output array Bi must be preallocated + * + * Note: + * Complexity: Linear + * + */ +template +void expandptr(const I n_row, + const I Ap[], + I Bi[]) +{ + for(I i = 0; i < n_row; i++){ + for(I jj = Ap[i]; jj < Ap[i+1]; jj++){ + Bi[jj] = i; + } + } +} + +/* + * Scale the rows of a CSR matrix *in place* + * + * A[i,:] *= X[i] + * + */ +template +void csr_scale_rows(const I n_row, + const I n_col, + const I Ap[], + const I Aj[], + T Ax[], + const T Xx[]) +{ + for(I i = 0; i < n_row; i++){ + for(I jj = Ap[i]; jj < Ap[i+1]; jj++){ + Ax[jj] *= Xx[i]; + } + } +} + +/* + * Scale the columns of a CSR matrix *in place* + * + * A[:,i] *= X[i] + * + */ +template +void csr_scale_columns(const I n_row, + const I n_col, + const I Ap[], + const I Aj[], + T Ax[], + const T Xx[]) +{ + const I nnz = Ap[n_row]; + for(I i = 0; i < nnz; i++){ + Ax[i] *= Xx[Aj[i]]; + } +} + + +/* + * Compute the number of occupied RxC blocks in a matrix + * + * Input Arguments: + * I n_row - number of rows in A + * I R - row blocksize + * I C - column blocksize + * I Ap[n_row+1] - row pointer + * I Aj[nnz(A)] - column indices + * + * Output Arguments: + * I num_blocks - number of blocks + * + * Note: + * Complexity: Linear + * + */ +template +I csr_count_blocks(const I n_row, + const I n_col, + const I R, + const I C, + const I Ap[], + const I Aj[]) +{ + std::vector mask(n_col/C + 1,-1); + I n_blks = 0; + for(I i = 0; i < n_row; i++){ + I bi = i/R; + for(I jj = Ap[i]; jj < Ap[i+1]; jj++){ + I bj = Aj[jj]/C; + if(mask[bj] != bi){ + mask[bj] = bi; + n_blks++; + } + } + } + return n_blks; +} + + +/* + * Convert a CSR matrix to BSR format + * + * Input Arguments: + * I n_row - number of rows in A + * I n_col - number of columns in A + * I R - row blocksize + * I C - column blocksize + * I Ap[n_row+1] - row pointer + * I Aj[nnz(A)] - column indices + * T Ax[nnz(A)] - nonzero values + * + * Output Arguments: + * I Bp[n_row/R + 1] - block row pointer + * I Bj[nnz(B)] - column indices + * T Bx[nnz(B)] - nonzero blocks + * + * Note: + * Complexity: Linear + * Output arrays must be preallocated (with Bx initialized to zero) + * + * + */ + +template +void csr_tobsr(const I n_row, + const I n_col, + const I R, + const I C, + const I Ap[], + const I Aj[], + const T Ax[], + I Bp[], + I Bj[], + T Bx[]) +{ + std::vector blocks(n_col/C + 1, (T*)0 ); + + assert( n_row % R == 0 ); + assert( n_col % C == 0 ); + + I n_brow = n_row / R; + //I n_bcol = n_col / C; + + I RC = R*C; + I n_blks = 0; + + Bp[0] = 0; + + for(I bi = 0; bi < n_brow; bi++){ + for(I r = 0; r < R; r++){ + I i = R*bi + r; //row index + for(I jj = Ap[i]; jj < Ap[i+1]; jj++){ + I j = Aj[jj]; //column index + + I bj = j / C; + I c = j % C; + + if( blocks[bj] == 0 ){ + blocks[bj] = Bx + RC*n_blks; + Bj[n_blks] = bj; + n_blks++; + } + + *(blocks[bj] + C*r + c) += Ax[jj]; + } + } + + for(I jj = Ap[R*bi]; jj < Ap[R*(bi+1)]; jj++){ + blocks[Aj[jj] / C] = 0; + } + + Bp[bi+1] = n_blks; + } +} + + + +/* + * Sort CSR column indices inplace + * + * Input Arguments: + * I n_row - number of rows in A + * I Ap[n_row+1] - row pointer + * I Aj[nnz(A)] - column indices + * T Ax[nnz(A)] - nonzeros + * + */ +template +bool csr_has_sorted_indices(const I n_row, + const I Ap[], + const I Aj[]) +{ + for(I i = 0; i < n_row; i++){ + for(I jj = Ap[i]; jj < Ap[i+1] - 1; jj++){ + if(Aj[jj] > Aj[jj+1]){ + return false; + } + } + } + return true; +} +template< class T1, class T2 > +bool kv_pair_less(const std::pair& x, const std::pair& y){ + return x.first < y.first; +} + +template +void csr_sort_indices(const I n_row, + const I Ap[], + I Aj[], + T Ax[]) +{ + std::vector< std::pair > temp; + + for(I i = 0; i < n_row; i++){ + I row_start = Ap[i]; + I row_end = Ap[i+1]; + + temp.clear(); + + for(I jj = row_start; jj < row_end; jj++){ + temp.push_back(std::make_pair(Aj[jj],Ax[jj])); + } + + std::sort(temp.begin(),temp.end(),kv_pair_less); + + for(I jj = row_start, n = 0; jj < row_end; jj++, n++){ + Aj[jj] = temp[n].first; + Ax[jj] = temp[n].second; + } + } +} + + + + +/* + * Compute B = A for CSR matrix A, CSC matrix B + * + * Also, with the appropriate arguments can also be used to: + * - compute B = A^t for CSR matrix A, CSR matrix B + * - compute B = A^t for CSC matrix A, CSC matrix B + * - convert CSC->CSR + * + * Input Arguments: + * I n_row - number of rows in A + * I n_col - number of columns in A + * I Ap[n_row+1] - row pointer + * I Aj[nnz(A)] - column indices + * T Ax[nnz(A)] - nonzeros + * + * Output Arguments: + * I Bp[n_col+1] - column pointer + * I Bj[nnz(A)] - row indices + * T Bx[nnz(A)] - nonzeros + * + * Note: + * Output arrays Bp, Bj, Bx must be preallocated + * + * Note: + * Input: column indices *are not* assumed to be in sorted order + * Output: row indices *will be* in sorted order + * + * Complexity: Linear. Specifically O(nnz(A) + max(n_row,n_col)) + * + */ +template +void csr_tocsc(const I n_row, + const I n_col, + const I Ap[], + const I Aj[], + const T Ax[], + I Bp[], + I Bi[], + T Bx[]) +{ + const I nnz = Ap[n_row]; + + //compute number of non-zero entries per column of A + std::fill(Bp, Bp + n_col, 0); + + for (I n = 0; n < nnz; n++){ + Bp[Aj[n]]++; + } + + //cumsum the nnz per column to get Bp[] + for(I col = 0, cumsum = 0; col < n_col; col++){ + I temp = Bp[col]; + Bp[col] = cumsum; + cumsum += temp; + } + Bp[n_col] = nnz; + + for(I row = 0; row < n_row; row++){ + for(I jj = Ap[row]; jj < Ap[row+1]; jj++){ + I col = Aj[jj]; + I dest = Bp[col]; + + Bi[dest] = row; + Bx[dest] = Ax[jj]; + + Bp[col]++; + } + } + + for(I col = 0, last = 0; col <= n_col; col++){ + I temp = Bp[col]; + Bp[col] = last; + last = temp; + } +} + + + + +/* + * Compute C = A*B for CSR matrices A,B + * + * + * Input Arguments: + * I n_row - number of rows in A + * I n_col - number of columns in B (hence C is n_row by n_col) + * I Ap[n_row+1] - row pointer + * I Aj[nnz(A)] - column indices + * T Ax[nnz(A)] - nonzeros + * I Bp[?] - row pointer + * I Bj[nnz(B)] - column indices + * T Bx[nnz(B)] - nonzeros + * Output Arguments: + * I Cp[n_row+1] - row pointer + * I Cj[nnz(C)] - column indices + * T Cx[nnz(C)] - nonzeros + * + * Note: + * Output arrays Cp, Cj, and Cx must be preallocated + * The value of nnz(C) will be stored in Ap[n_row] after the first pass. + * + * Note: + * Input: A and B column indices *are not* assumed to be in sorted order + * Output: C column indices *are not* assumed to be in sorted order + * Cx will not contain any zero entries + * + * Complexity: O(n_row*K^2 + max(n_row,n_col)) + * where K is the maximum nnz in a row of A + * and column of B. + * + * + * This is an implementation of the SMMP algorithm: + * + * "Sparse Matrix Multiplication Package (SMMP)" + * Randolph E. Bank and Craig C. Douglas + * + * http://citeseer.ist.psu.edu/445062.html + * http://www.mgnet.org/~douglas/ccd-codes.html + * + */ + + +/* + * Pass 1 computes CSR row pointer for the matrix product C = A * B + * + */ +template +void csr_matmat_pass1(const I n_row, + const I n_col, + const I Ap[], + const I Aj[], + const I Bp[], + const I Bj[], + I Cp[]) +{ +// // method that uses O(1) temp storage +// const I hash_size = 1 << 5; +// I vals[hash_size]; +// I mask[hash_size]; +// +// std::set spill; +// +// for(I i = 0; i < hash_size; i++){ +// vals[i] = -1; +// mask[i] = -1; +// } +// +// Cp[0] = 0; +// +// I slow_inserts = 0; +// I total_inserts = 0; +// I nnz = 0; +// for(I i = 0; i < n_row; i++){ +// spill.clear(); +// for(I jj = Ap[i]; jj < Ap[i+1]; jj++){ +// I j = Aj[jj]; +// for(I kk = Bp[j]; kk < Bp[j+1]; kk++){ +// I k = Bj[kk]; +// // I hash = k & (hash_size - 1); +// I hash = ((I)2654435761 * k) & (hash_size -1 ); +// total_inserts++; +// if(mask[hash] != i){ +// mask[hash] = i; +// vals[hash] = k; +// nnz++; +// } else { +// if (vals[hash] != k){ +// slow_inserts++; +// spill.insert(k); +// } +// } +// } +// } +// nnz += spill.size(); +// Cp[i+1] = nnz; +// } +// +// std::cout << "slow fraction " << ((float) slow_inserts)/ ((float) total_inserts) << std::endl; + + // method that uses O(n) temp storage + std::vector mask(n_col,-1); + Cp[0] = 0; + + I nnz = 0; + for(I i = 0; i < n_row; i++){ + for(I jj = Ap[i]; jj < Ap[i+1]; jj++){ + I j = Aj[jj]; + for(I kk = Bp[j]; kk < Bp[j+1]; kk++){ + I k = Bj[kk]; + if(mask[k] != i){ + mask[k] = i; + nnz++; + } + } + } + Cp[i+1] = nnz; + } +} + +/* + * Pass 2 computes CSR entries for matrix C = A*B using the + * row pointer Cp[] computed in Pass 1. + * + */ +template +void csr_matmat_pass2(const I n_row, + const I n_col, + const I Ap[], + const I Aj[], + const T Ax[], + const I Bp[], + const I Bj[], + const T Bx[], + I Cp[], + I Cj[], + T Cx[]) +{ + std::vector next(n_col,-1); + std::vector sums(n_col, 0); + + I nnz = 0; + + Cp[0] = 0; + + for(I i = 0; i < n_row; i++){ + I head = -2; + I length = 0; + + I jj_start = Ap[i]; + I jj_end = Ap[i+1]; + for(I jj = jj_start; jj < jj_end; jj++){ + I j = Aj[jj]; + T v = Ax[jj]; + + I kk_start = Bp[j]; + I kk_end = Bp[j+1]; + for(I kk = kk_start; kk < kk_end; kk++){ + I k = Bj[kk]; + + sums[k] += v*Bx[kk]; + + if(next[k] == -1){ + next[k] = head; + head = k; + length++; + } + } + } + + for(I jj = 0; jj < length; jj++){ + + if(sums[head] != 0){ + Cj[nnz] = head; + Cx[nnz] = sums[head]; + nnz++; + } + + I temp = head; + head = next[head]; + + next[temp] = -1; //clear arrays + sums[temp] = 0; + } + + Cp[i+1] = nnz; + } +} + + + + + +/* + * Compute C = A (bin_op) B for CSR matrices A,B + * + * bin_op(x,y) - binary operator to apply elementwise + * + * + * Input Arguments: + * I n_row - number of rows in A (and B) + * I n_col - number of columns in A (and B) + * I Ap[n_row+1] - row pointer + * I Aj[nnz(A)] - column indices + * T Ax[nnz(A)] - nonzeros + * I Bp[?] - row pointer + * I Bj[nnz(B)] - column indices + * T Bx[nnz(B)] - nonzeros + * Output Arguments: + * I Cp[n_row+1] - row pointer + * I Cj[nnz(C)] - column indices + * T Cx[nnz(C)] - nonzeros + * + * Note: + * Output arrays Cp, Cj, and Cx must be preallocated + * If nnz(C) is not known a priori, a conservative bound is: + * nnz(C) <= nnz(A) + nnz(B) + * + * Note: + * Input: A and B column indices are assumed to be in sorted order + * Output: C column indices are assumed to be in sorted order + * Cx will not contain any zero entries + * + */ +template +void csr_binop_csr(const I n_row, + const I n_col, + const I Ap[], + const I Aj[], + const T Ax[], + const I Bp[], + const I Bj[], + const T Bx[], + I Cp[], + I Cj[], + T Cx[], + const bin_op& op) +{ + //Method that works for sorted indices + // assert( csr_has_sorted_indices(n_row,Ap,Aj) ); + // assert( csr_has_sorted_indices(n_row,Bp,Bj) ); + + Cp[0] = 0; + I nnz = 0; + + for(I i = 0; i < n_row; i++){ + I A_pos = Ap[i]; + I B_pos = Bp[i]; + I A_end = Ap[i+1]; + I B_end = Bp[i+1]; + + I A_j = Aj[A_pos]; + I B_j = Bj[B_pos]; + + //while not finished with either row + while(A_pos < A_end && B_pos < B_end){ + if(A_j == B_j){ + T result = op(Ax[A_pos],Bx[B_pos]); + if(result != 0){ + Cj[nnz] = A_j; + Cx[nnz] = result; + nnz++; + } + A_j = Aj[++A_pos]; + B_j = Bj[++B_pos]; + } else if (A_j < B_j) { + T result = op(Ax[A_pos],0); + if (result != 0){ + Cj[nnz] = A_j; + Cx[nnz] = result; + nnz++; + } + A_j = Aj[++A_pos]; + } else { + //B_j < A_j + T result = op(0,Bx[B_pos]); + if (result != 0){ + Cj[nnz] = B_j; + Cx[nnz] = result; + nnz++; + } + B_j = Bj[++B_pos]; + } + } + + //tail + while(A_pos < A_end){ + T result = op(Ax[A_pos],0); + if (result != 0){ + Cj[nnz] = Aj[A_pos]; + Cx[nnz] = result; + nnz++; + } + A_pos++; + } + while(B_pos < B_end){ + T result = op(0,Bx[B_pos]); + if (result != 0){ + Cj[nnz] = Bj[B_pos]; + Cx[nnz] = result; + nnz++; + } + B_pos++; + } + Cp[i+1] = nnz; + } +} + +/* element-wise binary operations*/ +template +void csr_elmul_csr(const I n_row, const I n_col, + const I Ap [], const I Aj [], const T Ax [], + const I Bp [], const I Bj [], const T Bx [], + I Cp[], I Cj[], T Cx[]) +{ + csr_binop_csr(n_row,n_col,Ap,Aj,Ax,Bp,Bj,Bx,Cp,Cj,Cx,std::multiplies()); +} + +template +void csr_eldiv_csr(const I n_row, const I n_col, + const I Ap [], const I Aj [], const T Ax [], + const I Bp [], const I Bj [], const T Bx [], + I Cp[], I Cj[], T Cx[]) +{ + csr_binop_csr(n_row,n_col,Ap,Aj,Ax,Bp,Bj,Bx,Cp,Cj,Cx,std::divides()); +} + + +template +void csr_plus_csr(const I n_row, const I n_col, + const I Ap [], const I Aj [], const T Ax [], + const I Bp [], const I Bj [], const T Bx [], + I Cp[], I Cj[], T Cx[]) +{ + csr_binop_csr(n_row,n_col,Ap,Aj,Ax,Bp,Bj,Bx,Cp,Cj,Cx,std::plus()); +} + +template +void csr_minus_csr(const I n_row, const I n_col, + const I Ap[], const I Aj [], const T Ax [], + const I Bp[], const I Bj [], const T Bx [], + I Cp[], I Cj[], T Cx[]) +{ + csr_binop_csr(n_row,n_col,Ap,Aj,Ax,Bp,Bj,Bx,Cp,Cj,Cx,std::minus()); +} + + + +/* + * Sum together duplicate column entries in each row of CSR matrix A + * + * + * Input Arguments: + * I n_row - number of rows in A (and B) + * I n_col - number of columns in A (and B) + * I Ap[n_row+1] - row pointer + * I Aj[nnz(A)] - column indices + * T Ax[nnz(A)] - nonzeros + * + * Note: + * The column indicies within each row must be in sorted order. + * Ap, Aj, and Ax will be modified *inplace* + * + */ +template +void csr_sum_duplicates(const I n_row, + const I n_col, + I Ap[], + I Aj[], + T Ax[]) +{ + I nnz = 0; + I row_end = 0; + for(I i = 0; i < n_row; i++){ + I jj = row_end; + row_end = Ap[i+1]; + while( jj < row_end ){ + I j = Aj[jj]; + T x = Ax[jj]; + jj++; + while( Aj[jj] == j && jj < row_end ){ + x += Ax[jj]; + jj++; + } + Aj[nnz] = j; + Ax[nnz] = x; + nnz++; + } + Ap[i+1] = nnz; + } +} + +/* + * Eliminate zero entries from CSR matrix A + * + * + * Input Arguments: + * I n_row - number of rows in A (and B) + * I n_col - number of columns in A (and B) + * I Ap[n_row+1] - row pointer + * I Aj[nnz(A)] - column indices + * T Ax[nnz(A)] - nonzeros + * + * Note: + * Ap, Aj, and Ax will be modified *inplace* + * + */ +template +void csr_eliminate_zeros(const I n_row, + const I n_col, + I Ap[], + I Aj[], + T Ax[]) +{ + I nnz = 0; + I row_end = 0; + for(I i = 0; i < n_row; i++){ + I jj = row_end; + row_end = Ap[i+1]; + while( jj < row_end ){ + I j = Aj[jj]; + T x = Ax[jj]; + if(x != 0){ + Aj[nnz] = j; + Ax[nnz] = x; + nnz++; + } + jj++; + } + Ap[i+1] = nnz; + } +} + + + +/* + * Compute Y += A*X for CSR matrix A and dense vectors X,Y + * + * + * Input Arguments: + * I n_row - number of rows in A + * I n_col - number of columns in A + * I Ap[n_row+1] - row pointer + * I Aj[nnz(A)] - column indices + * T Ax[nnz(A)] - nonzeros + * T Xx[n_col] - input vector + * + * Output Arguments: + * T Yx[n_row] - output vector + * + * Note: + * Output array Yx must be preallocated + * + * Complexity: Linear. Specifically O(nnz(A) + n_row) + * + */ +template +void csr_matvec(const I n_row, + const I n_col, + const I Ap[], + const I Aj[], + const T Ax[], + const T Xx[], + T Yx[]) +{ + for(I i = 0; i < n_row; i++){ + T sum = Yx[i]; + for(I jj = Ap[i]; jj < Ap[i+1]; jj++){ + sum += Ax[jj] * Xx[Aj[jj]]; + } + Yx[i] = sum; + } +} + + +template +void get_csr_submatrix(const I n_row, + const I n_col, + const I Ap[], + const I Aj[], + const T Ax[], + const I ir0, + const I ir1, + const I ic0, + const I ic1, + std::vector* Bp, + std::vector* Bj, + std::vector* Bx) +{ + I new_n_row = ir1 - ir0; + //I new_n_col = ic1 - ic0; //currently unused + I new_nnz = 0; + I kk = 0; + + // Count nonzeros total/per row. + for(I i = 0; i < new_n_row; i++){ + I row_start = Ap[ir0+i]; + I row_end = Ap[ir0+i+1]; + + for(I jj = row_start; jj < row_end; jj++){ + if ((Aj[jj] >= ic0) && (Aj[jj] < ic1)) { + new_nnz++; + } + } + } + + // Allocate. + Bp->resize(new_n_row+1); + Bj->resize(new_nnz); + Bx->resize(new_nnz); + + // Assign. + (*Bp)[0] = 0; + for(I i = 0; i < new_n_row; i++){ + I row_start = Ap[ir0+i]; + I row_end = Ap[ir0+i+1]; + + for(I jj = row_start; jj < row_end; jj++){ + if ((Aj[jj] >= ic0) && (Aj[jj] < ic1)) { + (*Bj)[kk] = Aj[jj] - ic0; + (*Bx)[kk] = Ax[jj]; + kk++; + } + } + (*Bp)[i+1] = kk; + } +} + + + + + +#endif Added: trunk/scipy/sparse/sparsetools/dia.h =================================================================== --- trunk/scipy/sparse/sparsetools/dia.h 2008-03-18 10:56:47 UTC (rev 4034) +++ trunk/scipy/sparse/sparsetools/dia.h 2008-03-18 11:48:06 UTC (rev 4035) @@ -0,0 +1,59 @@ +#ifndef __DIA_H__ +#define __DIA_H__ + +#include + + +/* + * Compute Y += A*X for DIA matrix A and dense vectors X,Y + * + * + * Input Arguments: + * I n_row - number of rows in A + * I n_col - number of columns in A + * I n_diags - number of diagonals + * I L - length of each diagonal + * I offsets[n_diags] - diagonal offsets + * T diags[n_diags,L] - nonzeros + * T Xx[n_col] - input vector + * + * Output Arguments: + * T Yx[n_row] - output vector + * + * Note: + * Output array Yx must be preallocated + * Negative offsets correspond to lower diagonals + * Positive offsets correspond to upper diagonals + * + */ +template +void dia_matvec(const I n_row, + const I n_col, + const I n_diags, + const I L, + const I offsets[], + const T diags[], + const T Xx[], + T Yx[]) +{ + for(I i = 0; i < n_diags; i++){ + const I k = offsets[i]; //diagonal offset + + const I i_start = std::max(0,-k); + const I j_start = std::max(0, k); + const I j_end = std::min(std::min(n_row + k, n_col),L); + + const I N = j_end - j_start; //number of elements to process + + const T * diag = diags + i*L + j_start; + const T * x = Xx + j_start; + T * y = Yx + i_start; + + for(I n = 0; n < N; n++){ + y[n] += diag[n] * x[n]; + } + } +} + + +#endif Added: trunk/scipy/sparse/sparsetools/scratch.h =================================================================== --- trunk/scipy/sparse/sparsetools/scratch.h 2008-03-18 10:56:47 UTC (rev 4034) +++ trunk/scipy/sparse/sparsetools/scratch.h 2008-03-18 11:48:06 UTC (rev 4035) @@ -0,0 +1,331 @@ +/* + * These are sparsetools functions that are not currently used + * + */ + +/* + * Compute C = A*B for CSR matrices A,B + * + * + * Input Arguments: + * I n_row - number of rows in A + * I n_col - number of columns in B (hence C is n_row by n_col) + * I Ap[n_row+1] - row pointer + * I Aj[nnz(A)] - column indices + * T Ax[nnz(A)] - nonzeros + * I Bp[?] - row pointer + * I Bj[nnz(B)] - column indices + * T Bx[nnz(B)] - nonzeros + * Output Arguments: + * vec Cp - row pointer + * vec Cj - column indices + * vec Cx - nonzeros + * + * Note: + * Output arrays Cp, Cj, and Cx will be allocated within in the method + * + * Note: + * Input: A and B column indices *are not* assumed to be in sorted order + * Output: C column indices *are not* assumed to be in sorted order + * Cx will not contain any zero entries + * + * Complexity: O(n_row*K^2 + max(n_row,n_col)) + * where K is the maximum nnz in a row of A + * and column of B. + * + * + * This implementation closely follows the SMMP algorithm: + * + * "Sparse Matrix Multiplication Package (SMMP)" + * Randolph E. Bank and Craig C. Douglas + * + * http://citeseer.ist.psu.edu/445062.html + * http://www.mgnet.org/~douglas/ccd-codes.html + * + */ +template +void csrmucsr(const I n_row, + const I n_col, + const I Ap[], + const I Aj[], + const T Ax[], + const I Bp[], + const I Bj[], + const T Bx[], + std::vector* Cp, + std::vector* Cj, + std::vector* Cx) +{ + Cp->resize(n_row+1,0); + + std::vector next(n_col,-1); + std::vector sums(n_col, 0); + + for(I i = 0; i < n_row; i++){ + I head = -2; + I length = 0; + + I jj_start = Ap[i]; + I jj_end = Ap[i+1]; + for(I jj = jj_start; jj < jj_end; jj++){ + I j = Aj[jj]; + + I kk_start = Bp[j]; + I kk_end = Bp[j+1]; + for(I kk = kk_start; kk < kk_end; kk++){ + I k = Bj[kk]; + + sums[k] += Ax[jj]*Bx[kk]; + + if(next[k] == -1){ + next[k] = head; + head = k; + length++; + } + } + } + + for(I jj = 0; jj < length; jj++){ + if(sums[head] != 0){ + Cj->push_back(head); + Cx->push_back(sums[head]); + } + + I temp = head; + head = next[head]; + + next[temp] = -1; //clear arrays + sums[temp] = 0; + } + + (*Cp)[i+1] = Cx->size(); + } +} + + + + + + + + + + + + + +/* + * Compute M = A for CSR matrix A, dense matrix M + * + * Input Arguments: + * I n_row - number of rows in A + * I n_col - number of columns in A + * I Ap[n_row+1] - row pointer + * I Aj[nnz(A)] - column indices + * T Ax[nnz(A)] - nonzeros + * T Mx[n_row*n_col] - dense matrix + * + * Note: + * Output array Mx is assumed to be allocated and + * initialized to 0 by the caller. + * + */ +template +void csr_todense(const I n_row, + const I n_col, + const I Ap[], + const I Aj[], + const T Ax[], + T Mx[]) +{ + I row_base = 0; + for(I i = 0; i < n_row; i++){ + I row_start = Ap[i]; + I row_end = Ap[i+1]; + for(I jj = row_start; jj < row_end; jj++){ + I j = Aj[jj]; + Mx[row_base + j] = Ax[jj]; + } + row_base += n_col; + } +} +/* + * Compute B = A for CSR matrix A, COO matrix B + * + * Also, with the appropriate arguments can also be used to: + * - convert CSC->COO + * + * Input Arguments: + * I n_row - number of rows in A + * I n_col - number of columns in A + * I Ap[n_row+1] - row pointer + * I Aj[nnz(A)] - column indices + * T Ax[nnz(A)] - nonzeros + * + * Output Arguments: + * vec Bi - row indices + * vec Bj - column indices + * vec Bx - nonzeros + * + * Note: + * Output arrays Bi, Bj, Bx will be allocated within in the method + * + * Note: + * Complexity: Linear. + * + */ +template +void csr_tocoo(const I n_row, + const I n_col, + const I Ap[], + const I Aj[], + const T Ax[], + std::vector* Bi, + std::vector* Bj, + std::vector* Bx) +{ + I nnz = Ap[n_row]; + Bi->reserve(nnz); + Bi->reserve(nnz); + Bx->reserve(nnz); + for(I i = 0; i < n_row; i++){ + I row_start = Ap[i]; + I row_end = Ap[i+1]; + for(I jj = row_start; jj < row_end; jj++){ + Bi->push_back(i); + Bj->push_back(Aj[jj]); + Bx->push_back(Ax[jj]); + } + } +} + + +/* + * Construct CSC matrix A from diagonals + * + * Input Arguments: + * I n_row - number of rows in A + * I n_col - number of columns in A + * I n_diags - number of diagonals + * I diags_indx[n_diags] - where to place each diagonal + * T diags[n_diags][min(n_row,n_col)] - diagonals + * + * Output Arguments: + * vec Ap - row pointer + * vec Aj - column indices + * vec Ax - nonzeros + * + * Note: + * Output arrays Ap, Aj, Ax will be allocated within in the method + * + * Note: + * Output: row indices are not in sorted order + * + * Complexity: Linear + * + */ +template +void spdiags(const I n_row, + const I n_col, + const I n_diag, + const I offsets[], + const T diags[], + std::vector * Ap, + std::vector * Ai, + std::vector * Ax) +{ + const I diags_length = std::min(n_row,n_col); + Ap->push_back(0); + + for(I i = 0; i < n_col; i++){ + for(I j = 0; j < n_diag; j++){ + if(offsets[j] <= 0){ //sub-diagonal + I row = i - offsets[j]; + if (row >= n_row){ continue; } + + Ai->push_back(row); + Ax->push_back(diags[j*diags_length + i]); + } else { //super-diagonal + I row = i - offsets[j]; + if (row < 0 || row >= n_row){ continue; } + Ai->push_back(row); + Ax->push_back(diags[j*diags_length + row]); + } + } + Ap->push_back(Ai->size()); + } +} + +template +void bsr_binop_bsr_fixed(const I n_brow, const I n_bcol, + const I Ap[], const I Aj[], const T Ax[], + const I Bp[], const I Bj[], const T Bx[], + I Cp[], I Cj[], T Cx[], + const bin_op& op) +{ + //Method that works for unsorted indices + const I RC = R*C; + T zeros[RC] = {0}; + Cp[0] = 0; + I nnz = 0; + + std::cout << "using bsr_ fixed" << std::endl; + for(I i = 0; i < n_brow; i++){ + I A_pos = Ap[i]; + I B_pos = Bp[i]; + I A_end = Ap[i+1]; + I B_end = Bp[i+1]; + + I A_j = Aj[A_pos]; + I B_j = Bj[B_pos]; + + //while not finished with either row + while(A_pos < A_end && B_pos < B_end){ + if(A_j == B_j){ + Cj[nnz] = A_j; + vec_binop_vec (Ax + RC*A_pos, Bx + RC*B_pos, Cx + RC*nnz, op); + if( is_nonzero_block(Cx + RC*nnz,RC) ){ + nnz++; + } + A_j = Aj[++A_pos]; + B_j = Bj[++B_pos]; + } else if (A_j < B_j) { + Cj[nnz] = A_j; + vec_binop_vec (Ax + RC*A_pos, zeros, Cx + RC*nnz, op); + if( is_nonzero_block(Cx + RC*nnz,RC) ){ + nnz++; + } + A_j = Aj[++A_pos]; + } else { + //B_j < A_j + Cj[nnz] = B_j; + vec_binop_vec (zeros, Bx + RC*A_pos, Cx + RC*nnz, op); + if( is_nonzero_block(Cx + RC*nnz,RC) ){ + nnz++; + } + B_j = Bj[++B_pos]; + } + } + + //tail + while(A_pos < A_end){ + Cj[nnz] = A_j; + vec_binop_vec (Ax + RC*A_pos, zeros, Cx + RC*nnz, op); + if( is_nonzero_block(Cx + RC*nnz,RC) ){ + nnz++; + } + A_j = Aj[++A_pos]; + } + while(B_pos < B_end){ + Cj[nnz] = B_j; + vec_binop_vec (zeros, Bx + RC*A_pos, Cx + RC*nnz, op); + if( is_nonzero_block(Cx + RC*nnz,RC) ){ + nnz++; + } + B_j = Bj[++B_pos]; + } + + Cp[i+1] = nnz; + } +} + Modified: trunk/scipy/sparse/sparsetools/sparsetools.h =================================================================== --- trunk/scipy/sparse/sparsetools/sparsetools.h 2008-03-18 10:56:47 UTC (rev 4034) +++ trunk/scipy/sparse/sparsetools/sparsetools.h 2008-03-18 11:48:06 UTC (rev 4035) @@ -1,2268 +1,25 @@ #ifndef SPARSETOOLS_H #define SPARSETOOLS_H - /* * sparsetools.h - * A collection of CSR/CSC/COO/BSR matrix conversion and arithmetic functions. + * A collection of routines for sparse matrix operations: * - * Original code by Nathan Bell + * Original code by Nathan Bell ( http://www.wnbell.com/ ) * - */ - - - -#include - -#include -#include -#include -#include "fixed_size.h" - -/* - * Extract main diagonal of CSR matrix A + * Files/formats are: + * csr.h - Compressed Sparse Row format + * csc.h - Compressed Sparse Column format + * coo.h - COOrdinate format + * bsr.h - Block Sparse Row format + * dia.h - DIAgonal format * - * Input Arguments: - * I n_row - number of rows in A - * I n_col - number of columns in A - * I Ap[n_row+1] - row pointer - * I Aj[nnz(A)] - column indices - * T Ax[n_col] - nonzeros - * - * Output Arguments: - * T Yx[min(n_row,n_col)] - diagonal entries - * - * Note: - * Output array Yx must be preallocated - * - * Duplicate entries will be summed. - * - * Complexity: Linear. Specifically O(nnz(A) + min(n_row,n_col)) - * */ -template -void csr_diagonal(const I n_row, - const I n_col, - const I Ap[], - const I Aj[], - const T Ax[], - T Yx[]) -{ - const I N = std::min(n_row, n_col); - for(I i = 0; i < N; i++){ - I row_start = Ap[i]; - I row_end = Ap[i+1]; +#include "csr.h" +#include "csc.h" +#include "coo.h" +#include "bsr.h" +#include "dia.h" - T diag = 0; - for(I jj = row_start; jj < row_end; jj++){ - if (Aj[jj] == i) - diag += Ax[jj]; - } - - Yx[i] = diag; - } -} - -template -void bsr_diagonal(const I n_brow, - const I n_bcol, - const I R, - const I C, - const I Ap[], - const I Aj[], - const T Ax[], - T Yx[]) -{ - const I N = std::min(R*n_brow, C*n_bcol); - const I RC = R*C; - - for(I i = 0; i < N; i++){ - Yx[i] = 0; - } - - if ( R == C ){ - //main diagonal with square blocks - const I end = std::min(n_brow,n_bcol); - for(I i = 0; i < end; i++){ - for(I jj = Ap[i]; jj < Ap[i+1]; jj++){ - if (i == Aj[jj]){ - I row = R*i; - const T * val = Ax + RC*jj; - for(I bi = 0; bi < R; bi++){ - Yx[row + bi] = *val; - val += C + 1; - } - } - } - } - } - else - { - //This could be made faster - const I end = (N/R) + (N % R == 0 ? 0 : 1); - for(I i = 0; i < end; i++){ - for(I jj = Ap[i]; jj < Ap[i+1]; jj++){ - const I base_row = R*i; - const I base_col = C*Aj[jj]; - const T * base_val = Ax + RC*jj; - - for(I bi = 0; bi < R; bi++){ - const I row = base_row + bi; - if (row >= N) break; - - for(I bj = 0; bj < C; bj++){ - const I col = base_col + bj; - if (row == col){ - Yx[row] = base_val[bi*C + bj]; - } - } - } - } - } - } -} - -/* - * Expand a compressed row pointer into a row array - * - * Input Arguments: - * I n_row - number of rows in A - * I Ap[n_row+1] - row pointer - * - * Output Arguments: - * Bi - row indices - * - * Note: - * Output array Bi must be preallocated - * - * Note: - * Complexity: Linear - * - */ -template -void expandptr(const I n_row, - const I Ap[], - I Bi[]) -{ - for(I i = 0; i < n_row; i++){ - for(I jj = Ap[i]; jj < Ap[i+1]; jj++){ - Bi[jj] = i; - } - } -} - -/* - * Scale the rows of a CSR matrix *in place* - * - * A[i,:] *= X[i] - * - */ -template -void csr_scale_rows(const I n_row, - const I n_col, - const I Ap[], - const I Aj[], - T Ax[], - const T Xx[]) -{ - for(I i = 0; i < n_row; i++){ - for(I jj = Ap[i]; jj < Ap[i+1]; jj++){ - Ax[jj] *= Xx[i]; - } - } -} - -/* - * Scale the columns of a CSR matrix *in place* - * - * A[:,i] *= X[i] - * - */ -template -void csr_scale_columns(const I n_row, - const I n_col, - const I Ap[], - const I Aj[], - T Ax[], - const T Xx[]) -{ - const I nnz = Ap[n_row]; - for(I i = 0; i < nnz; i++){ - Ax[i] *= Xx[Aj[i]]; - } -} - -/* - * Scale the rows of a BSR matrix *in place* - * - * A[i,:] *= X[i] - * - */ -template -void bsr_scale_rows(const I n_brow, - const I n_bcol, - const I R, - const I C, - const I Ap[], - const I Aj[], - T Ax[], - const T Xx[]) -{ - const I RC = R*C; - for(I i = 0; i < n_brow; i++){ - for(I jj = Ap[i]; jj < Ap[i+1]; jj++){ - for(I bi = 0; bi < R; bi++){ - const T s = Xx[R*i + bi]; - T * block_row = Ax + RC*jj + C*bi; - - for(I bj = 0; bj < C; bj++){ - block_row[bj] *= s; - } - - } - } - } -} - -/* - * Scale the columns of a BSR matrix *in place* - * - * A[:,i] *= X[i] - * - */ -template -void bsr_scale_columns(const I n_brow, - const I n_bcol, - const I R, - const I C, - const I Ap[], - const I Aj[], - T Ax[], - const T Xx[]) -{ - const I bnnz = Ap[n_brow]; - const I RC = R*C; - for(I i = 0; i < bnnz; i++){ - const T * scales = Xx + C*Aj[i] ; - T * block = Ax + RC*i; - - for(I bi = 0; bi < R; bi++){ - for(I bj = 0; bj < C; bj++){ - block[C*bi + bj] *= scales[bj]; - } - } - - } -} - -/* - * Compute the number of occupied RxC blocks in a matrix - * - * Input Arguments: - * I n_row - number of rows in A - * I R - row blocksize - * I C - column blocksize - * I Ap[n_row+1] - row pointer - * I Aj[nnz(A)] - column indices - * - * Output Arguments: - * I num_blocks - number of blocks - * - * Note: - * Complexity: Linear - * - */ -template -I csr_count_blocks(const I n_row, - const I n_col, - const I R, - const I C, - const I Ap[], - const I Aj[]) -{ - std::vector mask(n_col/C + 1,-1); - I n_blks = 0; - for(I i = 0; i < n_row; i++){ - I bi = i/R; - for(I jj = Ap[i]; jj < Ap[i+1]; jj++){ - I bj = Aj[jj]/C; - if(mask[bj] != bi){ - mask[bj] = bi; - n_blks++; - } - } - } - return n_blks; -} - - -/* - * Convert a CSR matrix to BSR format - * - * Input Arguments: - * I n_row - number of rows in A - * I n_col - number of columns in A - * I R - row blocksize - * I C - column blocksize - * I Ap[n_row+1] - row pointer - * I Aj[nnz(A)] - column indices - * T Ax[nnz(A)] - nonzero values - * - * Output Arguments: - * I Bp[n_row/R + 1] - block row pointer - * I Bj[nnz(B)] - column indices - * T Bx[nnz(B)] - nonzero blocks - * - * Note: - * Complexity: Linear - * Output arrays must be preallocated (with Bx initialized to zero) - * - * - */ - -template -void csr_tobsr(const I n_row, - const I n_col, - const I R, - const I C, - const I Ap[], - const I Aj[], - const T Ax[], - I Bp[], - I Bj[], - T Bx[]) -{ - std::vector blocks(n_col/C + 1, (T*)0 ); - - assert( n_row % R == 0 ); - assert( n_col % C == 0 ); - - I n_brow = n_row / R; - //I n_bcol = n_col / C; - - I RC = R*C; - I n_blks = 0; - - Bp[0] = 0; - - for(I bi = 0; bi < n_brow; bi++){ - for(I r = 0; r < R; r++){ - I i = R*bi + r; //row index - for(I jj = Ap[i]; jj < Ap[i+1]; jj++){ - I j = Aj[jj]; //column index - - I bj = j / C; - I c = j % C; - - if( blocks[bj] == 0 ){ - blocks[bj] = Bx + RC*n_blks; - Bj[n_blks] = bj; - n_blks++; - } - - *(blocks[bj] + C*r + c) += Ax[jj]; - } - } - - for(I jj = Ap[R*bi]; jj < Ap[R*(bi+1)]; jj++){ - blocks[Aj[jj] / C] = 0; - } - - Bp[bi+1] = n_blks; - } -} - - - -/* - * Sort CSR column indices inplace - * - * Input Arguments: - * I n_row - number of rows in A - * I Ap[n_row+1] - row pointer - * I Aj[nnz(A)] - column indices - * T Ax[nnz(A)] - nonzeros - * - */ -template -bool csr_has_sorted_indices(const I n_row, - const I Ap[], - const I Aj[]) -{ - for(I i = 0; i < n_row; i++){ - for(I jj = Ap[i]; jj < Ap[i+1] - 1; jj++){ - if(Aj[jj] > Aj[jj+1]){ - return false; - } - } - } - return true; -} -template< class T1, class T2 > -bool kv_pair_less(const std::pair& x, const std::pair& y){ - return x.first < y.first; -} - -template -void csr_sort_indices(const I n_row, - const I Ap[], - I Aj[], - T Ax[]) -{ - std::vector< std::pair > temp; - - for(I i = 0; i < n_row; i++){ - I row_start = Ap[i]; - I row_end = Ap[i+1]; - - temp.clear(); - - for(I jj = row_start; jj < row_end; jj++){ - temp.push_back(std::make_pair(Aj[jj],Ax[jj])); - } - - std::sort(temp.begin(),temp.end(),kv_pair_less); - - for(I jj = row_start, n = 0; jj < row_end; jj++, n++){ - Aj[jj] = temp[n].first; - Ax[jj] = temp[n].second; - } - } -} - - -/* - * Sort the column block indices of a BSR matrix inplace - * - * Input Arguments: - * I n_brow - number of row blocks in A - * I n_bcol - number of column blocks in A - * I R - rows per block - * I C - columns per block - * I Ap[n_brow+1] - row pointer - * I Aj[nblk(A)] - column indices - * T Ax[nnz(A)] - nonzeros - * - */ -template -void bsr_sort_indices(const I n_brow, - const I n_bcol, - const I R, - const I C, - I Ap[], - I Aj[], - T Ax[]) -{ - if( R == 1 && C == 1 ){ - csr_sort_indices(n_brow, Ap, Aj, Ax); - return; - } - - - const I nblks = Ap[n_brow]; - const I RC = R*C; - const I nnz = RC*nblks; - - //compute permutation of blocks using tranpose(CSR) - std::vector perm(nblks); - - for(I i = 0; i < nblks; i++) - perm[i] = i; - - csr_sort_indices(n_brow, Ap, Aj, &perm[0]); - - std::vector Ax_copy(nnz); - std::copy(Ax, Ax + nnz, Ax_copy.begin()); - - for(I i = 0; i < nblks; i++){ - const T * input = &Ax_copy[RC * perm[i]]; - T * output = Ax + RC*i; - std::copy(input, input + RC, output); - } -} - - -/* - * Compute B = A for CSR matrix A, CSC matrix B - * - * Also, with the appropriate arguments can also be used to: - * - compute B = A^t for CSR matrix A, CSR matrix B - * - compute B = A^t for CSC matrix A, CSC matrix B - * - convert CSC->CSR - * - * Input Arguments: - * I n_row - number of rows in A - * I n_col - number of columns in A - * I Ap[n_row+1] - row pointer - * I Aj[nnz(A)] - column indices - * T Ax[nnz(A)] - nonzeros - * - * Output Arguments: - * I Bp[n_col+1] - column pointer - * I Bj[nnz(A)] - row indices - * T Bx[nnz(A)] - nonzeros - * - * Note: - * Output arrays Bp, Bj, Bx must be preallocated - * - * Note: - * Input: column indices *are not* assumed to be in sorted order - * Output: row indices *will be* in sorted order - * - * Complexity: Linear. Specifically O(nnz(A) + max(n_row,n_col)) - * - */ -template -void csr_tocsc(const I n_row, - const I n_col, - const I Ap[], - const I Aj[], - const T Ax[], - I Bp[], - I Bi[], - T Bx[]) -{ - const I nnz = Ap[n_row]; - - //compute number of non-zero entries per column of A - std::fill(Bp, Bp + n_col, 0); - - for (I n = 0; n < nnz; n++){ - Bp[Aj[n]]++; - } - - //cumsum the nnz per column to get Bp[] - for(I col = 0, cumsum = 0; col < n_col; col++){ - I temp = Bp[col]; - Bp[col] = cumsum; - cumsum += temp; - } - Bp[n_col] = nnz; - - for(I row = 0; row < n_row; row++){ - for(I jj = Ap[row]; jj < Ap[row+1]; jj++){ - I col = Aj[jj]; - I dest = Bp[col]; - - Bi[dest] = row; - Bx[dest] = Ax[jj]; - - Bp[col]++; - } - } - - for(I col = 0, last = 0; col <= n_col; col++){ - I temp = Bp[col]; - Bp[col] = last; - last = temp; - } -} - - - -/* - * Compute transpose(A) BSR matrix A - * - * Input Arguments: - * I n_brow - number of row blocks in A - * I n_bcol - number of column blocks in A - * I R - rows per block - * I C - columns per block - * I Ap[n_brow+1] - row pointer - * I Aj[nblk(A)] - column indices - * T Ax[nnz(A)] - nonzeros - * - * Output Arguments: - * I Bp[n_col+1] - row pointer - * I Bj[nblk(A)] - column indices - * T Bx[nnz(A)] - nonzeros - * - * Note: - * Output arrays Bp, Bj, Bx must be preallocated - * - * Note: - * Input: column indices *are not* assumed to be in sorted order - * Output: row indices *will be* in sorted order - * - * Complexity: Linear. Specifically O(nnz(A) + max(n_row,n_col)) - * - */ -template -void bsr_transpose(const I n_brow, - const I n_bcol, - const I R, - const I C, - const I Ap[], - const I Aj[], - const T Ax[], - I Bp[], - I Bj[], - T Bx[]) -{ - const I nblks = Ap[n_brow]; - const I RC = R*C; - - //compute permutation of blocks using tranpose(CSR) - std::vector perm_in (nblks); - std::vector perm_out(nblks); - - for(I i = 0; i < nblks; i++) - perm_in[i] = i; - - csr_tocsc(n_brow, n_bcol, Ap, Aj, &perm_in[0], Bp, Bj, &perm_out[0]); - - for(I i = 0; i < nblks; i++){ - const T * Ax_blk = Ax + RC * perm_out[i]; - T * Bx_blk = Bx + RC * i; - for(I r = 0; r < R; r++){ - for(I c = 0; c < C; c++){ - Bx_blk[c * R + r] = Ax_blk[r * C + c]; - } - } - } -} - - -/* - * Compute C = A*B for CSR matrices A,B - * - * - * Input Arguments: - * I n_row - number of rows in A - * I n_col - number of columns in B (hence C is n_row by n_col) - * I Ap[n_row+1] - row pointer - * I Aj[nnz(A)] - column indices - * T Ax[nnz(A)] - nonzeros - * I Bp[?] - row pointer - * I Bj[nnz(B)] - column indices - * T Bx[nnz(B)] - nonzeros - * Output Arguments: - * I Cp[n_row+1] - row pointer - * I Cj[nnz(C)] - column indices - * T Cx[nnz(C)] - nonzeros - * - * Note: - * Output arrays Cp, Cj, and Cx must be preallocated - * The value of nnz(C) will be stored in Ap[n_row] after the first pass. - * - * Note: - * Input: A and B column indices *are not* assumed to be in sorted order - * Output: C column indices *are not* assumed to be in sorted order - * Cx will not contain any zero entries - * - * Complexity: O(n_row*K^2 + max(n_row,n_col)) - * where K is the maximum nnz in a row of A - * and column of B. - * - * - * This is an implementation of the SMMP algorithm: - * - * "Sparse Matrix Multiplication Package (SMMP)" - * Randolph E. Bank and Craig C. Douglas - * - * http://citeseer.ist.psu.edu/445062.html - * http://www.mgnet.org/~douglas/ccd-codes.html - * - */ - - -/* - * Pass 1 computes CSR row pointer for the matrix product C = A * B - * - */ -template -void csr_matmat_pass1(const I n_row, - const I n_col, - const I Ap[], - const I Aj[], - const I Bp[], - const I Bj[], - I Cp[]) -{ -// // method that uses O(1) temp storage -// const I hash_size = 1 << 5; -// I vals[hash_size]; -// I mask[hash_size]; -// -// std::set spill; -// -// for(I i = 0; i < hash_size; i++){ -// vals[i] = -1; -// mask[i] = -1; -// } -// -// Cp[0] = 0; -// -// I slow_inserts = 0; -// I total_inserts = 0; -// I nnz = 0; -// for(I i = 0; i < n_row; i++){ -// spill.clear(); -// for(I jj = Ap[i]; jj < Ap[i+1]; jj++){ -// I j = Aj[jj]; -// for(I kk = Bp[j]; kk < Bp[j+1]; kk++){ -// I k = Bj[kk]; -// // I hash = k & (hash_size - 1); -// I hash = ((I)2654435761 * k) & (hash_size -1 ); -// total_inserts++; -// if(mask[hash] != i){ -// mask[hash] = i; -// vals[hash] = k; -// nnz++; -// } else { -// if (vals[hash] != k){ -// slow_inserts++; -// spill.insert(k); -// } -// } -// } -// } -// nnz += spill.size(); -// Cp[i+1] = nnz; -// } -// -// std::cout << "slow fraction " << ((float) slow_inserts)/ ((float) total_inserts) << std::endl; - - // method that uses O(n) temp storage - std::vector mask(n_col,-1); - Cp[0] = 0; - - I nnz = 0; - for(I i = 0; i < n_row; i++){ - for(I jj = Ap[i]; jj < Ap[i+1]; jj++){ - I j = Aj[jj]; - for(I kk = Bp[j]; kk < Bp[j+1]; kk++){ - I k = Bj[kk]; - if(mask[k] != i){ - mask[k] = i; - nnz++; - } - } - } - Cp[i+1] = nnz; - } -} - -/* - * Pass 2 computes CSR entries for matrix C = A*B using the - * row pointer Cp[] computed in Pass 1. - * - */ -template -void csr_matmat_pass2(const I n_row, - const I n_col, - const I Ap[], - const I Aj[], - const T Ax[], - const I Bp[], - const I Bj[], - const T Bx[], - I Cp[], - I Cj[], - T Cx[]) -{ - std::vector next(n_col,-1); - std::vector sums(n_col, 0); - - I nnz = 0; - - Cp[0] = 0; - - for(I i = 0; i < n_row; i++){ - I head = -2; - I length = 0; - - I jj_start = Ap[i]; - I jj_end = Ap[i+1]; - for(I jj = jj_start; jj < jj_end; jj++){ - I j = Aj[jj]; - T v = Ax[jj]; - - I kk_start = Bp[j]; - I kk_end = Bp[j+1]; - for(I kk = kk_start; kk < kk_end; kk++){ - I k = Bj[kk]; - - sums[k] += v*Bx[kk]; - - if(next[k] == -1){ - next[k] = head; - head = k; - length++; - } - } - } - - for(I jj = 0; jj < length; jj++){ - - if(sums[head] != 0){ - Cj[nnz] = head; - Cx[nnz] = sums[head]; - nnz++; - } - - I temp = head; - head = next[head]; - - next[temp] = -1; //clear arrays - sums[temp] = 0; - } - - Cp[i+1] = nnz; - } -} - - - -template -void bsr_matmat_pass2_fixed(const I n_brow, const I n_bcol, - const I Ap[], const I Aj[], const T Ax[], - const I Bp[], const I Bj[], const T Bx[], - I Cp[], I Cj[], T Cx[]) -{ - const I RC = R*C; - const I RN = R*N; - const I NC = N*C; - const I SIZE = RC*Cp[n_brow]; - - for(I i = 0; i < SIZE; i++){ - Cx[i] = 0; - } - - std::vector next(n_bcol,-1); - std::vector mats(n_bcol); - - - I nnz = 0; - - Cp[0] = 0; - - for(I i = 0; i < n_brow; i++){ - I head = -2; - I length = 0; - - I jj_start = Ap[i]; - I jj_end = Ap[i+1]; - for(I jj = jj_start; jj < jj_end; jj++){ - I j = Aj[jj]; - - I kk_start = Bp[j]; - I kk_end = Bp[j+1]; - for(I kk = kk_start; kk < kk_end; kk++){ - I k = Bj[kk]; - - if(next[k] == -1){ - next[k] = head; - head = k; - Cj[nnz] = k; - mats[k] = Cx + RC*nnz; - nnz++; - length++; - } - - const T * A = Ax + jj*RN; - const T * B = Bx + kk*NC; - T * result = mats[k]; - matmat(A,B,result); - } - } - - for(I jj = 0; jj < length; jj++){ - I temp = head; - head = next[head]; - next[temp] = -1; //clear arrays - } - - } - -} - - -template -void bsr_matmat_pass2(const I n_brow, const I n_bcol, - const I R, const I C, const I N, - const I Ap[], const I Aj[], const T Ax[], - const I Bp[], const I Bj[], const T Bx[], - I Cp[], I Cj[], T Cx[]) -{ - assert(R > 0 && C > 0 && N > 0); - -#ifdef SPARSETOOLS_TESTING -#define F(X,Y,Z) bsr_matmat_pass2_fixed - - void (*dispatch[4][4][4])(I,I,const I*,const I*,const T*, - const I*,const I*,const T*, - I*, I*, T*) = \ - { - { { F(1,1,1), F(1,1,2), F(1,1,3), F(1,1,4) }, - { F(1,2,1), F(1,2,2), F(1,2,3), F(1,2,4) }, - { F(1,3,1), F(1,3,2), F(1,3,3), F(1,3,4) }, - { F(1,4,1), F(1,4,2), F(1,4,3), F(1,4,4) }, - }, - { { F(2,1,1), F(2,1,2), F(2,1,3), F(2,1,4) }, - { F(2,2,1), F(2,2,2), F(2,2,3), F(2,2,4) }, - { F(2,3,1), F(2,3,2), F(2,3,3), F(2,3,4) }, - { F(2,4,1), F(2,4,2), F(2,4,3), F(2,4,4) }, - }, - { { F(3,1,1), F(3,1,2), F(3,1,3), F(3,1,4) }, - { F(3,2,1), F(3,2,2), F(3,2,3), F(3,2,4) }, - { F(3,3,1), F(3,3,2), F(3,3,3), F(3,3,4) }, - { F(3,4,1), F(3,4,2), F(3,4,3), F(3,4,4) }, - }, - { { F(4,1,1), F(4,1,2), F(4,1,3), F(4,1,4) }, - { F(4,2,1), F(4,2,2), F(4,2,3), F(4,2,4) }, - { F(4,3,1), F(4,3,2), F(4,3,3), F(4,3,4) }, - { F(4,4,1), F(4,4,2), F(4,4,3), F(4,4,4) }, - } - }; - - if (R <= 4 && C <= 4 && N <= 4){ - dispatch[R-1][N-1][C-1](n_brow,n_bcol,Ap,Aj,Ax,Bp,Bj,Bx,Cp,Cj,Cx); - return; - } - -#undef F #endif - - if( R == 1 && N == 1 && C == 1 ){ - csr_matmat_pass2(n_brow, n_bcol, Ap, Aj, Ax, Bp, Bj, Bx, Cp, Cj, Cx); - return; - } - - const I RC = R*C; - const I RN = R*N; - const I NC = N*C; - const I SIZE = RC*Cp[n_brow]; - - - for(I i = 0; i < SIZE; i++){ - Cx[i] = 0; - } - - std::vector next(n_bcol,-1); - std::vector mats(n_bcol); - - I nnz = 0; - Cp[0] = 0; - - for(I i = 0; i < n_brow; i++){ - I head = -2; - I length = 0; - - I jj_start = Ap[i]; - I jj_end = Ap[i+1]; - for(I jj = jj_start; jj < jj_end; jj++){ - I j = Aj[jj]; - - I kk_start = Bp[j]; - I kk_end = Bp[j+1]; - for(I kk = kk_start; kk < kk_end; kk++){ - I k = Bj[kk]; - - if(next[k] == -1){ - next[k] = head; - head = k; - Cj[nnz] = k; - mats[k] = Cx + RC*nnz; - nnz++; - length++; - } - - const T * A = Ax + jj*RN; - const T * B = Bx + kk*NC; - T * result = mats[k]; - for(I r = 0; r < R; r++){ - for(I c = 0; c < C; c++){ - for(I n = 0; n < N; n++){ - result[C*r + c] += A[N*r + n] * B[C*n + c]; - - } - } - } - } - } - - for(I jj = 0; jj < length; jj++){ - I temp = head; - head = next[head]; - next[temp] = -1; //clear arrays - } - - } -} - - - - -template -bool is_nonzero_block(const T block[], const I blocksize){ - for(I i = 0; i < blocksize; i++){ - if(block[i] != 0){ - return true; - } - } - return false; -} - - - -template -void bsr_binop_bsr(const I n_brow, const I n_bcol, - const I R, const I C, - const I Ap[], const I Aj[], const T Ax[], - const I Bp[], const I Bj[], const T Bx[], - I Cp[], I Cj[], T Cx[], - const bin_op& op) -{ - assert( R > 0 && C > 0); - - if( R == 1 && C == 1 ){ - csr_binop_csr(n_brow, n_bcol, Ap, Aj, Ax, Bp, Bj, Bx, Cp, Cj, Cx, op); //use CSR for 1x1 blocksize - return; - } - - const I RC = R*C; - T * result = Cx; - - Cp[0] = 0; - I nnz = 0; - - for(I i = 0; i < n_brow; i++){ - I A_pos = Ap[i]; - I B_pos = Bp[i]; - I A_end = Ap[i+1]; - I B_end = Bp[i+1]; - - I A_j = Aj[A_pos]; - I B_j = Bj[B_pos]; - - //while not finished with either row - while(A_pos < A_end && B_pos < B_end){ - if(A_j == B_j){ - for(I n = 0; n < RC; n++){ - result[n] = op(Ax[RC*A_pos + n],Bx[RC*B_pos + n]); - } - - if( is_nonzero_block(result,RC) ){ - Cj[nnz] = A_j; - result += RC; - nnz++; - } - - A_j = Aj[++A_pos]; - B_j = Bj[++B_pos]; - - } else if (A_j < B_j) { - for(I n = 0; n < RC; n++){ - result[n] = op(Ax[RC*A_pos + n],0); - } - - if(is_nonzero_block(result,RC)){ - Cj[nnz] = A_j; - result += RC; - nnz++; - } - - A_j = Aj[++A_pos]; - - } else { - //B_j < A_j - for(I n = 0; n < RC; n++){ - result[n] = op(0,Bx[RC*B_pos + n]); - } - if(is_nonzero_block(result,RC)){ - Cj[nnz] = B_j; - result += RC; - nnz++; - } - - B_j = Bj[++B_pos]; - - } - } - - //tail - while(A_pos < A_end){ - - for(I n = 0; n < RC; n++){ - result[n] = op(Ax[RC*A_pos + n],0); - } - - if(is_nonzero_block(result,RC)){ - Cj[nnz] = A_j; - result += RC; - nnz++; - } - - A_j = Aj[++A_pos]; - - } - while(B_pos < B_end){ - for(I n = 0; n < RC; n++){ - result[n] = op(0,Bx[RC*B_pos + n]); - } - - if(is_nonzero_block(result,RC)){ - Cj[nnz] = B_j; - result += RC; - nnz++; - } - - B_j = Bj[++B_pos]; - - } - - Cp[i+1] = nnz; - } -} - -/* element-wise binary operations*/ -template -void bsr_elmul_bsr(const I n_row, const I n_col, const I R, const I C, - const I Ap[], const I Aj[], const T Ax[], - const I Bp[], const I Bj[], const T Bx[], - I Cp[], I Cj[], T Cx[]) -{ - bsr_binop_bsr(n_row,n_col,R,C,Ap,Aj,Ax,Bp,Bj,Bx,Cp,Cj,Cx,std::multiplies()); -} - -template -void bsr_eldiv_bsr(const I n_row, const I n_col, const I R, const I C, - const I Ap[], const I Aj[], const T Ax[], - const I Bp[], const I Bj[], const T Bx[], - I Cp[], I Cj[], T Cx[]) -{ - bsr_binop_bsr(n_row,n_col,R,C,Ap,Aj,Ax,Bp,Bj,Bx,Cp,Cj,Cx,std::divides()); -} - - -template -void bsr_plus_bsr(const I n_row, const I n_col, const I R, const I C, - const I Ap[], const I Aj[], const T Ax[], - const I Bp[], const I Bj[], const T Bx[], - I Cp[], I Cj[], T Cx[]) -{ - bsr_binop_bsr(n_row,n_col,R,C,Ap,Aj,Ax,Bp,Bj,Bx,Cp,Cj,Cx,std::plus()); -} - -template -void bsr_minus_bsr(const I n_row, const I n_col, const I R, const I C, - const I Ap[], const I Aj[], const T Ax[], - const I Bp[], const I Bj[], const T Bx[], - I Cp[], I Cj[], T Cx[]) -{ - bsr_binop_bsr(n_row,n_col,R,C,Ap,Aj,Ax,Bp,Bj,Bx,Cp,Cj,Cx,std::minus()); -} - - - - -/* - * Compute C = A (bin_op) B for CSR matrices A,B - * - * bin_op(x,y) - binary operator to apply elementwise - * - * - * Input Arguments: - * I n_row - number of rows in A (and B) - * I n_col - number of columns in A (and B) - * I Ap[n_row+1] - row pointer - * I Aj[nnz(A)] - column indices - * T Ax[nnz(A)] - nonzeros - * I Bp[?] - row pointer - * I Bj[nnz(B)] - column indices - * T Bx[nnz(B)] - nonzeros - * Output Arguments: - * I Cp[n_row+1] - row pointer - * I Cj[nnz(C)] - column indices - * T Cx[nnz(C)] - nonzeros - * - * Note: - * Output arrays Cp, Cj, and Cx must be preallocated - * If nnz(C) is not known a priori, a conservative bound is: - * nnz(C) <= nnz(A) + nnz(B) - * - * Note: - * Input: A and B column indices are assumed to be in sorted order - * Output: C column indices are assumed to be in sorted order - * Cx will not contain any zero entries - * - */ -template -void csr_binop_csr(const I n_row, - const I n_col, - const I Ap[], - const I Aj[], - const T Ax[], - const I Bp[], - const I Bj[], - const T Bx[], - I Cp[], - I Cj[], - T Cx[], - const bin_op& op) -{ - //Method that works for sorted indices - // assert( csr_has_sorted_indices(n_row,Ap,Aj) ); - // assert( csr_has_sorted_indices(n_row,Bp,Bj) ); - - Cp[0] = 0; - I nnz = 0; - - for(I i = 0; i < n_row; i++){ - I A_pos = Ap[i]; - I B_pos = Bp[i]; - I A_end = Ap[i+1]; - I B_end = Bp[i+1]; - - I A_j = Aj[A_pos]; - I B_j = Bj[B_pos]; - - //while not finished with either row - while(A_pos < A_end && B_pos < B_end){ - if(A_j == B_j){ - T result = op(Ax[A_pos],Bx[B_pos]); - if(result != 0){ - Cj[nnz] = A_j; - Cx[nnz] = result; - nnz++; - } - A_j = Aj[++A_pos]; - B_j = Bj[++B_pos]; - } else if (A_j < B_j) { - T result = op(Ax[A_pos],0); - if (result != 0){ - Cj[nnz] = A_j; - Cx[nnz] = result; - nnz++; - } - A_j = Aj[++A_pos]; - } else { - //B_j < A_j - T result = op(0,Bx[B_pos]); - if (result != 0){ - Cj[nnz] = B_j; - Cx[nnz] = result; - nnz++; - } - B_j = Bj[++B_pos]; - } - } - - //tail - while(A_pos < A_end){ - T result = op(Ax[A_pos],0); - if (result != 0){ - Cj[nnz] = Aj[A_pos]; - Cx[nnz] = result; - nnz++; - } - A_pos++; - } - while(B_pos < B_end){ - T result = op(0,Bx[B_pos]); - if (result != 0){ - Cj[nnz] = Bj[B_pos]; - Cx[nnz] = result; - nnz++; - } - B_pos++; - } - Cp[i+1] = nnz; - } -} - -/* element-wise binary operations*/ -template -void csr_elmul_csr(const I n_row, const I n_col, - const I Ap [], const I Aj [], const T Ax [], - const I Bp [], const I Bj [], const T Bx [], - I Cp[], I Cj[], T Cx[]) -{ - csr_binop_csr(n_row,n_col,Ap,Aj,Ax,Bp,Bj,Bx,Cp,Cj,Cx,std::multiplies()); -} - -template -void csr_eldiv_csr(const I n_row, const I n_col, - const I Ap [], const I Aj [], const T Ax [], - const I Bp [], const I Bj [], const T Bx [], - I Cp[], I Cj[], T Cx[]) -{ - csr_binop_csr(n_row,n_col,Ap,Aj,Ax,Bp,Bj,Bx,Cp,Cj,Cx,std::divides()); -} - - -template -void csr_plus_csr(const I n_row, const I n_col, - const I Ap [], const I Aj [], const T Ax [], - const I Bp [], const I Bj [], const T Bx [], - I Cp[], I Cj[], T Cx[]) -{ - csr_binop_csr(n_row,n_col,Ap,Aj,Ax,Bp,Bj,Bx,Cp,Cj,Cx,std::plus()); -} - -template -void csr_minus_csr(const I n_row, const I n_col, - const I Ap[], const I Aj [], const T Ax [], - const I Bp[], const I Bj [], const T Bx [], - I Cp[], I Cj[], T Cx[]) -{ - csr_binop_csr(n_row,n_col,Ap,Aj,Ax,Bp,Bj,Bx,Cp,Cj,Cx,std::minus()); -} - - - -/* - * Sum together duplicate column entries in each row of CSR matrix A - * - * - * Input Arguments: - * I n_row - number of rows in A (and B) - * I n_col - number of columns in A (and B) - * I Ap[n_row+1] - row pointer - * I Aj[nnz(A)] - column indices - * T Ax[nnz(A)] - nonzeros - * - * Note: - * The column indicies within each row must be in sorted order. - * Ap, Aj, and Ax will be modified *inplace* - * - */ -template -void csr_sum_duplicates(const I n_row, - const I n_col, - I Ap[], - I Aj[], - T Ax[]) -{ - I nnz = 0; - I row_end = 0; - for(I i = 0; i < n_row; i++){ - I jj = row_end; - row_end = Ap[i+1]; - while( jj < row_end ){ - I j = Aj[jj]; - T x = Ax[jj]; - jj++; - while( Aj[jj] == j && jj < row_end ){ - x += Ax[jj]; - jj++; - } - Aj[nnz] = j; - Ax[nnz] = x; - nnz++; - } - Ap[i+1] = nnz; - } -} - -/* - * Eliminate zero entries from CSR matrix A - * - * - * Input Arguments: - * I n_row - number of rows in A (and B) - * I n_col - number of columns in A (and B) - * I Ap[n_row+1] - row pointer - * I Aj[nnz(A)] - column indices - * T Ax[nnz(A)] - nonzeros - * - * Note: - * Ap, Aj, and Ax will be modified *inplace* - * - */ -template -void csr_eliminate_zeros(const I n_row, - const I n_col, - I Ap[], - I Aj[], - T Ax[]) -{ - I nnz = 0; - I row_end = 0; - for(I i = 0; i < n_row; i++){ - I jj = row_end; - row_end = Ap[i+1]; - while( jj < row_end ){ - I j = Aj[jj]; - T x = Ax[jj]; - if(x != 0){ - Aj[nnz] = j; - Ax[nnz] = x; - nnz++; - } - jj++; - } - Ap[i+1] = nnz; - } -} - - - -/* - * Compute B = A for COO matrix A, CSR matrix B - * - * - * Input Arguments: - * I n_row - number of rows in A - * I n_col - number of columns in A - * I nnz - number of nonzeros in A - * I Ai[nnz(A)] - row indices - * I Aj[nnz(A)] - column indices - * T Ax[nnz(A)] - nonzeros - * Output Arguments: - * I Bp - row pointer - * I Bj - column indices - * T Bx - nonzeros - * - * Note: - * Output arrays Bp, Bj, and Bx must be preallocated - * - * Note: - * Input: row and column indices *are not* assumed to be ordered - * - * Note: duplicate entries are carried over to the CSR represention - * - * Complexity: Linear. Specifically O(nnz(A) + max(n_row,n_col)) - * - */ -template -void coo_tocsr(const I n_row, - const I n_col, - const I nnz, - const I Ai[], - const I Aj[], - const T Ax[], - I Bp[], - I Bj[], - T Bx[]) -{ - //compute number of non-zero entries per row of A - std::fill(Bp, Bp + n_row, 0); - - for (I n = 0; n < nnz; n++){ - Bp[Ai[n]]++; - } - - //cumsum the nnz per row to get Bp[] - for(I i = 0, cumsum = 0; i < n_row; i++){ - I temp = Bp[i]; - Bp[i] = cumsum; - cumsum += temp; - } - Bp[n_row] = nnz; - - //write Aj,Ax into Bj,Bx - for(I n = 0; n < nnz; n++){ - I row = Ai[n]; - I dest = Bp[row]; - - Bj[dest] = Aj[n]; - Bx[dest] = Ax[n]; - - Bp[row]++; - } - - for(I i = 0, last = 0; i <= n_row; i++){ - I temp = Bp[i]; - Bp[i] = last; - last = temp; - } - - //now Bp,Bj,Bx form a CSR representation (with possible duplicates) -} - - - - - - -/* - * Compute Y += A*X for CSR matrix A and dense vectors X,Y - * - * - * Input Arguments: - * I n_row - number of rows in A - * I n_col - number of columns in A - * I Ap[n_row+1] - row pointer - * I Aj[nnz(A)] - column indices - * T Ax[nnz(A)] - nonzeros - * T Xx[n_col] - input vector - * - * Output Arguments: - * T Yx[n_row] - output vector - * - * Note: - * Output array Yx must be preallocated - * - * Complexity: Linear. Specifically O(nnz(A) + n_row) - * - */ -template -void csr_matvec(const I n_row, - const I n_col, - const I Ap[], - const I Aj[], - const T Ax[], - const T Xx[], - T Yx[]) -{ - for(I i = 0; i < n_row; i++){ - T sum = Yx[i]; - for(I jj = Ap[i]; jj < Ap[i+1]; jj++){ - sum += Ax[jj] * Xx[Aj[jj]]; - } - Yx[i] = sum; - } -} - - - -/* - * Compute Y += A*X for CSC matrix A and dense vectors X,Y - * - * - * Input Arguments: - * I n_row - number of rows in A - * I n_col - number of columns in A - * I Ap[n_row+1] - column pointer - * I Ai[nnz(A)] - row indices - * T Ax[n_col] - nonzeros - * T Xx[n_col] - input vector - * - * Output Arguments: - * T Yx[n_row] - output vector - * - * Note: - * Output array Yx must be preallocated - * - * Complexity: Linear. Specifically O(nnz(A) + n_col) - * - */ -template -void csc_matvec(const I n_row, - const I n_col, - const I Ap[], - const I Ai[], - const T Ax[], - const T Xx[], - T Yx[]) -{ - for(I j = 0; j < n_col; j++){ - I col_start = Ap[j]; - I col_end = Ap[j+1]; - - for(I ii = col_start; ii < col_end; ii++){ - I row = Ai[ii]; - Yx[row] += Ax[ii] * Xx[j]; - } - } -} - - - -/* - * Compute Y += A*X for DIA matrix A and dense vectors X,Y - * - * - * Input Arguments: - * I n_row - number of rows in A - * I n_col - number of columns in A - * I n_diags - number of diagonals - * I L - length of each diagonal - * I offsets[n_diags] - diagonal offsets - * T diags[n_diags,L] - nonzeros - * T Xx[n_col] - input vector - * - * Output Arguments: - * T Yx[n_row] - output vector - * - * Note: - * Output array Yx must be preallocated - * Negative offsets correspond to lower diagonals - * Positive offsets correspond to upper diagonals - * - */ -template -void dia_matvec(const I n_row, - const I n_col, - const I n_diags, - const I L, - const I offsets[], - const T diags[], - const T Xx[], - T Yx[]) -{ - for(I i = 0; i < n_diags; i++){ - const I k = offsets[i]; //diagonal offset - - const I i_start = std::max(0,-k); - const I j_start = std::max(0, k); - const I j_end = std::min(std::min(n_row + k, n_col),L); - - const I N = j_end - j_start; //number of elements to process - - const T * diag = diags + i*L + j_start; - const T * x = Xx + j_start; - T * y = Yx + i_start; - - for(I n = 0; n < N; n++){ - y[n] += diag[n] * x[n]; - } - } -} - -//template -//void bsr_tocsr(const I n_brow, -// const I n_bcol, -// const I R, -// const I C, -// const I Ap[], -// const I Aj[], -// const T Ax[], -// I Bp[], -// I Bj[] -// T Bx[]) -//{ -// const I RC = R*C; -// -// for(I brow = 0; brow < n_brow; brow++){ -// I row_size = C * (Ap[brow + 1] - Ap[brow]); -// for(I r = 0; r < R; r++){ -// Bp[R*brow + r] = RC * Ap[brow] + r * row_size -// } -// } -//} - -template -void bsr_matvec_fixed(const I n_brow, - const I n_bcol, - const I Ap[], - const I Aj[], - const T Ax[], - const T Xx[], - T Yx[]) -{ - for(I i = 0; i < R*n_brow; i++){ - Yx[i] = 0; - } - - for(I i = 0; i < n_brow; i++) { - for(I jj = Ap[i]; jj < Ap[i+1]; jj++) { - I j = Aj[jj]; - matvec(Ax + jj*R*C, Xx + j*C, Yx + i*R); - } - } -} - -/* - * Generate the table below with: - * out = '' - * N = 8 - * for i in range(N): - * out += '{' - * for j in range(N-1): - * out += ' F(%d,%d),' % (i+1,j+1) - * out += ' F(%d,%d) },\n' % (i+1,j+2) - * out = out[:-2] - * - */ - - -template -void bsr_matvec(const I n_brow, - const I n_bcol, - const I R, - const I C, - const I Ap[], - const I Aj[], - const T Ax[], - const T Xx[], - T Yx[]) -{ - assert(R > 0 && C > 0); - - if( R == 1 && C == 1 ){ - csr_matvec(n_brow, n_bcol, Ap, Aj, Ax, Xx, Yx); //use CSR for 1x1 blocksize - return; - } - -#ifdef SPARSETOOLS_TESTING -#define F(X,Y) bsr_matvec_fixed - - void (*dispatch[8][8])(I,I,const I*,const I*,const T*,const T*,T*) = \ - { - { F(1,1), F(1,2), F(1,3), F(1,4), F(1,5), F(1,6), F(1,7), F(1,8) }, - { F(2,1), F(2,2), F(2,3), F(2,4), F(2,5), F(2,6), F(2,7), F(2,8) }, - { F(3,1), F(3,2), F(3,3), F(3,4), F(3,5), F(3,6), F(3,7), F(3,8) }, - { F(4,1), F(4,2), F(4,3), F(4,4), F(4,5), F(4,6), F(4,7), F(4,8) }, - { F(5,1), F(5,2), F(5,3), F(5,4), F(5,5), F(5,6), F(5,7), F(5,8) }, - { F(6,1), F(6,2), F(6,3), F(6,4), F(6,5), F(6,6), F(6,7), F(6,8) }, - { F(7,1), F(7,2), F(7,3), F(7,4), F(7,5), F(7,6), F(7,7), F(7,8) }, - { F(8,1), F(8,2), F(8,3), F(8,4), F(8,5), F(8,6), F(8,7), F(8,8) } - }; - - if (R <= 8 && C <= 8){ - dispatch[R-1][C-1](n_brow,n_bcol,Ap,Aj,Ax,Xx,Yx); - return; - } - -#undef F -#endif - - //otherwise use general method - - for(I i = 0; i < R*n_brow; i++){ - Yx[i] = 0; - } - - for(I i = 0; i < n_brow; i++){ - const T * A = Ax + R * C * Ap[i]; - T * y = Yx + R * i; - for(I jj = Ap[i]; jj < Ap[i+1]; jj++){ - const T * x = Xx + C*Aj[jj]; - - //TODO replace this with a proper matvec - for( I r = 0; r < R; r++ ){ - T sum = 0; - for( I c = 0; c < C; c++ ){ - sum += (*A) * x[c]; - A++; - } - y[r] += sum; - } - - } - } -} - - - - - - -/* - * Compute B += A for COO matrix A, dense matrix B - * - * Input Arguments: - * I n_row - number of rows in A - * I n_col - number of columns in A - * I nnz - number of nonzeros in A - * I Ai[nnz(A)] - row indices - * I Aj[nnz(A)] - column indices - * T Ax[nnz(A)] - nonzeros - * T Bx[n_row*n_col] - dense matrix - * - */ -template -void coo_todense(const I n_row, - const I n_col, - const I nnz, - const I Ai[], - const I Aj[], - const T Ax[], - T Bx[]) -{ - for(I n = 0; n < nnz; n++){ - Bx[ n_col * Ai[n] + Aj[n] ] += Ax[n]; - } -} - - - - - -template -void get_csr_submatrix(const I n_row, - const I n_col, - const I Ap[], - const I Aj[], - const T Ax[], - const I ir0, - const I ir1, - const I ic0, - const I ic1, - std::vector* Bp, - std::vector* Bj, - std::vector* Bx) -{ - I new_n_row = ir1 - ir0; - //I new_n_col = ic1 - ic0; //currently unused - I new_nnz = 0; - I kk = 0; - - // Count nonzeros total/per row. - for(I i = 0; i < new_n_row; i++){ - I row_start = Ap[ir0+i]; - I row_end = Ap[ir0+i+1]; - - for(I jj = row_start; jj < row_end; jj++){ - if ((Aj[jj] >= ic0) && (Aj[jj] < ic1)) { - new_nnz++; - } - } - } - - // Allocate. - Bp->resize(new_n_row+1); - Bj->resize(new_nnz); - Bx->resize(new_nnz); - - // Assign. - (*Bp)[0] = 0; - for(I i = 0; i < new_n_row; i++){ - I row_start = Ap[ir0+i]; - I row_end = Ap[ir0+i+1]; - - for(I jj = row_start; jj < row_end; jj++){ - if ((Aj[jj] >= ic0) && (Aj[jj] < ic1)) { - (*Bj)[kk] = Aj[jj] - ic0; - (*Bx)[kk] = Ax[jj]; - kk++; - } - } - (*Bp)[i+1] = kk; - } -} - - - - - -/* - * Derived methods - */ -template -void csc_diagonal(const I n_row, - const I n_col, - const I Ap[], - const I Aj[], - const T Ax[], - T Yx[]) -{ csr_diagonal(n_col, n_row, Ap, Aj, Ax, Yx); } - - -template -void csc_tocsr(const I n_row, - const I n_col, - const I Ap[], - const I Ai[], - const T Ax[], - I Bp[], - I Bj[], - T Bx[]) -{ csr_tocsc(n_col, n_row, Ap, Ai, Ax, Bp, Bj, Bx); } - - -template -void csc_matmat_pass1(const I n_row, - const I n_col, - const I Ap[], - const I Ai[], - const I Bp[], - const I Bi[], - I Cp[]) -{ csr_matmat_pass1(n_col, n_row, Bp, Bi, Ap, Ai, Cp); } - -template -void csc_matmat_pass2(const I n_row, - const I n_col, - const I Ap[], - const I Ai[], - const T Ax[], - const I Bp[], - const I Bi[], - const T Bx[], - I Cp[], - I Ci[], - T Cx[]) -{ csr_matmat_pass2(n_col, n_row, Bp, Bi, Bx, Ap, Ai, Ax, Cp, Ci, Cx); } - - -template -void coo_tocsc(const I n_row, - const I n_col, - const I nnz, - const I Ai[], - const I Aj[], - const T Ax[], - I Bp[], - I Bi[], - T Bx[]) -{ coo_tocsr(n_col, n_row, nnz, Aj, Ai, Ax, Bp, Bi, Bx); } - - - -template -void csc_elmul_csc(const I n_row, const I n_col, - const I Ap[], const I Ai[], const T Ax[], - const I Bp[], const I Bi[], const T Bx[], - I Cp[], I Ci[], T Cx[]) -{ - csr_elmul_csr(n_col, n_row, Ap, Ai, Ax, Bp, Bi, Bx, Cp, Ci, Cx); -} - -template -void csc_eldiv_csc(const I n_row, const I n_col, - const I Ap[], const I Ai[], const T Ax[], - const I Bp[], const I Bi[], const T Bx[], - I Cp[], I Ci[], T Cx[]) -{ - csr_eldiv_csr(n_col, n_row, Ap, Ai, Ax, Bp, Bi, Bx, Cp, Ci, Cx); -} - - -template -void csc_plus_csc(const I n_row, const I n_col, - const I Ap[], const I Ai[], const T Ax[], - const I Bp[], const I Bi[], const T Bx[], - I Cp[], I Ci[], T Cx[]) -{ - csr_plus_csr(n_col, n_row, Ap, Ai, Ax, Bp, Bi, Bx, Cp, Ci, Cx); -} - -template -void csc_minus_csc(const I n_row, const I n_col, - const I Ap[], const I Ai[], const T Ax[], - const I Bp[], const I Bi[], const T Bx[], - I Cp[], I Ci[], T Cx[]) -{ - csr_minus_csr(n_col, n_row, Ap, Ai, Ax, Bp, Bi, Bx, Cp, Ci, Cx); -} - - - - -/* - * These are sparsetools functions that are not currently used - * - */ - -///* -// * Compute C = A*B for CSR matrices A,B -// * -// * -// * Input Arguments: -// * I n_row - number of rows in A -// * I n_col - number of columns in B (hence C is n_row by n_col) -// * I Ap[n_row+1] - row pointer -// * I Aj[nnz(A)] - column indices -// * T Ax[nnz(A)] - nonzeros -// * I Bp[?] - row pointer -// * I Bj[nnz(B)] - column indices -// * T Bx[nnz(B)] - nonzeros -// * Output Arguments: -// * vec Cp - row pointer -// * vec Cj - column indices -// * vec Cx - nonzeros -// * -// * Note: -// * Output arrays Cp, Cj, and Cx will be allocated within in the method -// * -// * Note: -// * Input: A and B column indices *are not* assumed to be in sorted order -// * Output: C column indices *are not* assumed to be in sorted order -// * Cx will not contain any zero entries -// * -// * Complexity: O(n_row*K^2 + max(n_row,n_col)) -// * where K is the maximum nnz in a row of A -// * and column of B. -// * -// * -// * This implementation closely follows the SMMP algorithm: -// * -// * "Sparse Matrix Multiplication Package (SMMP)" -// * Randolph E. Bank and Craig C. Douglas -// * -// * http://citeseer.ist.psu.edu/445062.html -// * http://www.mgnet.org/~douglas/ccd-codes.html -// * -// */ -//template -//void csrmucsr(const I n_row, -// const I n_col, -// const I Ap[], -// const I Aj[], -// const T Ax[], -// const I Bp[], -// const I Bj[], -// const T Bx[], -// std::vector* Cp, -// std::vector* Cj, -// std::vector* Cx) -//{ -// Cp->resize(n_row+1,0); -// -// std::vector next(n_col,-1); -// std::vector sums(n_col, 0); -// -// for(I i = 0; i < n_row; i++){ -// I head = -2; -// I length = 0; -// -// I jj_start = Ap[i]; -// I jj_end = Ap[i+1]; -// for(I jj = jj_start; jj < jj_end; jj++){ -// I j = Aj[jj]; -// -// I kk_start = Bp[j]; -// I kk_end = Bp[j+1]; -// for(I kk = kk_start; kk < kk_end; kk++){ -// I k = Bj[kk]; -// -// sums[k] += Ax[jj]*Bx[kk]; -// -// if(next[k] == -1){ -// next[k] = head; -// head = k; -// length++; -// } -// } -// } -// -// for(I jj = 0; jj < length; jj++){ -// if(sums[head] != 0){ -// Cj->push_back(head); -// Cx->push_back(sums[head]); -// } -// -// I temp = head; -// head = next[head]; -// -// next[temp] = -1; //clear arrays -// sums[temp] = 0; -// } -// -// (*Cp)[i+1] = Cx->size(); -// } -//} -// -// -// -// -// -// -// -// -// -// -// -// -// -///* -// * Compute M = A for CSR matrix A, dense matrix M -// * -// * Input Arguments: -// * I n_row - number of rows in A -// * I n_col - number of columns in A -// * I Ap[n_row+1] - row pointer -// * I Aj[nnz(A)] - column indices -// * T Ax[nnz(A)] - nonzeros -// * T Mx[n_row*n_col] - dense matrix -// * -// * Note: -// * Output array Mx is assumed to be allocated and -// * initialized to 0 by the caller. -// * -// */ -//template -//void csr_todense(const I n_row, -// const I n_col, -// const I Ap[], -// const I Aj[], -// const T Ax[], -// T Mx[]) -//{ -// I row_base = 0; -// for(I i = 0; i < n_row; i++){ -// I row_start = Ap[i]; -// I row_end = Ap[i+1]; -// for(I jj = row_start; jj < row_end; jj++){ -// I j = Aj[jj]; -// Mx[row_base + j] = Ax[jj]; -// } -// row_base += n_col; -// } -//} -///* -// * Compute B = A for CSR matrix A, COO matrix B -// * -// * Also, with the appropriate arguments can also be used to: -// * - convert CSC->COO -// * -// * Input Arguments: -// * I n_row - number of rows in A -// * I n_col - number of columns in A -// * I Ap[n_row+1] - row pointer -// * I Aj[nnz(A)] - column indices -// * T Ax[nnz(A)] - nonzeros -// * -// * Output Arguments: -// * vec Bi - row indices -// * vec Bj - column indices -// * vec Bx - nonzeros -// * -// * Note: -// * Output arrays Bi, Bj, Bx will be allocated within in the method -// * -// * Note: -// * Complexity: Linear. -// * -// */ -//template -//void csr_tocoo(const I n_row, -// const I n_col, -// const I Ap[], -// const I Aj[], -// const T Ax[], -// std::vector* Bi, -// std::vector* Bj, -// std::vector* Bx) -//{ -// I nnz = Ap[n_row]; -// Bi->reserve(nnz); -// Bi->reserve(nnz); -// Bx->reserve(nnz); -// for(I i = 0; i < n_row; i++){ -// I row_start = Ap[i]; -// I row_end = Ap[i+1]; -// for(I jj = row_start; jj < row_end; jj++){ -// Bi->push_back(i); -// Bj->push_back(Aj[jj]); -// Bx->push_back(Ax[jj]); -// } -// } -//} -// -// -///* -// * Construct CSC matrix A from diagonals -// * -// * Input Arguments: -// * I n_row - number of rows in A -// * I n_col - number of columns in A -// * I n_diags - number of diagonals -// * I diags_indx[n_diags] - where to place each diagonal -// * T diags[n_diags][min(n_row,n_col)] - diagonals -// * -// * Output Arguments: -// * vec Ap - row pointer -// * vec Aj - column indices -// * vec Ax - nonzeros -// * -// * Note: -// * Output arrays Ap, Aj, Ax will be allocated within in the method -// * -// * Note: -// * Output: row indices are not in sorted order -// * -// * Complexity: Linear -// * -// */ -//template -//void spdiags(const I n_row, -// const I n_col, -// const I n_diag, -// const I offsets[], -// const T diags[], -// std::vector * Ap, -// std::vector * Ai, -// std::vector * Ax) -//{ -// const I diags_length = std::min(n_row,n_col); -// Ap->push_back(0); -// -// for(I i = 0; i < n_col; i++){ -// for(I j = 0; j < n_diag; j++){ -// if(offsets[j] <= 0){ //sub-diagonal -// I row = i - offsets[j]; -// if (row >= n_row){ continue; } -// -// Ai->push_back(row); -// Ax->push_back(diags[j*diags_length + i]); -// } else { //super-diagonal -// I row = i - offsets[j]; -// if (row < 0 || row >= n_row){ continue; } -// Ai->push_back(row); -// Ax->push_back(diags[j*diags_length + row]); -// } -// } -// Ap->push_back(Ai->size()); -// } -//} -// -//template -//void bsr_binop_bsr_fixed(const I n_brow, const I n_bcol, -// const I Ap[], const I Aj[], const T Ax[], -// const I Bp[], const I Bj[], const T Bx[], -// I Cp[], I Cj[], T Cx[], -// const bin_op& op) -//{ -// //Method that works for unsorted indices -// const I RC = R*C; -// T zeros[RC] = {0}; -// Cp[0] = 0; -// I nnz = 0; -// -// std::cout << "using bsr_ fixed" << std::endl; -// for(I i = 0; i < n_brow; i++){ -// I A_pos = Ap[i]; -// I B_pos = Bp[i]; -// I A_end = Ap[i+1]; -// I B_end = Bp[i+1]; -// -// I A_j = Aj[A_pos]; -// I B_j = Bj[B_pos]; -// -// //while not finished with either row -// while(A_pos < A_end && B_pos < B_end){ -// if(A_j == B_j){ -// Cj[nnz] = A_j; -// vec_binop_vec (Ax + RC*A_pos, Bx + RC*B_pos, Cx + RC*nnz, op); -// if( is_nonzero_block(Cx + RC*nnz,RC) ){ -// nnz++; -// } -// A_j = Aj[++A_pos]; -// B_j = Bj[++B_pos]; -// } else if (A_j < B_j) { -// Cj[nnz] = A_j; -// vec_binop_vec (Ax + RC*A_pos, zeros, Cx + RC*nnz, op); -// if( is_nonzero_block(Cx + RC*nnz,RC) ){ -// nnz++; -// } -// A_j = Aj[++A_pos]; -// } else { -// //B_j < A_j -// Cj[nnz] = B_j; -// vec_binop_vec (zeros, Bx + RC*A_pos, Cx + RC*nnz, op); -// if( is_nonzero_block(Cx + RC*nnz,RC) ){ -// nnz++; -// } -// B_j = Bj[++B_pos]; -// } -// } -// -// //tail -// while(A_pos < A_end){ -// Cj[nnz] = A_j; -// vec_binop_vec (Ax + RC*A_pos, zeros, Cx + RC*nnz, op); -// if( is_nonzero_block(Cx + RC*nnz,RC) ){ -// nnz++; -// } -// A_j = Aj[++A_pos]; -// } -// while(B_pos < B_end){ -// Cj[nnz] = B_j; -// vec_binop_vec (zeros, Bx + RC*A_pos, Cx + RC*nnz, op); -// if( is_nonzero_block(Cx + RC*nnz,RC) ){ -// nnz++; -// } -// B_j = Bj[++B_pos]; -// } -// -// Cp[i+1] = nnz; -// } -//} - -#endif Modified: trunk/scipy/sparse/sparsetools/sparsetools.i =================================================================== --- trunk/scipy/sparse/sparsetools/sparsetools.i 2008-03-18 10:56:47 UTC (rev 4034) +++ trunk/scipy/sparse/sparsetools/sparsetools.i 2008-03-18 11:48:06 UTC (rev 4035) @@ -162,7 +162,13 @@ -%include "sparsetools.h" +/*%include "sparsetools.h"*/ +%include "csr.h" +%include "csc.h" +%include "coo.h" +%include "bsr.h" +%include "dia.h" + /* * Order is important here, list int before float, float before * double, scalar before complex, etc. From scipy-svn at scipy.org Tue Mar 18 08:28:31 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Tue, 18 Mar 2008 07:28:31 -0500 (CDT) Subject: [Scipy-svn] r4036 - trunk/scipy/sparse/sparsetools Message-ID: <20080318122831.A275F39C3FD@new.scipy.org> Author: wnbell Date: 2008-03-18 07:28:26 -0500 (Tue, 18 Mar 2008) New Revision: 4036 Modified: trunk/scipy/sparse/sparsetools/coo.h trunk/scipy/sparse/sparsetools/csc.h Log: fixed minor sparsetools error Modified: trunk/scipy/sparse/sparsetools/coo.h =================================================================== --- trunk/scipy/sparse/sparsetools/coo.h 2008-03-18 11:48:06 UTC (rev 4035) +++ trunk/scipy/sparse/sparsetools/coo.h 2008-03-18 12:28:26 UTC (rev 4036) @@ -76,6 +76,17 @@ //now Bp,Bj,Bx form a CSR representation (with possible duplicates) } +template +void coo_tocsc(const I n_row, + const I n_col, + const I nnz, + const I Ai[], + const I Aj[], + const T Ax[], + I Bp[], + I Bi[], + T Bx[]) +{ coo_tocsr(n_col, n_row, nnz, Aj, Ai, Ax, Bp, Bi, Bx); } /* * Compute B += A for COO matrix A, dense matrix B Modified: trunk/scipy/sparse/sparsetools/csc.h =================================================================== --- trunk/scipy/sparse/sparsetools/csc.h 2008-03-18 11:48:06 UTC (rev 4035) +++ trunk/scipy/sparse/sparsetools/csc.h 2008-03-18 12:28:26 UTC (rev 4036) @@ -97,17 +97,6 @@ { csr_matmat_pass2(n_col, n_row, Bp, Bi, Bx, Ap, Ai, Ax, Cp, Ci, Cx); } -template -void coo_tocsc(const I n_row, - const I n_col, - const I nnz, - const I Ai[], - const I Aj[], - const T Ax[], - I Bp[], - I Bi[], - T Bx[]) -{ coo_tocsr(n_col, n_row, nnz, Aj, Ai, Ax, Bp, Bi, Bx); } From scipy-svn at scipy.org Tue Mar 18 10:25:39 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Tue, 18 Mar 2008 09:25:39 -0500 (CDT) Subject: [Scipy-svn] r4038 - trunk/scipy/sparse/linalg/eigen/arpack/tests Message-ID: <20080318142539.A976F39C1B5@new.scipy.org> Author: wnbell Date: 2008-03-18 09:25:34 -0500 (Tue, 18 Mar 2008) New Revision: 4038 Modified: trunk/scipy/sparse/linalg/eigen/arpack/tests/test_arpack.py Log: made arpack unittest slightly more permissive Modified: trunk/scipy/sparse/linalg/eigen/arpack/tests/test_arpack.py =================================================================== --- trunk/scipy/sparse/linalg/eigen/arpack/tests/test_arpack.py 2008-03-18 13:44:22 UTC (rev 4037) +++ trunk/scipy/sparse/linalg/eigen/arpack/tests/test_arpack.py 2008-03-18 14:25:34 UTC (rev 4038) @@ -31,7 +31,7 @@ # precision for tests -_ndigits = {'f':5, 'd':12, 'F':5, 'D':12} +_ndigits = {'f':4, 'd':12, 'F':4, 'D':12} class TestArpack(TestCase): From scipy-svn at scipy.org Wed Mar 19 09:16:41 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Wed, 19 Mar 2008 08:16:41 -0500 (CDT) Subject: [Scipy-svn] r4039 - trunk/scipy/sparse/sparsetools Message-ID: <20080319131641.15E73C7C022@new.scipy.org> Author: cdavid Date: 2008-03-19 08:16:32 -0500 (Wed, 19 Mar 2008) New Revision: 4039 Added: trunk/scipy/sparse/sparsetools/SConstruct trunk/scipy/sparse/sparsetools/setupscons.py Log: Update scons build for sparsetools. Copied: trunk/scipy/sparse/sparsetools/SConstruct (from rev 4038, trunk/scipy/sparse/SConstruct) =================================================================== --- trunk/scipy/sparse/SConstruct 2008-03-18 14:25:34 UTC (rev 4038) +++ trunk/scipy/sparse/sparsetools/SConstruct 2008-03-19 13:16:32 UTC (rev 4039) @@ -0,0 +1,12 @@ +# Last Change: Wed Mar 05 09:00 PM 2008 J +# vim:syntax=python +from numpy.distutils.misc_util import get_numpy_include_dirs +from numscons import GetNumpyEnvironment + +env = GetNumpyEnvironment(ARGUMENTS) + +env.AppendUnique(CPPPATH = get_numpy_include_dirs()) + +for fmt in ['csr','csc','coo','bsr','dia']: + sources = [ fmt + '_wrap.cxx' ] + env.NumpyPythonExtension('_%s' % fmt, source = sources) Added: trunk/scipy/sparse/sparsetools/setupscons.py =================================================================== --- trunk/scipy/sparse/sparsetools/setupscons.py 2008-03-18 14:25:34 UTC (rev 4038) +++ trunk/scipy/sparse/sparsetools/setupscons.py 2008-03-19 13:16:32 UTC (rev 4039) @@ -0,0 +1,19 @@ +#!/usr/bin/env python + +from os.path import join +import sys + +def configuration(parent_package='',top_path=None): + import numpy + from numpy.distutils.misc_util import Configuration + + config = Configuration('sparse',parent_package,top_path, + setup_name = 'setupscons.py') + + config.add_sconscript('SConstruct') + + return config + +if __name__ == '__main__': + from numpy.distutils.core import setup + setup(**configuration(top_path='').todict()) Property changes on: trunk/scipy/sparse/sparsetools/setupscons.py ___________________________________________________________________ Name: svn:executable + * From scipy-svn at scipy.org Wed Mar 19 10:16:29 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Wed, 19 Mar 2008 09:16:29 -0500 (CDT) Subject: [Scipy-svn] r4040 - trunk/scipy/signal Message-ID: <20080319141629.015A639C30D@new.scipy.org> Author: stefan Date: 2008-03-19 09:16:20 -0500 (Wed, 19 Mar 2008) New Revision: 4040 Modified: trunk/scipy/signal/wavelets.py Log: Fix Morlet wavelet. Modified: trunk/scipy/signal/wavelets.py =================================================================== --- trunk/scipy/signal/wavelets.py 2008-03-19 13:16:32 UTC (rev 4039) +++ trunk/scipy/signal/wavelets.py 2008-03-19 14:16:20 UTC (rev 4040) @@ -172,19 +172,19 @@ def morlet(M, w=5.0, s=1.0, complete=True): """Complex Morlet wavelet. - :Parameters: - M : int - Length of the wavelet. - w : float - Omega0 - s : float - Scaling factor, windowed from -s*2*pi to +s*2*pi. - complete : bool - Whether to use the complete or the standard version. + Parameters + ---------- + M : int + Length of the wavelet. + w : float + Omega0 + s : float + Scaling factor, windowed from -s*2*pi to +s*2*pi. + complete : bool + Whether to use the complete or the standard version. Notes: ------ - The standard version: pi**-0.25 * exp(1j*w*x) * exp(-0.5*(x**2)) @@ -210,7 +210,7 @@ output = exp(1j*w*x) if complete: - x -= exp(-0.5*(w**2)) + output -= exp(-0.5*(w**2)) output *= exp(-0.5*(x**2)) * pi**(-0.25) From scipy-svn at scipy.org Wed Mar 19 18:21:38 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Wed, 19 Mar 2008 17:21:38 -0500 (CDT) Subject: [Scipy-svn] r4041 - trunk/scipy/special/cephes Message-ID: <20080319222138.5127339C10D@new.scipy.org> Author: cookedm Date: 2008-03-19 17:21:34 -0500 (Wed, 19 Mar 2008) New Revision: 4041 Modified: trunk/scipy/special/cephes/jv.c Log: (scipy.special) Formatting of cephes files is inscrutable. Run jv.c through (gnu)indent -kr in preparation of working on #623 Modified: trunk/scipy/special/cephes/jv.c =================================================================== --- trunk/scipy/special/cephes/jv.c 2008-03-19 14:16:20 UTC (rev 4040) +++ trunk/scipy/special/cephes/jv.c 2008-03-19 22:21:34 UTC (rev 4041) @@ -57,23 +57,23 @@ #endif #ifdef ANSIPROT -extern int airy ( double, double *, double *, double *, double * ); -extern double fabs ( double ); -extern double floor ( double ); -extern double frexp ( double, int * ); -extern double polevl ( double, void *, int ); -extern double j0 ( double ); -extern double j1 ( double ); -extern double sqrt ( double ); -extern double cbrt ( double ); -extern double exp ( double ); -extern double log ( double ); -extern double sin ( double ); -extern double cos ( double ); -extern double acos ( double ); -extern double pow ( double, double ); -extern double gamma ( double ); -extern double lgam ( double ); +extern int airy(double, double *, double *, double *, double *); +extern double fabs(double); +extern double floor(double); +extern double frexp(double, int *); +extern double polevl(double, void *, int); +extern double j0(double); +extern double j1(double); +extern double sqrt(double); +extern double cbrt(double); +extern double exp(double); +extern double log(double); +extern double sin(double); +extern double cos(double); +extern double acos(double); +extern double pow(double, double); +extern double gamma(double); +extern double lgam(double); static double recur(double *, double, double *, int); static double jvs(double, double); static double hankel(double, double); @@ -89,278 +89,241 @@ extern double MAXNUM, MACHEP, MINLOG, MAXLOG; #define BIG 1.44115188075855872E+17 -double jv( n, x ) -double n, x; +double jv(double n, double x) { -double k, q, t, y, an; -int i, sign, nint; + double k, q, t, y, an; + int i, sign, nint; -nint = 0; /* Flag for integer n */ -sign = 1; /* Flag for sign inversion */ -an = fabs( n ); -y = floor( an ); -if( y == an ) - { + nint = 0; /* Flag for integer n */ + sign = 1; /* Flag for sign inversion */ + an = fabs(n); + y = floor(an); + if (y == an) { nint = 1; - i = an - 16384.0 * floor( an/16384.0 ); - if( n < 0.0 ) - { - if( i & 1 ) - sign = -sign; - n = an; - } - if( x < 0.0 ) - { - if( i & 1 ) - sign = -sign; - x = -x; - } - if( n == 0.0 ) - return( j0(x) ); - if( n == 1.0 ) - return( sign * j1(x) ); + i = an - 16384.0 * floor(an / 16384.0); + if (n < 0.0) { + if (i & 1) + sign = -sign; + n = an; } + if (x < 0.0) { + if (i & 1) + sign = -sign; + x = -x; + } + if (n == 0.0) + return (j0(x)); + if (n == 1.0) + return (sign * j1(x)); + } -if( (x < 0.0) && (y != an) ) - { - mtherr( "Jv", DOMAIN ); + if ((x < 0.0) && (y != an)) { + mtherr("Jv", DOMAIN); y = 0.0; goto done; - } + } -y = fabs(x); + y = fabs(x); -if( y*y < fabs(n+1)*MACHEP ) { - return pow(0.5*x, n) / gamma(n+1); -} + if (y * y < fabs(n + 1) * MACHEP) { + return pow(0.5 * x, n) / gamma(n + 1); + } -k = 3.6 * sqrt(y); -t = 3.6 * sqrt(an); -if( (y < t) && (an > 21.0) ) - return( sign * jvs(n,x) ); -if( (an < k) && (y > 21.0) ) - return( sign * hankel(n,x) ); + k = 3.6 * sqrt(y); + t = 3.6 * sqrt(an); + if ((y < t) && (an > 21.0)) + return (sign * jvs(n, x)); + if ((an < k) && (y > 21.0)) + return (sign * hankel(n, x)); -if( an < 500.0 ) - { -/* Note: if x is too large, the continued - * fraction will fail; but then the - * Hankel expansion can be used. - */ - if( nint != 0 ) - { - k = 0.0; - q = recur( &n, x, &k, 1 ); - if( k == 0.0 ) - { - y = j0(x)/q; - goto done; - } - if( k == 1.0 ) - { - y = j1(x)/q; - goto done; - } - } + if (an < 500.0) { + /* Note: if x is too large, the continued fraction will fail; but then the + Hankel expansion can be used. */ + if (nint != 0) { + k = 0.0; + q = recur(&n, x, &k, 1); + if (k == 0.0) { + y = j0(x) / q; + goto done; + } + if (k == 1.0) { + y = j1(x) / q; + goto done; + } + } -if( an > 2.0 * y ) - goto rlarger; + if (an > 2.0 * y) + goto rlarger; - if( (n >= 0.0) && (n < 20.0) - && (y > 6.0) && (y < 20.0) ) - { -/* Recur backwards from a larger value of n - */ + if ((n >= 0.0) && (n < 20.0) + && (y > 6.0) && (y < 20.0)) { + /* Recur backwards from a larger value of n */ rlarger: - k = n; + k = n; - y = y + an + 1.0; - if( y < 30.0 ) - y = 30.0; - y = n + floor(y-n); - q = recur( &y, x, &k, 0 ); - y = jvs(y,x) * q; - goto done; - } + y = y + an + 1.0; + if (y < 30.0) + y = 30.0; + y = n + floor(y - n); + q = recur(&y, x, &k, 0); + y = jvs(y, x) * q; + goto done; + } - if( k <= 30.0 ) - { - k = 2.0; - } - else if( k < 90.0 ) - { - k = (3*k)/4; - } - if( an > (k + 3.0) ) - { - if( n < 0.0 ) - k = -k; - q = n - floor(n); - k = floor(k) + q; - if( n > 0.0 ) - q = recur( &n, x, &k, 1 ); - else - { - t = k; - k = n; - q = recur( &t, x, &k, 1 ); - k = t; - } - if( q == 0.0 ) - { -underf: - y = 0.0; - goto done; - } - } - else - { + if (k <= 30.0) { + k = 2.0; + } else if (k < 90.0) { + k = (3 * k) / 4; + } + if (an > (k + 3.0)) { + if (n < 0.0) + k = -k; + q = n - floor(n); + k = floor(k) + q; + if (n > 0.0) + q = recur(&n, x, &k, 1); + else { + t = k; k = n; - q = 1.0; - } + q = recur(&t, x, &k, 1); + k = t; + } + if (q == 0.0) { + underf: + y = 0.0; + goto done; + } + } else { + k = n; + q = 1.0; + } /* boundary between convergence of * power series and Hankel expansion */ y = fabs(k); - if( y < 26.0 ) - t = (0.0083*y + 0.09)*y + 12.9; + if (y < 26.0) + t = (0.0083 * y + 0.09) * y + 12.9; else - t = 0.9 * y; + t = 0.9 * y; - if( x > t ) - y = hankel(k,x); + if (x > t) + y = hankel(k, x); else - y = jvs(k,x); + y = jvs(k, x); #if DEBUG -printf( "y = %.16e, recur q = %.16e\n", y, q ); + printf("y = %.16e, recur q = %.16e\n", y, q); #endif - if( n > 0.0 ) - y /= q; + if (n > 0.0) + y /= q; else - y *= q; - } + y *= q; + } -else - { -/* For large n, use the uniform expansion - * or the transitional expansion. - * But if x is of the order of n**2, - * these may blow up, whereas the - * Hankel expansion will then work. - */ - if( n < 0.0 ) - { - mtherr( "Jv", TLOSS ); - y = 0.0; - goto done; - } - t = x/n; + else { + /* For large n, use the uniform expansion or the transitional expansion. + But if x is of the order of n**2, these may blow up, whereas the + Hankel expansion will then work. + */ + if (n < 0.0) { + mtherr("Jv", TLOSS); + y = 0.0; + goto done; + } + t = x / n; t /= n; - if( t > 0.3 ) - y = hankel(n,x); + if (t > 0.3) + y = hankel(n, x); else - y = jnx(n,x); - } + y = jnx(n, x); + } -done: return( sign * y); + done:return (sign * y); } /* Reduce the order by backward recurrence. * AMS55 #9.1.27 and 9.1.73. */ -static double recur( n, x, newn, cancel ) -double *n; -double x; -double *newn; -int cancel; +static double recur(double *n, double x, double *newn, int cancel) { -double pkm2, pkm1, pk, qkm2, qkm1; + double pkm2, pkm1, pk, qkm2, qkm1; /* double pkp1; */ -double k, ans, qk, xk, yk, r, t, kf; -static double big = BIG; -int nflag, ctr; + double k, ans, qk, xk, yk, r, t, kf; + static double big = BIG; + int nflag, ctr; /* continued fraction for Jn(x)/Jn-1(x) */ -if( *n < 0.0 ) + if (*n < 0.0) nflag = 1; -else + else nflag = 0; -fstart: + fstart: #if DEBUG -printf( "recur: n = %.6e, newn = %.6e, cfrac = ", *n, *newn ); + printf("recur: n = %.6e, newn = %.6e, cfrac = ", *n, *newn); #endif -pkm2 = 0.0; -qkm2 = 1.0; -pkm1 = x; -qkm1 = *n + *n; -xk = -x * x; -yk = qkm1; -ans = 1.0; -ctr = 0; -do - { + pkm2 = 0.0; + qkm2 = 1.0; + pkm1 = x; + qkm1 = *n + *n; + xk = -x * x; + yk = qkm1; + ans = 1.0; + ctr = 0; + do { yk += 2.0; - pk = pkm1 * yk + pkm2 * xk; - qk = qkm1 * yk + qkm2 * xk; + pk = pkm1 * yk + pkm2 * xk; + qk = qkm1 * yk + qkm2 * xk; pkm2 = pkm1; pkm1 = pk; qkm2 = qkm1; qkm1 = qk; - if( qk != 0 ) - r = pk/qk; + if (qk != 0) + r = pk / qk; else - r = 0.0; - if( r != 0 ) - { - t = fabs( (ans - r)/r ); - ans = r; - } - else - t = 1.0; + r = 0.0; + if (r != 0) { + t = fabs((ans - r) / r); + ans = r; + } else + t = 1.0; - if( ++ctr > 1000 ) - { - mtherr( "jv", UNDERFLOW ); - goto done; - } - if( t < MACHEP ) - goto done; + if (++ctr > 1000) { + mtherr("jv", UNDERFLOW); + goto done; + } + if (t < MACHEP) + goto done; - if( fabs(pk) > big ) - { - pkm2 /= big; - pkm1 /= big; - qkm2 /= big; - qkm1 /= big; - } + if (fabs(pk) > big) { + pkm2 /= big; + pkm1 /= big; + qkm2 /= big; + qkm1 /= big; } -while( t > MACHEP ); + } + while (t > MACHEP); -done: + done: #if DEBUG -printf( "%.6e\n", ans ); + printf("%.6e\n", ans); #endif -/* Change n to n-1 if n < 0 and the continued fraction is small - */ -if( nflag > 0 ) - { - if( fabs(ans) < 0.125 ) - { - nflag = -1; - *n = *n - 1.0; - goto fstart; - } + /* Change n to n-1 if n < 0 and the continued fraction is small */ + if (nflag > 0) { + if (fabs(ans) < 0.125) { + nflag = -1; + *n = *n - 1.0; + goto fstart; } + } -kf = *newn; + kf = *newn; /* backward recurrence * 2k @@ -368,14 +331,13 @@ * k-1 x k k+1 */ -pk = 1.0; -pkm1 = 1.0/ans; -k = *n - 1.0; -r = 2 * k; -do - { - pkm2 = (pkm1 * r - pk * x) / x; - /* pkp1 = pk; */ + pk = 1.0; + pkm1 = 1.0 / ans; + k = *n - 1.0; + r = 2 * k; + do { + pkm2 = (pkm1 * r - pk * x) / x; + /* pkp1 = pk; */ pk = pkm1; pkm1 = pkm2; r -= 2.0; @@ -393,26 +355,24 @@ } */ k -= 1.0; - } -while( k > (kf + 0.5) ); + } + while (k > (kf + 0.5)); /* Take the larger of the last two iterates * on the theory that it may have less cancellation error. */ -if( cancel ) - { - if( (kf >= 0.0) && (fabs(pk) > fabs(pkm1)) ) - { - k += 1.0; - pkm2 = pk; - } + if (cancel) { + if ((kf >= 0.0) && (fabs(pk) > fabs(pkm1))) { + k += 1.0; + pkm2 = pk; } -*newn = k; + } + *newn = k; #if DEBUG -printf( "newn %.6e rans %.6e\n", k, pkm2 ); + printf("newn %.6e rans %.6e\n", k, pkm2); #endif -return( pkm2 ); + return (pkm2); } @@ -424,73 +384,65 @@ extern double PI; extern int sgngam; -static double jvs( n, x ) -double n, x; +static double jvs(double n, double x) { -double t, u, y, z, k; -int ex; + double t, u, y, z, k; + int ex; -z = -x * x / 4.0; -u = 1.0; -y = u; -k = 1.0; -t = 1.0; + z = -x * x / 4.0; + u = 1.0; + y = u; + k = 1.0; + t = 1.0; -while( t > MACHEP ) - { - u *= z / (k * (n+k)); + while (t > MACHEP) { + u *= z / (k * (n + k)); y += u; k += 1.0; - if( y != 0 ) - t = fabs( u/y ); - } + if (y != 0) + t = fabs(u / y); + } #if DEBUG -printf( "power series=%.5e ", y ); + printf("power series=%.5e ", y); #endif -t = frexp( 0.5*x, &ex ); -ex = ex * n; -if( (ex > -1023) - && (ex < 1023) - && (n > 0.0) - && (n < (MAXGAM-1.0)) ) - { - t = pow( 0.5*x, n ) / gamma( n + 1.0 ); + t = frexp(0.5 * x, &ex); + ex = ex * n; + if ((ex > -1023) + && (ex < 1023) + && (n > 0.0) + && (n < (MAXGAM - 1.0))) { + t = pow(0.5 * x, n) / gamma(n + 1.0); #if DEBUG -printf( "pow(.5*x, %.4e)/gamma(n+1)=%.5e\n", n, t ); + printf("pow(.5*x, %.4e)/gamma(n+1)=%.5e\n", n, t); #endif y *= t; - } -else - { + } else { #if DEBUG - z = n * log(0.5*x); - k = lgam( n+1.0 ); + z = n * log(0.5 * x); + k = lgam(n + 1.0); t = z - k; - printf( "log pow=%.5e, lgam(%.4e)=%.5e\n", z, n+1.0, k ); + printf("log pow=%.5e, lgam(%.4e)=%.5e\n", z, n + 1.0, k); #else - t = n * log(0.5*x) - lgam(n + 1.0); + t = n * log(0.5 * x) - lgam(n + 1.0); #endif - if( y < 0 ) - { - sgngam = -sgngam; - y = -y; - } + if (y < 0) { + sgngam = -sgngam; + y = -y; + } t += log(y); #if DEBUG -printf( "log y=%.5e\n", log(y) ); + printf("log y=%.5e\n", log(y)); #endif - if( t < -MAXLOG ) - { - return( 0.0 ); - } - if( t > MAXLOG ) - { - mtherr( "Jv", OVERFLOW ); - return( MAXNUM ); - } - y = sgngam * exp( t ); + if (t < -MAXLOG) { + return (0.0); } -return(y); + if (t > MAXLOG) { + mtherr("Jv", OVERFLOW); + return (MAXNUM); + } + y = sgngam * exp(t); + } + return (y); } /* Hankel's asymptotic expansion @@ -498,63 +450,59 @@ * AMS55 #9.2.5. */ -static double hankel( n, x ) -double n, x; +static double hankel(double n, double x) { -double t, u, z, k, sign, conv; -double p, q, j, m, pp, qq; -int flag; + double t, u, z, k, sign, conv; + double p, q, j, m, pp, qq; + int flag; -m = 4.0*n*n; -j = 1.0; -z = 8.0 * x; -k = 1.0; -p = 1.0; -u = (m - 1.0)/z; -q = u; -sign = 1.0; -conv = 1.0; -flag = 0; -t = 1.0; -pp = 1.0e38; -qq = 1.0e38; + m = 4.0 * n * n; + j = 1.0; + z = 8.0 * x; + k = 1.0; + p = 1.0; + u = (m - 1.0) / z; + q = u; + sign = 1.0; + conv = 1.0; + flag = 0; + t = 1.0; + pp = 1.0e38; + qq = 1.0e38; -while( t > MACHEP ) - { + while (t > MACHEP) { k += 2.0; j += 1.0; sign = -sign; - u *= (m - k * k)/(j * z); + u *= (m - k * k) / (j * z); p += sign * u; k += 2.0; j += 1.0; - u *= (m - k * k)/(j * z); + u *= (m - k * k) / (j * z); q += sign * u; - t = fabs(u/p); - if( t < conv ) - { - conv = t; - qq = q; - pp = p; - flag = 1; - } + t = fabs(u / p); + if (t < conv) { + conv = t; + qq = q; + pp = p; + flag = 1; + } /* stop if the terms start getting larger */ - if( (flag != 0) && (t > conv) ) - { + if ((flag != 0) && (t > conv)) { #if DEBUG - printf( "Hankel: convergence to %.4E\n", conv ); + printf("Hankel: convergence to %.4E\n", conv); #endif - goto hank1; - } - } + goto hank1; + } + } -hank1: -u = x - (0.5*n + 0.25) * PI; -t = sqrt( 2.0/(PI*x) ) * ( pp * cos(u) - qq * sin(u) ); + hank1: + u = x - (0.5 * n + 0.25) * PI; + t = sqrt(2.0 / (PI * x)) * (pp * cos(u) - qq * sin(u)); #if DEBUG -printf( "hank: %.6e\n", t ); + printf("hank: %.6e\n", t); #endif -return( t ); + return (t); } @@ -563,229 +511,213 @@ */ static double lambda[] = { - 1.0, - 1.041666666666666666666667E-1, - 8.355034722222222222222222E-2, - 1.282265745563271604938272E-1, - 2.918490264641404642489712E-1, - 8.816272674437576524187671E-1, - 3.321408281862767544702647E+0, - 1.499576298686255465867237E+1, - 7.892301301158651813848139E+1, - 4.744515388682643231611949E+2, - 3.207490090890661934704328E+3 + 1.0, + 1.041666666666666666666667E-1, + 8.355034722222222222222222E-2, + 1.282265745563271604938272E-1, + 2.918490264641404642489712E-1, + 8.816272674437576524187671E-1, + 3.321408281862767544702647E+0, + 1.499576298686255465867237E+1, + 7.892301301158651813848139E+1, + 4.744515388682643231611949E+2, + 3.207490090890661934704328E+3 }; static double mu[] = { - 1.0, - -1.458333333333333333333333E-1, - -9.874131944444444444444444E-2, - -1.433120539158950617283951E-1, - -3.172272026784135480967078E-1, - -9.424291479571202491373028E-1, - -3.511203040826354261542798E+0, - -1.572726362036804512982712E+1, - -8.228143909718594444224656E+1, - -4.923553705236705240352022E+2, - -3.316218568547972508762102E+3 + 1.0, + -1.458333333333333333333333E-1, + -9.874131944444444444444444E-2, + -1.433120539158950617283951E-1, + -3.172272026784135480967078E-1, + -9.424291479571202491373028E-1, + -3.511203040826354261542798E+0, + -1.572726362036804512982712E+1, + -8.228143909718594444224656E+1, + -4.923553705236705240352022E+2, + -3.316218568547972508762102E+3 }; static double P1[] = { - -2.083333333333333333333333E-1, - 1.250000000000000000000000E-1 + -2.083333333333333333333333E-1, + 1.250000000000000000000000E-1 }; static double P2[] = { - 3.342013888888888888888889E-1, - -4.010416666666666666666667E-1, - 7.031250000000000000000000E-2 + 3.342013888888888888888889E-1, + -4.010416666666666666666667E-1, + 7.031250000000000000000000E-2 }; static double P3[] = { - -1.025812596450617283950617E+0, - 1.846462673611111111111111E+0, - -8.912109375000000000000000E-1, - 7.324218750000000000000000E-2 + -1.025812596450617283950617E+0, + 1.846462673611111111111111E+0, + -8.912109375000000000000000E-1, + 7.324218750000000000000000E-2 }; static double P4[] = { - 4.669584423426247427983539E+0, - -1.120700261622299382716049E+1, - 8.789123535156250000000000E+0, - -2.364086914062500000000000E+0, - 1.121520996093750000000000E-1 + 4.669584423426247427983539E+0, + -1.120700261622299382716049E+1, + 8.789123535156250000000000E+0, + -2.364086914062500000000000E+0, + 1.121520996093750000000000E-1 }; static double P5[] = { - -2.8212072558200244877E1, - 8.4636217674600734632E1, - -9.1818241543240017361E1, - 4.2534998745388454861E1, - -7.3687943594796316964E0, - 2.27108001708984375E-1 + -2.8212072558200244877E1, + 8.4636217674600734632E1, + -9.1818241543240017361E1, + 4.2534998745388454861E1, + -7.3687943594796316964E0, + 2.27108001708984375E-1 }; static double P6[] = { - 2.1257013003921712286E2, - -7.6525246814118164230E2, - 1.0599904525279998779E3, - -6.9957962737613254123E2, - 2.1819051174421159048E2, - -2.6491430486951555525E1, - 5.7250142097473144531E-1 + 2.1257013003921712286E2, + -7.6525246814118164230E2, + 1.0599904525279998779E3, + -6.9957962737613254123E2, + 2.1819051174421159048E2, + -2.6491430486951555525E1, + 5.7250142097473144531E-1 }; static double P7[] = { - -1.9194576623184069963E3, - 8.0617221817373093845E3, - -1.3586550006434137439E4, - 1.1655393336864533248E4, - -5.3056469786134031084E3, - 1.2009029132163524628E3, - -1.0809091978839465550E2, - 1.7277275025844573975E0 + -1.9194576623184069963E3, + 8.0617221817373093845E3, + -1.3586550006434137439E4, + 1.1655393336864533248E4, + -5.3056469786134031084E3, + 1.2009029132163524628E3, + -1.0809091978839465550E2, + 1.7277275025844573975E0 }; -static double jnx( n, x ) -double n, x; +static double jnx(double n, double x) { -double zeta, sqz, zz, zp, np; -double cbn, n23, t, z, sz; -double pp, qq, z32i, zzi; -double ak, bk, akl, bkl; -int sign, doa, dob, nflg, k, s, tk, tkp1, m; -static double u[8]; -static double ai, aip, bi, bip; + double zeta, sqz, zz, zp, np; + double cbn, n23, t, z, sz; + double pp, qq, z32i, zzi; + double ak, bk, akl, bkl; + int sign, doa, dob, nflg, k, s, tk, tkp1, m; + static double u[8]; + static double ai, aip, bi, bip; -/* Test for x very close to n. - * Use expansion for transition region if so. - */ -cbn = cbrt(n); -z = (x - n)/cbn; -if( fabs(z) <= 0.7 ) - return( jnt(n,x) ); + /* Test for x very close to n. Use expansion for transition region if so. */ + cbn = cbrt(n); + z = (x - n) / cbn; + if (fabs(z) <= 0.7) + return (jnt(n, x)); -z = x/n; -zz = 1.0 - z*z; -if( zz == 0.0 ) - return(0.0); + z = x / n; + zz = 1.0 - z * z; + if (zz == 0.0) + return (0.0); -if( zz > 0.0 ) - { - sz = sqrt( zz ); - t = 1.5 * (log( (1.0+sz)/z ) - sz ); /* zeta ** 3/2 */ - zeta = cbrt( t * t ); + if (zz > 0.0) { + sz = sqrt(zz); + t = 1.5 * (log((1.0 + sz) / z) - sz); /* zeta ** 3/2 */ + zeta = cbrt(t * t); nflg = 1; - } -else - { + } else { sz = sqrt(-zz); - t = 1.5 * (sz - acos(1.0/z)); - zeta = -cbrt( t * t ); + t = 1.5 * (sz - acos(1.0 / z)); + zeta = -cbrt(t * t); nflg = -1; - } -z32i = fabs(1.0/t); -sqz = cbrt(t); + } + z32i = fabs(1.0 / t); + sqz = cbrt(t); -/* Airy function */ -n23 = cbrt( n * n ); -t = n23 * zeta; + /* Airy function */ + n23 = cbrt(n * n); + t = n23 * zeta; #if DEBUG -printf("zeta %.5E, Airy(%.5E)\n", zeta, t ); + printf("zeta %.5E, Airy(%.5E)\n", zeta, t); #endif -airy( t, &ai, &aip, &bi, &bip ); + airy(t, &ai, &aip, &bi, &bip); -/* polynomials in expansion */ -u[0] = 1.0; -zzi = 1.0/zz; -u[1] = polevl( zzi, P1, 1 )/sz; -u[2] = polevl( zzi, P2, 2 )/zz; -u[3] = polevl( zzi, P3, 3 )/(sz*zz); -pp = zz*zz; -u[4] = polevl( zzi, P4, 4 )/pp; -u[5] = polevl( zzi, P5, 5 )/(pp*sz); -pp *= zz; -u[6] = polevl( zzi, P6, 6 )/pp; -u[7] = polevl( zzi, P7, 7 )/(pp*sz); + /* polynomials in expansion */ + u[0] = 1.0; + zzi = 1.0 / zz; + u[1] = polevl(zzi, P1, 1) / sz; + u[2] = polevl(zzi, P2, 2) / zz; + u[3] = polevl(zzi, P3, 3) / (sz * zz); + pp = zz * zz; + u[4] = polevl(zzi, P4, 4) / pp; + u[5] = polevl(zzi, P5, 5) / (pp * sz); + pp *= zz; + u[6] = polevl(zzi, P6, 6) / pp; + u[7] = polevl(zzi, P7, 7) / (pp * sz); #if DEBUG -for( k=0; k<=7; k++ ) - printf( "u[%d] = %.5E\n", k, u[k] ); + for (k = 0; k <= 7; k++) + printf("u[%d] = %.5E\n", k, u[k]); #endif -pp = 0.0; -qq = 0.0; -np = 1.0; -/* flags to stop when terms get larger */ -doa = 1; -dob = 1; -akl = MAXNUM; -bkl = MAXNUM; + pp = 0.0; + qq = 0.0; + np = 1.0; + /* flags to stop when terms get larger */ + doa = 1; + dob = 1; + akl = MAXNUM; + bkl = MAXNUM; -for( k=0; k<=3; k++ ) - { + for (k = 0; k <= 3; k++) { tk = 2 * k; tkp1 = tk + 1; zp = 1.0; ak = 0.0; bk = 0.0; - for( s=0; s<=tk; s++ ) - { - if( doa ) - { - if( (s & 3) > 1 ) - sign = nflg; - else - sign = 1; - ak += sign * mu[s] * zp * u[tk-s]; - } - - if( dob ) - { - m = tkp1 - s; - if( ((m+1) & 3) > 1 ) - sign = nflg; - else - sign = 1; - bk += sign * lambda[s] * zp * u[m]; - } - zp *= z32i; - } - - if( doa ) - { - ak *= np; - t = fabs(ak); - if( t < akl ) - { - akl = t; - pp += ak; - } + for (s = 0; s <= tk; s++) { + if (doa) { + if ((s & 3) > 1) + sign = nflg; else - doa = 0; - } + sign = 1; + ak += sign * mu[s] * zp * u[tk - s]; + } - if( dob ) - { - bk += lambda[tkp1] * zp * u[0]; - bk *= -np/sqz; - t = fabs(bk); - if( t < bkl ) - { - bkl = t; - qq += bk; - } + if (dob) { + m = tkp1 - s; + if (((m + 1) & 3) > 1) + sign = nflg; else - dob = 0; - } + sign = 1; + bk += sign * lambda[s] * zp * u[m]; + } + zp *= z32i; + } + + if (doa) { + ak *= np; + t = fabs(ak); + if (t < akl) { + akl = t; + pp += ak; + } else + doa = 0; + } + + if (dob) { + bk += lambda[tkp1] * zp * u[0]; + bk *= -np / sqz; + t = fabs(bk); + if (t < bkl) { + bkl = t; + qq += bk; + } else + dob = 0; + } #if DEBUG - printf("a[%d] %.5E, b[%d] %.5E\n", k, ak, k, bk ); + printf("a[%d] %.5E, b[%d] %.5E\n", k, ak, k, bk); #endif - if( np < MACHEP ) - break; - np /= n*n; - } + if (np < MACHEP) + break; + np /= n * n; + } -/* normalizing factor ( 4*zeta/(1 - z**2) )**1/4 */ -t = 4.0 * zeta/zz; -t = sqrt( sqrt(t) ); + /* normalizing factor ( 4*zeta/(1 - z**2) )**1/4 */ + t = 4.0 * zeta / zz; + t = sqrt(sqrt(t)); -t *= ai*pp/cbrt(n) + aip*qq/(n23*n); -return(t); + t *= ai * pp / cbrt(n) + aip * qq / (n23 * n); + return (t); } /* Asymptotic expansion for transition region, @@ -794,92 +726,89 @@ */ static double PF2[] = { - -9.0000000000000000000e-2, - 8.5714285714285714286e-2 + -9.0000000000000000000e-2, + 8.5714285714285714286e-2 }; static double PF3[] = { - 1.3671428571428571429e-1, - -5.4920634920634920635e-2, - -4.4444444444444444444e-3 + 1.3671428571428571429e-1, + -5.4920634920634920635e-2, + -4.4444444444444444444e-3 }; static double PF4[] = { - 1.3500000000000000000e-3, - -1.6036054421768707483e-1, - 4.2590187590187590188e-2, - 2.7330447330447330447e-3 + 1.3500000000000000000e-3, + -1.6036054421768707483e-1, + 4.2590187590187590188e-2, + 2.7330447330447330447e-3 }; static double PG1[] = { - -2.4285714285714285714e-1, - 1.4285714285714285714e-2 + -2.4285714285714285714e-1, + 1.4285714285714285714e-2 }; static double PG2[] = { - -9.0000000000000000000e-3, - 1.9396825396825396825e-1, - -1.1746031746031746032e-2 + -9.0000000000000000000e-3, + 1.9396825396825396825e-1, + -1.1746031746031746032e-2 }; static double PG3[] = { - 1.9607142857142857143e-2, - -1.5983694083694083694e-1, - 6.3838383838383838384e-3 + 1.9607142857142857143e-2, + -1.5983694083694083694e-1, + 6.3838383838383838384e-3 }; -static double jnt( n, x ) -double n, x; +static double jnt(double n, double x) { -double z, zz, z3; -double cbn, n23, cbtwo; -double ai, aip, bi, bip; /* Airy functions */ -double nk, fk, gk, pp, qq; -double F[5], G[4]; -int k; + double z, zz, z3; + double cbn, n23, cbtwo; + double ai, aip, bi, bip; /* Airy functions */ + double nk, fk, gk, pp, qq; + double F[5], G[4]; + int k; -cbn = cbrt(n); -z = (x - n)/cbn; -cbtwo = cbrt( 2.0 ); + cbn = cbrt(n); + z = (x - n) / cbn; + cbtwo = cbrt(2.0); -/* Airy function */ -zz = -cbtwo * z; -airy( zz, &ai, &aip, &bi, &bip ); + /* Airy function */ + zz = -cbtwo * z; + airy(zz, &ai, &aip, &bi, &bip); -/* polynomials in expansion */ -zz = z * z; -z3 = zz * z; -F[0] = 1.0; -F[1] = -z/5.0; -F[2] = polevl( z3, PF2, 1 ) * zz; -F[3] = polevl( z3, PF3, 2 ); -F[4] = polevl( z3, PF4, 3 ) * z; -G[0] = 0.3 * zz; -G[1] = polevl( z3, PG1, 1 ); -G[2] = polevl( z3, PG2, 2 ) * z; -G[3] = polevl( z3, PG3, 2 ) * zz; + /* polynomials in expansion */ + zz = z * z; + z3 = zz * z; + F[0] = 1.0; + F[1] = -z / 5.0; + F[2] = polevl(z3, PF2, 1) * zz; + F[3] = polevl(z3, PF3, 2); + F[4] = polevl(z3, PF4, 3) * z; + G[0] = 0.3 * zz; + G[1] = polevl(z3, PG1, 1); + G[2] = polevl(z3, PG2, 2) * z; + G[3] = polevl(z3, PG3, 2) * zz; #if DEBUG -for( k=0; k<=4; k++ ) - printf( "F[%d] = %.5E\n", k, F[k] ); -for( k=0; k<=3; k++ ) - printf( "G[%d] = %.5E\n", k, G[k] ); + for (k = 0; k <= 4; k++) + printf("F[%d] = %.5E\n", k, F[k]); + for (k = 0; k <= 3; k++) + printf("G[%d] = %.5E\n", k, G[k]); #endif -pp = 0.0; -qq = 0.0; -nk = 1.0; -n23 = cbrt( n * n ); + pp = 0.0; + qq = 0.0; + nk = 1.0; + n23 = cbrt(n * n); -for( k=0; k<=4; k++ ) - { - fk = F[k]*nk; + for (k = 0; k <= 4; k++) { + fk = F[k] * nk; pp += fk; - if( k != 4 ) - { - gk = G[k]*nk; - qq += gk; - } + if (k != 4) { + gk = G[k] * nk; + qq += gk; + } #if DEBUG - printf("fk[%d] %.5E, gk[%d] %.5E\n", k, fk, k, gk ); + printf("fk[%d] %.5E, gk[%d] %.5E\n", k, fk, k, gk); #endif nk /= n23; - } + } -fk = cbtwo * ai * pp/cbn + cbrt(4.0) * aip * qq/n; -return(fk); + fk = cbtwo * ai * pp / cbn + cbrt(4.0) * aip * qq / n; + return (fk); } From scipy-svn at scipy.org Wed Mar 19 18:22:48 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Wed, 19 Mar 2008 17:22:48 -0500 (CDT) Subject: [Scipy-svn] r4042 - trunk/scipy/special/cephes Message-ID: <20080319222248.9D81739C10D@new.scipy.org> Author: cookedm Date: 2008-03-19 17:22:47 -0500 (Wed, 19 Mar 2008) New Revision: 4042 Modified: trunk/scipy/special/cephes/jv.c Log: (scipy.special) jv.c: DEBUG -> CEPHES_DEBUG Modified: trunk/scipy/special/cephes/jv.c =================================================================== --- trunk/scipy/special/cephes/jv.c 2008-03-19 22:21:34 UTC (rev 4041) +++ trunk/scipy/special/cephes/jv.c 2008-03-19 22:22:47 UTC (rev 4042) @@ -48,7 +48,7 @@ #include "mconf.h" -#define DEBUG 0 +#define CEPHES_DEBUG 0 #ifdef DEC #define MAXGAM 34.84425627277176174 @@ -211,7 +211,7 @@ y = hankel(k, x); else y = jvs(k, x); -#if DEBUG +#if CEPHES_DEBUG printf("y = %.16e, recur q = %.16e\n", y, q); #endif if (n > 0.0) @@ -261,7 +261,7 @@ fstart: -#if DEBUG +#if CEPHES_DEBUG printf("recur: n = %.6e, newn = %.6e, cfrac = ", *n, *newn); #endif @@ -309,7 +309,7 @@ done: -#if DEBUG +#if CEPHES_DEBUG printf("%.6e\n", ans); #endif @@ -369,7 +369,7 @@ } } *newn = k; -#if DEBUG +#if CEPHES_DEBUG printf("newn %.6e rans %.6e\n", k, pkm2); #endif return (pkm2); @@ -402,7 +402,7 @@ if (y != 0) t = fabs(u / y); } -#if DEBUG +#if CEPHES_DEBUG printf("power series=%.5e ", y); #endif t = frexp(0.5 * x, &ex); @@ -412,12 +412,12 @@ && (n > 0.0) && (n < (MAXGAM - 1.0))) { t = pow(0.5 * x, n) / gamma(n + 1.0); -#if DEBUG +#if CEPHES_DEBUG printf("pow(.5*x, %.4e)/gamma(n+1)=%.5e\n", n, t); #endif y *= t; } else { -#if DEBUG +#if CEPHES_DEBUG z = n * log(0.5 * x); k = lgam(n + 1.0); t = z - k; @@ -430,7 +430,7 @@ y = -y; } t += log(y); -#if DEBUG +#if CEPHES_DEBUG printf("log y=%.5e\n", log(y)); #endif if (t < -MAXLOG) { @@ -489,7 +489,7 @@ } /* stop if the terms start getting larger */ if ((flag != 0) && (t > conv)) { -#if DEBUG +#if CEPHES_DEBUG printf("Hankel: convergence to %.4E\n", conv); #endif goto hank1; @@ -499,7 +499,7 @@ hank1: u = x - (0.5 * n + 0.25) * PI; t = sqrt(2.0 / (PI * x)) * (pp * cos(u) - qq * sin(u)); -#if DEBUG +#if CEPHES_DEBUG printf("hank: %.6e\n", t); #endif return (t); @@ -626,7 +626,7 @@ n23 = cbrt(n * n); t = n23 * zeta; -#if DEBUG +#if CEPHES_DEBUG printf("zeta %.5E, Airy(%.5E)\n", zeta, t); #endif airy(t, &ai, &aip, &bi, &bip); @@ -644,7 +644,7 @@ u[6] = polevl(zzi, P6, 6) / pp; u[7] = polevl(zzi, P7, 7) / (pp * sz); -#if DEBUG +#if CEPHES_DEBUG for (k = 0; k <= 7; k++) printf("u[%d] = %.5E\n", k, u[k]); #endif @@ -704,7 +704,7 @@ } else dob = 0; } -#if DEBUG +#if CEPHES_DEBUG printf("a[%d] %.5E, b[%d] %.5E\n", k, ak, k, bk); #endif if (np < MACHEP) @@ -785,7 +785,7 @@ G[1] = polevl(z3, PG1, 1); G[2] = polevl(z3, PG2, 2) * z; G[3] = polevl(z3, PG3, 2) * zz; -#if DEBUG +#if CEPHES_DEBUG for (k = 0; k <= 4; k++) printf("F[%d] = %.5E\n", k, F[k]); for (k = 0; k <= 3; k++) @@ -803,7 +803,7 @@ gk = G[k] * nk; qq += gk; } -#if DEBUG +#if CEPHES_DEBUG printf("fk[%d] %.5E, gk[%d] %.5E\n", k, fk, k, gk); #endif nk /= n23; From scipy-svn at scipy.org Wed Mar 19 19:41:19 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Wed, 19 Mar 2008 18:41:19 -0500 (CDT) Subject: [Scipy-svn] r4043 - in trunk/scipy/signal: . tests Message-ID: <20080319234119.BF97339C06B@new.scipy.org> Author: stefan Date: 2008-03-19 18:41:04 -0500 (Wed, 19 Mar 2008) New Revision: 4043 Modified: trunk/scipy/signal/signaltools.py trunk/scipy/signal/tests/test_signaltools.py Log: Allow fftconvolve to return complex results. Closes #595. Modified: trunk/scipy/signal/signaltools.py =================================================================== --- trunk/scipy/signal/signaltools.py 2008-03-19 22:22:47 UTC (rev 4042) +++ trunk/scipy/signal/signaltools.py 2008-03-19 23:41:04 UTC (rev 4043) @@ -94,16 +94,15 @@ """ s1 = array(in1.shape) s2 = array(in2.shape) - if (s1.dtype.char in ['D','F']) or (s2.dtype.char in ['D', 'F']): - cmplx=1 - else: cmplx=0 + complex_result = (numpy.issubdtype(in1.dtype, numpy.complex) or + numpy.issubdtype(in2.dtype, numpy.complex)) size = s1+s2-1 IN1 = fftn(in1,size) IN1 *= fftn(in2,size) ret = ifftn(IN1) del IN1 - if not cmplx: - ret = real(ret) + if not complex_result: + ret = ret.real if mode == "full": return ret elif mode == "same": Modified: trunk/scipy/signal/tests/test_signaltools.py =================================================================== --- trunk/scipy/signal/tests/test_signaltools.py 2008-03-19 22:22:47 UTC (rev 4042) +++ trunk/scipy/signal/tests/test_signaltools.py 2008-03-19 23:41:04 UTC (rev 4043) @@ -14,6 +14,16 @@ c = signal.convolve(a,b) assert_array_equal(c,array([3,10,22,28,32,32,23,12])) +class TestFFTConvolve(TestCase): + def test_real(self): + x = array([1,2,3]) + assert_array_almost_equal(signal.fftconvolve(x,x), [1,4,10,12,9.]) + + def test_complex(self): + x = array([1+1j,2+2j,3+3j]) + assert_array_almost_equal(signal.fftconvolve(x,x), + [0+2.0j, 0+8j, 0+20j, 0+24j, 0+18j]) + class TestMedFilt(TestCase): def test_basic(self): f = [[3,4,5],[2,3,4],[1,2,5]] From scipy-svn at scipy.org Thu Mar 20 10:29:06 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Thu, 20 Mar 2008 09:29:06 -0500 (CDT) Subject: [Scipy-svn] r4044 - in trunk/scipy/sparse: . sparsetools Message-ID: <20080320142906.6E8BD39C3FA@new.scipy.org> Author: cdavid Date: 2008-03-20 09:28:56 -0500 (Thu, 20 Mar 2008) New Revision: 4044 Removed: trunk/scipy/sparse/SConstruct Modified: trunk/scipy/sparse/setupscons.py trunk/scipy/sparse/sparsetools/setupscons.py Log: Update scons build scripts for sparsetools and top sparse. Deleted: trunk/scipy/sparse/SConstruct =================================================================== --- trunk/scipy/sparse/SConstruct 2008-03-19 23:41:04 UTC (rev 4043) +++ trunk/scipy/sparse/SConstruct 2008-03-20 14:28:56 UTC (rev 4044) @@ -1,18 +0,0 @@ -# Last Change: Wed Mar 05 09:00 PM 2008 J -# vim:syntax=python -from os.path import join - -from numpy.distutils.misc_util import get_numpy_include_dirs -from numscons import GetNumpyEnvironment - -env = GetNumpyEnvironment(ARGUMENTS) - -env.AppendUnique(CPPPATH = get_numpy_include_dirs()) - -env.NumpyPythonExtension('_sparsetools', - source = [join('sparsetools', 'sparsetools_wrap.cxx')]) - -# Copy this python file into the distutils lib dir -env.Command(join(env['distutils_installdir'], 'sparsetools.py'), - join(env['src_dir'], 'sparsetools', 'sparsetools.py'), - Copy('$TARGET', '$SOURCE')) Modified: trunk/scipy/sparse/setupscons.py =================================================================== --- trunk/scipy/sparse/setupscons.py 2008-03-19 23:41:04 UTC (rev 4043) +++ trunk/scipy/sparse/setupscons.py 2008-03-20 14:28:56 UTC (rev 4044) @@ -11,8 +11,8 @@ setup_name = 'setupscons.py') config.add_data_dir('tests') - config.add_sconscript('SConstruct') config.add_subpackage('linalg') + config.add_subpackage('sparsetools') return config Modified: trunk/scipy/sparse/sparsetools/setupscons.py =================================================================== --- trunk/scipy/sparse/sparsetools/setupscons.py 2008-03-19 23:41:04 UTC (rev 4043) +++ trunk/scipy/sparse/sparsetools/setupscons.py 2008-03-20 14:28:56 UTC (rev 4044) @@ -7,7 +7,7 @@ import numpy from numpy.distutils.misc_util import Configuration - config = Configuration('sparse',parent_package,top_path, + config = Configuration('sparsetools',parent_package,top_path, setup_name = 'setupscons.py') config.add_sconscript('SConstruct') From scipy-svn at scipy.org Thu Mar 20 13:42:51 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Thu, 20 Mar 2008 12:42:51 -0500 (CDT) Subject: [Scipy-svn] r4045 - trunk/scipy/ndimage/src/segment Message-ID: <20080320174251.0059D39C165@new.scipy.org> Author: tom.waite Date: 2008-03-20 12:42:33 -0500 (Thu, 20 Mar 2008) New Revision: 4045 Modified: trunk/scipy/ndimage/src/segment/Segmenter_EXT.c Log: Added Law's texture feature extraction Modified: trunk/scipy/ndimage/src/segment/Segmenter_EXT.c =================================================================== --- trunk/scipy/ndimage/src/segment/Segmenter_EXT.c 2008-03-20 14:28:56 UTC (rev 4044) +++ trunk/scipy/ndimage/src/segment/Segmenter_EXT.c 2008-03-20 17:42:33 UTC (rev 4045) @@ -411,8 +411,91 @@ } + +static PyObject *Segmenter_LawsTextureMetric(PyObject *self, PyObject *args) +{ + + int i; + int num; + int nd; + int type; + int mode; + npy_intp *dims; + npy_intp *laws_dims; + float *lawsImage; + double *src_image; + unsigned short *mask; + double *L7; + double *E7; + double *S7; + double *W7; + double *R7; + double *O7; + int number_kernels; + int kernel_size; + int filters; + LawsFilter7 lawsFilter; + PyObject *lArray = NULL; + PyObject *mArray = NULL; + PyObject *sArray = NULL; + PyObject *LArray = NULL; + PyObject *EArray = NULL; + PyObject *SArray = NULL; + PyObject *WArray = NULL; + PyObject *RArray = NULL; + PyObject *OArray = NULL; + + if(!PyArg_ParseTuple(args, "OOOiiiOOOOOO", &mArray, &sArray, &lArray, &number_kernels, + &kernel_size, &filters, &LArray, &EArray, + &SArray, &WArray, &RArray, &OArray)) + goto exit; + + src_image = (double*)PyArray_DATA(sArray); + nd = PyArray_NDIM(sArray); + dims = PyArray_DIMS(sArray); + type = PyArray_TYPE(sArray); + num = PyArray_SIZE(sArray); + + laws_dims = PyArray_DIMS(lArray); + mask = (unsigned short *)PyArray_DATA(mArray); + lawsImage = (float*)PyArray_DATA(lArray); + L7 = (double *)PyArray_DATA(LArray); + E7 = (double *)PyArray_DATA(EArray); + S7 = (double *)PyArray_DATA(SArray); + W7 = (double *)PyArray_DATA(WArray); + R7 = (double *)PyArray_DATA(RArray); + O7 = (double *)PyArray_DATA(OArray); + + lawsFilter.numberKernels = number_kernels; + lawsFilter.kernelLength = kernel_size; + lawsFilter.numberFilterLayers = filters; + for(i = 0; i < kernel_size; ++i){ + lawsFilter.lawsKernel[0][i] = L7[i]; + lawsFilter.lawsKernel[1][i] = E7[i]; + lawsFilter.lawsKernel[2][i] = S7[i]; + lawsFilter.lawsKernel[3][i] = W7[i]; + lawsFilter.lawsKernel[4][i] = R7[i]; + lawsFilter.lawsKernel[5][i] = O7[i]; + } + + if(!PyArray_ISCONTIGUOUS(mArray)) + goto exit; + + if(!NI_LawsTexture(num, (int)dims[0], (int)dims[1], src_image, mask, lawsImage, + lawsFilter)){ + goto exit; + } + +exit: + + return PyErr_Occurred() ? NULL : (PyObject*)Py_BuildValue(""); + +} + + static PyMethodDef SegmenterMethods[] = { + { "laws_texture_metric", Segmenter_LawsTextureMetric, METH_VARARGS, NULL }, { "canny_hysteresis", Segmenter_CannyHysteresis, METH_VARARGS, NULL }, { "canny_nonmax_supress", Segmenter_CannyNonMaxSupress, METH_VARARGS, NULL }, { "canny_filter", Segmenter_CannyFilter, METH_VARARGS, NULL }, From scipy-svn at scipy.org Thu Mar 20 13:43:22 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Thu, 20 Mar 2008 12:43:22 -0500 (CDT) Subject: [Scipy-svn] r4046 - trunk/scipy/ndimage/src/segment Message-ID: <20080320174322.8713C39C165@new.scipy.org> Author: tom.waite Date: 2008-03-20 12:43:13 -0500 (Thu, 20 Mar 2008) New Revision: 4046 Modified: trunk/scipy/ndimage/src/segment/Segmenter_IMPL.c Log: Added Law's texture feature extraction Modified: trunk/scipy/ndimage/src/segment/Segmenter_IMPL.c =================================================================== --- trunk/scipy/ndimage/src/segment/Segmenter_IMPL.c 2008-03-20 17:42:33 UTC (rev 4045) +++ trunk/scipy/ndimage/src/segment/Segmenter_IMPL.c 2008-03-20 17:43:13 UTC (rev 4046) @@ -12,7 +12,8 @@ int NI_EdgePreFilter(int num, int rows, int cols, int lowThreshold, int highThreshold, - int aperature, int HalfFilterTaps, unsigned short *sImage, double *dImage, double *kernel){ + int aperature, int HalfFilterTaps, unsigned short *sImage, double *dImage, + double *kernel){ int i, j, k, n, num1; int offset; @@ -805,6 +806,7 @@ return(0); } + int NI_CannyHysteresis(int num, int rows, int cols, double *magImage, unsigned short *hys_image, double cannyLow, double cannyHigh){ @@ -822,13 +824,151 @@ } } - status = 1; return status; } +float lawsConvolution(float *image, float *rowFilter, float *colFilter, int kernelSize){ + int i, j; + int offset; + float result[7]; + float sum; + /* filter rows */ + for(i = 0; i < kernelSize; ++i){ + sum = (float)0.0; + offset = i * kernelSize; + for(j = 0; j < kernelSize; ++j){ + sum += (rowFilter[j]*image[offset+j]); + } + result[i] = sum; + } + /* filter columns */ + sum = (float)0.0; + for(j = 0; j < kernelSize; ++j){ + sum += (rowFilter[j]*result[j]); + } + + return(sum); + +} + +void computeLaws(LawsFilter7 lawsFilter, int aperature, int srcRows, int srcCols, + unsigned short *MaskImage, float *lawsImage, double *sourceImage){ + + /* + // hard-wirred to Law's 7 kernels + */ + int i, j; + int lawsLayer; + int column, row; + int offset; + int maskOffset[7]; + int dataOffset[7]; + float myImage[49]; + int count; + int outerKernelNumber; + int innerKernelNumber; + int rowNumber; + int kernelSize = lawsFilter.kernelLength; + int fullMask = kernelSize*kernelSize; + int layerStep = srcRows*srcCols; + float *rowFilter; + float *colFilter; + float filterResult1; + float filterResult2; + float lawsLL=1.0; + + for(i = aperature; i < srcRows-aperature; ++i){ + // get the row array offset for mask and data source. + for(row = -aperature; row <= aperature; ++row){ + maskOffset[row+aperature] = (i+row)*srcCols; + dataOffset[row+aperature] = maskOffset[row+aperature]; + } + for(j = aperature; j < srcCols-aperature; ++j){ + /* + // get 7x7 segment and make sure have 100% mask coverage + */ + count = 0; + for(row = -aperature; row <= aperature; ++row){ + rowNumber = (row+aperature)*kernelSize; + for(column = -aperature; column <= aperature; ++column){ + if(MaskImage[maskOffset[row+aperature]+j+column]){ + myImage[rowNumber+column+aperature] = sourceImage[dataOffset[row+aperature]+j+column]; + ++count; + } + } + } + if(count == fullMask){ + /* + // 100% mask coverage. now do the Law's texture filters + */ + lawsLayer = 0; + for(outerKernelNumber = 0; outerKernelNumber < lawsFilter.numberKernels; ++outerKernelNumber){ + /* + // outer loop pulls the i'th kernel. kernel 0 is the LP kernel + // the outer loop is the iso-kernel + */ + rowFilter = &lawsFilter.lawsKernel[outerKernelNumber][0]; + colFilter = &lawsFilter.lawsKernel[outerKernelNumber][0]; + filterResult1 = lawsConvolution(myImage, rowFilter, colFilter, kernelSize); + /* lawsLayer 0 is the LP and needs to be used to scale. */ + if(outerKernelNumber){ + // to normalize based on Laws LL kernel. not implemented now. + //lawsImage[lawsLayer*layerStep + i*srcCols + j] = (float)2.0 * filterResult1 / lawsLL; + lawsImage[lawsLayer*layerStep + i*srcCols + j] = (float)2.0 * filterResult1; + } + else{ + lawsLL = (float)2.0 * filterResult1; + lawsImage[lawsLayer*layerStep + i*srcCols + j] = (float)2.0 * filterResult1; + } + ++lawsLayer; + /* + // now do the inner loop and get the column filters for the other laws kernels + */ + for(innerKernelNumber = outerKernelNumber+1; + innerKernelNumber < lawsFilter.numberKernels; + ++innerKernelNumber){ + colFilter = &lawsFilter.lawsKernel[innerKernelNumber][0]; + filterResult1 = lawsConvolution(myImage, rowFilter, colFilter, kernelSize); + filterResult2 = lawsConvolution(myImage, colFilter, rowFilter, kernelSize); + lawsImage[lawsLayer*layerStep + i*srcCols + j] = filterResult1 + filterResult2; + // (filterResult1 / lawsLL) + (filterResult2 / lawsLL); + // to normalize based on Laws LL kernel. not implemented now. + ++lawsLayer; + } + } + } + } + } + + return; + +} + + +int NI_LawsTexture(int num, int rows, int cols, double *src_image, unsigned short *mask, + float *lawsImage, LawsFilter7 lawsFilter){ + + int status; + int number_kernels; + int kernel_size; + int filters; + number_kernels = lawsFilter.numberKernels; + kernel_size = lawsFilter.kernelLength; + filters = lawsFilter.numberFilterLayers; + int aperature = (kernel_size-1)/2; + + computeLaws(lawsFilter, aperature, rows, cols, mask, lawsImage, src_image); + + status = 1; + + return status; + +} + + From scipy-svn at scipy.org Thu Mar 20 13:44:28 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Thu, 20 Mar 2008 12:44:28 -0500 (CDT) Subject: [Scipy-svn] r4047 - trunk/scipy/ndimage Message-ID: <20080320174428.A613E39C3F6@new.scipy.org> Author: tom.waite Date: 2008-03-20 12:44:00 -0500 (Thu, 20 Mar 2008) New Revision: 4047 Modified: trunk/scipy/ndimage/_segmenter.py Log: updates and improvements Modified: trunk/scipy/ndimage/_segmenter.py =================================================================== --- trunk/scipy/ndimage/_segmenter.py 2008-03-20 17:43:13 UTC (rev 4046) +++ trunk/scipy/ndimage/_segmenter.py 2008-03-20 17:44:00 UTC (rev 4047) @@ -1,29 +1,28 @@ import math -import numpy as N -import pylab as P +import numpy as NP import scipy.ndimage._segment as S -_objstruct = N.dtype([('L', 'i'), - ('R', 'i'), - ('T', 'i'), - ('B', 'i'), - ('Label', 'i'), - ('Area', 'i'), - ('cX', 'f'), - ('cY', 'f'), - ('curveClose', 'i'), - ('cXB', 'f'), - ('cYB', 'f'), - ('bLength', 'f'), - ('minRadius', 'f'), - ('maxRadius', 'f'), - ('aveRadius', 'f'), - ('ratio', 'f'), - ('compactness', 'f'), - ('voxelMean', 'f'), - ('voxelVar', 'f'), - ('TEM', 'f', 20)] - ) +_objstruct = NP.dtype([('L', 'i'), + ('R', 'i'), + ('T', 'i'), + ('B', 'i'), + ('Label', 'i'), + ('Area', 'i'), + ('cX', 'f'), + ('cY', 'f'), + ('curveClose', 'i'), + ('cXB', 'f'), + ('cYB', 'f'), + ('bLength', 'f'), + ('minRadius', 'f'), + ('maxRadius', 'f'), + ('aveRadius', 'f'), + ('ratio', 'f'), + ('compactness', 'f'), + ('voxelMean', 'f'), + ('voxelVar', 'f'), + ('TEM', 'f', 20)] + ) # Issue warning regarding heavy development status of this module @@ -57,7 +56,7 @@ """ [rows, cols] = magnitude.shape - edge_image = N.zeros(rows*cols, dtype=N.int16).reshape(rows, cols) + edge_image = NP.zeros(rows*cols, dtype=NP.int16).reshape(rows, cols) S.canny_hysteresis(magnitude, edge_image, canny_stats['low'], canny_stats['high']) return edge_image @@ -107,7 +106,7 @@ """ [rows, cols] = horz_DGFilter.shape - magnitude = N.zeros(rows*cols, dtype=N.float64).reshape(rows, cols) + magnitude = NP.zeros(rows*cols, dtype=NP.float64).reshape(rows, cols) aveMag, canny_low, canny_high = S.canny_nonmax_supress(horz_DGFilter, vert_DGFilter, magnitude, mode, img_means['x-dg']*thres, img_means['y-dg']*thres, canny_l, canny_h) @@ -145,9 +144,10 @@ """ + slice = slice.astype(NP.float64) [rows, cols] = slice.shape - horz_DGFilter = N.zeros(rows*cols, dtype=N.float64).reshape(rows, cols) - vert_DGFilter = N.zeros(rows*cols, dtype=N.float64).reshape(rows, cols) + horz_DGFilter = NP.zeros(rows*cols, dtype=NP.float64).reshape(rows, cols) + vert_DGFilter = NP.zeros(rows*cols, dtype=NP.float64).reshape(rows, cols) aveX, aveY = S.canny_filter(slice, horz_DGFilter, vert_DGFilter, dg_kernel['coefficients'], dg_kernel['kernelSize']) @@ -184,7 +184,7 @@ """ if ROI==None: - ROIList = N.zeros(1, dtype=_objstruct) + ROIList = NP.zeros(1, dtype=_objstruct) [rows, cols] = label_image.shape ROIList['L'] = 2 ROIList['R'] = cols-3 @@ -193,15 +193,15 @@ [rows, cols] = label_image.shape # destination image - thin_edge_image = N.zeros(rows*cols, dtype=N.uint16).reshape(rows, cols) - mat_image = N.zeros(rows*cols, dtype=N.uint16).reshape(rows, cols) + thin_edge_image = NP.zeros(rows*cols, dtype=NP.uint16).reshape(rows, cols) + mat_image = NP.zeros(rows*cols, dtype=NP.uint16).reshape(rows, cols) # scratch memory for thin - input = N.zeros(rows*cols, dtype=N.uint8).reshape(rows, cols) - cinput = N.zeros(rows*cols, dtype=N.uint8).reshape(rows, cols) - erosion = N.zeros(rows*cols, dtype=N.uint8).reshape(rows, cols) - dialation = N.zeros(rows*cols, dtype=N.uint8).reshape(rows, cols) - hmt = N.zeros(rows*cols, dtype=N.uint8).reshape(rows, cols) - copy = N.zeros(rows*cols, dtype=N.uint8).reshape(rows, cols) + input = NP.zeros(rows*cols, dtype=NP.uint8).reshape(rows, cols) + cinput = NP.zeros(rows*cols, dtype=NP.uint8).reshape(rows, cols) + erosion = NP.zeros(rows*cols, dtype=NP.uint8).reshape(rows, cols) + dialation = NP.zeros(rows*cols, dtype=NP.uint8).reshape(rows, cols) + hmt = NP.zeros(rows*cols, dtype=NP.uint8).reshape(rows, cols) + copy = NP.zeros(rows*cols, dtype=NP.uint8).reshape(rows, cols) number_regions = ROI.size indices = range(0, number_regions) @@ -247,6 +247,147 @@ return mat_image +def texture_filter(raw_image, label_image, laws_kernel, ROI=None, verbose=0): + """ + texture_images = texture_filter(raw_image, label_image, laws_kernel, ROI=None, verbose=1) + . + OR + . + texture_filter(raw_image, label_image, laws_kernel, ROI=None, verbose=0) + + Parameters + .......... + + raw_image : {nd_array} + raw double image + + label_image : {nd_array} + an image with labeled regions from get_blobs() method + + laws_kernel : {dictionary} + set of 6 length-7 Law's texture feature kernels + + ROI : {dictionary} + Region of Interest structure that has blob bounding boxes + + verbose : {0, 1}, optional + determines if return is to include Law's filter images + + Returns + .......... + + laws_image : {dictionary} + contains 21 Laws filtered regions for each ROI + returned if verbose=1 + + + """ + if ROI==None: + ROI= NP.zeros(1, dtype=_objstruct) + [rows, cols] = label_image.shape + ROI['L'] = 2 + ROI['R'] = cols-3 + ROI['B'] = 2 + ROI['T'] = rows-3 + + laws_image_list = {} + number_regions = ROI.size + layers = laws_kernel['filters'] + indices = range(0, number_regions) + filters = range(1, layers) + for i in indices: + left = ROI[i]['L'] + right = ROI[i]['R'] + bottom = ROI[i]['B'] + top = ROI[i]['T'] + Label = ROI[i]['Label'] + rows = top-bottom + cols = right-left + label_region = NP.zeros(rows*cols, dtype=NP.uint16).reshape(rows, cols) + source_region = NP.zeros(rows*cols, dtype=NP.float64).reshape(rows, cols) + laws_block = NP.zeros(layers*rows*cols, dtype=NP.float32).reshape(layers, rows, cols) + # load the labeled region + label_region[0:rows, 0:cols][label_image[bottom:top, left:right]==Label] = 1 + source_region[0:rows, 0:cols] = raw_image[bottom:top, left:right] + S.laws_texture_metric(label_region, source_region, laws_block, laws_kernel['numKernels'], + laws_kernel['kernelSize'], laws_kernel['filters'], + laws_kernel['coefficients'][0], laws_kernel['coefficients'][1], + laws_kernel['coefficients'][2], laws_kernel['coefficients'][3], + laws_kernel['coefficients'][4], laws_kernel['coefficients'][5]) + + for j in filters: + # compute the energy measure for each filter in the ROI + mask_image = laws_block[j, :, :][label_region[:, :]>0] + mean = mask_image.mean() + # TBD: scale by mean, or autoscale the TEM vector + ROI[i]['TEM'][j-1] = mask_image.std() + + # accumulate the 21 Law's filtered ROI's and optional + # return as image (3D) + laws_image_list[i] = laws_block + + if verbose == 1: + return laws_image_list + else: + return + + + +def get_voxel_measures(label_image, raw_image, ROI=None): + """ + mat_image = mat_filter(label_image, raw_image, ROI=None) + + takes the ROI dictionary with the blob bounding boxes and gets the voxel measures + from each ROI in the raw data. + + Parameters + .......... + + label_image : {nd_array} + an image with labeled regions from get_blobs() method + + raw_image : {nd_array} + the original double image (raw voxels) from which voxel measures are made + + ROI : {dictionary} + Region of Interest structure that has blob bounding boxes + + + Returns + .......... + + none + + """ + if ROI==None: + ROIList = NP.zeros(1, dtype=_objstruct) + [rows, cols] = label_image.shape + ROIList['L'] = 2 + ROIList['R'] = cols-3 + ROIList['B'] = 2 + ROIList['T'] = rows-3 + + number_regions = ROI.size + indices = range(0, number_regions) + inflate = 1 + for i in indices: + left = ROI[i]['L'] + right = ROI[i]['R'] + bottom = ROI[i]['B'] + top = ROI[i]['T'] + Label = ROI[i]['Label'] + rows = top-bottom-1 + cols = right-left-1 + section= NP.zeros(rows*cols, dtype=raw_image.dtype).reshape(rows, cols) + section = raw_image[bottom:top, left:right] \ + [label_image[bottom:top, left:right]==Label] + mask = section[section>0] + ROI[i]['voxelMean'] = mask.mean() + ROI[i]['voxelVar'] = mask.std() + + return + + def get_blob_regions(labeled_image, groups, dust=16): """ ROIList = get_blob_regions(labeled_image, groups, dust=16) @@ -273,7 +414,7 @@ """ - ROIList = N.zeros(groups, dtype=_objstruct) + ROIList = NP.zeros(groups, dtype=_objstruct) # return the bounding box for each connected edge S.get_blob_regions(labeled_image, ROIList) @@ -305,7 +446,7 @@ """ [rows, cols] = binary_edge_image.shape - labeled_edge_image = N.zeros(rows*cols, dtype=N.uint16).reshape(rows, cols) + labeled_edge_image = NP.zeros(rows*cols, dtype=NP.uint16).reshape(rows, cols) groups = S.get_blobs(binary_edge_image, labeled_edge_image) return labeled_edge_image, groups @@ -339,7 +480,7 @@ """ [rows, cols] = sobel_edge_image.shape - sobel_edge = N.zeros(rows*cols, dtype=N.uint16).reshape(rows, cols) + sobel_edge = NP.zeros(rows*cols, dtype=NP.uint16).reshape(rows, cols) S.sobel_edges(sobel_edge_image, sobel_edge, sobel_stats['ave_gt0'], sobel_stats['min_gt0'], sobel_stats['max_gt0'], mode, sobel_threshold) @@ -368,80 +509,125 @@ mean and nonzero min, max of sobel filtering """ + filtered_slice = filtered_slice.astype(NP.float64) [rows, cols] = filtered_slice.shape - sobel_edge_image = N.zeros(rows*cols, dtype=N.float64).reshape(rows, cols) + sobel_edge_image = NP.zeros(rows*cols, dtype=NP.float64).reshape(rows, cols) pAve, min_value, max_value = S.sobel_image(filtered_slice, sobel_edge_image) - # replace this with numpy calls for the image stats. but C ext is faster + # can replace this with numpy calls for the image stats. but C ext is faster # S.sobel_image(filtered_slice, sobel_edge_image) - # pAve = sobel_edge_image[sobel_edge_image>0].mean() - # min_value = sobel_edge_image[sobel_edge_image>0].min() - # max_value = sobel_edge_image[sobel_edge_image>0].max() + # sobel_mask = sobel_edge_image[sobel_edge_image>0] + # pAve = sobel_mask.mean() + # min_value = sobel_mask.min() + # max_value = sobel_mask.max() sobel_stats= {'ave_gt0' : pAve, 'min_gt0': min_value, 'max_gt0': max_value} return sobel_edge_image, sobel_stats -def pre_filter(slice, filter, low_threshold=2048+220, high_threshold=600+2048, conv_binary=0): +def pre_filter(slice, filter, low_threshold=0, high_threshold=0, conv_binary=0): """ + edge_filter = pre_filter(slice, filter, low_threshold=0, high_threshold=slice.max(), conv_binary=0) + take 2D image slice and filter and pre-filter and threshold prior to segmentation + Parameters + .......... + slice : {nd_array} + input 2D image. gets cast to int16 + + filter : {dictionary} + 2D filter kernel set from build_2d_kernel() + + low_threshold : {int}, optional + default 0 + + high_threshold : {int}, optional + default max value of source image + + conv_binary : {0, 1}, optional + flag to convert edge_filter image to binary valued. default + is binary conversion off + + Returns + .......... + edge_filter : {nd_array} + filtered and thresholded image that can be (optional) binary. + """ # make sure the input is 16 bits. this is input to edge machine # so can handle raw and 8 bit scaled inputs - slice = slice.astype(N.int16) + if high_threshold==0: + # default to the maximum value of the image + high_threshold = slice.max() + + slice = slice.astype(NP.int16) [rows, cols] = slice.shape - edge_image = N.zeros(rows*cols, dtype=N.float64).reshape(rows, cols) + edge_image = NP.zeros(rows*cols, dtype=NP.float64).reshape(rows, cols) S.edge_prefilter(low_threshold, high_threshold, filter['kernelSize'], filter['kernel'], slice, edge_image) if conv_binary == 1: edge_image[edge_image>0] = 1 - edge_image = edge_image.astype(N.uint16) + edge_image = edge_image.astype(NP.uint16) return edge_image def get_max_bounding_box(ROI): - max_area = ROI[:]['Area'].max() - indices = range(0, ROI.size) - for i in indices: - if ROI[i]['Area'] == max_area: - left = ROI[i]['L'] - right = ROI[i]['R'] - top = ROI[i]['T'] - bottom = ROI[i]['B'] + """ + bounding_box = get_max_bounding_box(ROI) - bounding_box = {'left' : left, 'right' : right, 'top' : top, 'bottom' : bottom} + take an ROI structure and find the maximum area bounding box + Parameters + .......... + + ROI : {dictionary} + the ROI is the automatically extracted blob regions of interest + and contains the rectangular bounding box of each blob. + + Returns + .......... + + bounding_box : {dictionary} + the Left, Right, Top and Bottom of the LARGEST bounding box in the ROI + + """ + max_index = ROI[:]['Area'].argmax() + bounding_box = {'left' : ROI[max_index]['L'], 'right' : ROI[max_index]['R'], + 'top' : ROI[max_index]['T'], 'bottom' : ROI[max_index]['B']} + return bounding_box -def set_draw_bounding_box(bounding_box): - x = N.zeros(5, dtype=N.uint16) - y = N.zeros(5, dtype=N.uint16) +def get_all_bounding_boxes(ROI): + """ + measures = get_all_bounding_boxes(ROI) - x[0] = bounding_box['left'] - x[1] = bounding_box['right'] - x[2] = bounding_box['right'] - x[3] = bounding_box['left'] - x[4] = bounding_box['left'] + get all bounding boxes in the ROI (feature) dictionary - y[0] = bounding_box['bottom'] - y[1] = bounding_box['bottom'] - y[2] = bounding_box['top'] - y[3] = bounding_box['top'] - y[4] = bounding_box['bottom'] + Parameters + .......... - return x, y + ROI : {dictionary} + the ROI is the automatically extracted blob regions of interest + and contains the rectangular bounding box of each blob. -def get_all_bounding_boxes(ROI): + Returns + .......... + + measures : {dictionary} + the Left, Right, Top and Bottom of all bounding boxes in the ROI + + """ + number = ROI.size indices = range(0, ROI.size) - _shortstruct = N.dtype([('left', 'i'), + _shortstruct = NP.dtype([('left', 'i'), ('right', 'i'), ('top', 'i'), ('bottom', 'i')]) - measures = N.zeros(number, dtype=_shortstruct) + measures = NP.zeros(number, dtype=_shortstruct) for i in indices: measures[i]['left'] = ROI[i]['L'] measures[i]['right'] = ROI[i]['R'] @@ -450,56 +636,34 @@ return measures -def draw_all_bounding_boxes(measures): - number = measures.size - indices = range(0, measures.size) - for i in indices: - x, y = set_draw_bounding_box(measures[i]) - P.plot(x, y) -def build_test_discs(): +def build_2d_kernel(aperature=21, hiFilterCutoff=10.0): + """ - radius = 50 - rows = 512 - cols = 512 - test_image = N.zeros(rows*cols, dtype=N.int16).reshape(rows, cols) - y_indices = N.array(range(-radius, radius+1)) - center_x = rows / 4 - center_y = cols / 4 + FIRFilter = build_2d_kernel(aperature, hiFilterCutoff) - for i in y_indices: - x = math.sqrt(float(radius)**2 - float(i)**2) - test_image[1*center_y+i, 1*center_x-x:1*center_x+x] = 100 - test_image[1*center_y+i, 3*center_x-x:3*center_x+x] = 100 - test_image[3*center_y+i, 1*center_x-x:1*center_x+x] = 100 - test_image[3*center_y+i, 3*center_x-x:3*center_x+x] = 100 + build hamming-windowed FIR filter with sinc kernel - return test_image + Parameters + .......... -def get_slice(imageName='slice112.raw', bytes=2, rows=512, columns=512): - # clip the ends for this test CT image file as the spine runs off the end of the image - ImageSlice = N.fromfile(imageName, dtype=N.uint16).reshape(rows, columns) - ImageSlice[505:512, :] = 0 - return ImageSlice + aperature : {int}, optional + the number of coefficients in the filter. default is 21. needs to be ODD -def build_2d_kernel(aperature=21, hiFilterCutoff=10.0): - """ - build flat FIR filter with sinc kernel - this is bandpass, but low cutoff is 0.0 - Use in Sobel and Canny filter edge find as image pre-process + hiFilterCutoff : {float} + the upper cutoff in digital frequency units - FIRFilter = build_2d_kernel(aperature, hiFilterCutoff) - Inputs: - aperature is number of FIR taps in sinc kernel - hiFilterCutoff is digital frequency cutoff in range (0.0, 180.0) - Output: - FIRFilter (a struct) + Returns + .......... + FIRFilter : {dictionary} + filter kernel + """ rad = math.pi / 180.0 HalfFilterTaps = (aperature-1) / 2 - kernel = N.zeros((aperature), dtype=N.float64) + kernel = NP.zeros((aperature), dtype=NP.float64) LC = 0.0 HC = hiFilterCutoff * rad t2 = 2.0 * math.pi @@ -530,17 +694,29 @@ def build_d_gauss_kernel(gWidth=20, sigma=1.0): """ - build the derivative of Gaussian kernel for Canny edge filter DGFilter = build_d_gauss_kernel(gWidth, sigma) - Inputs: - gWdith is width of derivative of Gaussian kernel - sigma is sigma term of derivative of Gaussian kernel - Output: - DGFilter (a dictionary). Use in Canny filter call + build the derivative of Gaussian kernel for Canny edge filter + + Parameters + .......... + gWdith : {int}, optional + width of derivative of Gaussian kernel. + default value is 20 + + sigma : {float}, optional + sigma term of derivative of Gaussian kernel + default value is 1.0 + + Returns + .......... + + DGFilter : {dictionary} + filter kernel + """ - kernel = N.zeros((1+gWidth), dtype=N.float64) + kernel = NP.zeros((1+gWidth), dtype=NP.float64) indices = range(0, gWidth) for i in indices: @@ -554,23 +730,29 @@ def build_morpho_thin_masks(): """ + MATFilter = build_morpho_thin_masks() + build 2 sets (J and K) of 8 3x3 morphology masks (structuring elements) to implement thinning (medial axis transformation - MAT) - MATFilter = build_morpho_thin_masks() - Inputs: - None + Parameters + .......... - Output: - MATFilter (a struct) + None + Returns + .......... + + MATFilter : {dictionary} + morphology filter kernels. there are 2 sets of 8 3x3 masks + """ # (layers, rows, cols) size = (8*3*3) - J_mask = N.zeros(size, dtype=N.int16) - K_mask = N.zeros(size, dtype=N.int16) + J_mask = NP.zeros(size, dtype=NP.int16) + K_mask = NP.zeros(size, dtype=NP.int16) maskCols = 3 # load the 8 J masks for medial axis transformation @@ -663,3 +845,42 @@ return MATFilter + +def build_laws_kernel(): + + """ + LAWSFilter = build_laws_kernel() + + build 6 length-7 Law's texture filter masks + mask names are: 'L', 'S', 'E', 'W', 'R', 'O' + + + Parameters + .......... + + None + + Returns + .......... + + LAWSFilter : {dictionary} + a set of 6 length-7 Laws texture kernels + + """ + aperature = (6, 7) + coefficients = NP.zeros((aperature), dtype=NP.float64) + names = ('L', 'E', 'S', 'W', 'R', 'O' ) + + coefficients[0, :] = ( 1.0, 6.0, 15.0, 20.0, 15.0, 6.0, 1.0 ) + coefficients[1, :] = (-1.0, -4.0, -5.0, 0.0, 5.0, 4.0, 1.0 ) + coefficients[2, :] = (-1.0, -2.0, 1.0, 4.0, 1.0, -2.0, -1.0 ) + coefficients[3, :] = (-1.0, 0.0, 3.0, 0.0, -3.0, 0.0, 1.0 ) + coefficients[4, :] = ( 1.0, -2.0, -1.0, 4.0, -1.0, -2.0, 1.0 ) + coefficients[5, :] = (-1.0, 6.0, -15.0, 20.0, -15.0, 6.0, -1.0 ) + + LAWSFilter= {'numKernels' : 6, 'kernelSize' : 7, 'filters' : 21, + 'coefficients': coefficients, 'names': names} + + return LAWSFilter + + From scipy-svn at scipy.org Thu Mar 20 14:57:05 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Thu, 20 Mar 2008 13:57:05 -0500 (CDT) Subject: [Scipy-svn] r4048 - trunk/scipy/sparse/sparsetools Message-ID: <20080320185705.263DFC7C086@new.scipy.org> Author: wnbell Date: 2008-03-20 13:56:44 -0500 (Thu, 20 Mar 2008) New Revision: 4048 Modified: trunk/scipy/sparse/sparsetools/bsr_wrap.cxx trunk/scipy/sparse/sparsetools/coo_wrap.cxx trunk/scipy/sparse/sparsetools/csc_wrap.cxx trunk/scipy/sparse/sparsetools/csr_wrap.cxx trunk/scipy/sparse/sparsetools/dia_wrap.cxx trunk/scipy/sparse/sparsetools/numpy.i Log: use const char * for string literals to keep GCC-4.2 happy Modified: trunk/scipy/sparse/sparsetools/bsr_wrap.cxx =================================================================== --- trunk/scipy/sparse/sparsetools/bsr_wrap.cxx 2008-03-20 17:44:00 UTC (rev 4047) +++ trunk/scipy/sparse/sparsetools/bsr_wrap.cxx 2008-03-20 18:56:44 UTC (rev 4048) @@ -2653,7 +2653,7 @@ /* Given a PyObject, return a string describing its type. */ -char* pytype_string(PyObject* py_obj) { +const char* pytype_string(PyObject* py_obj) { if (py_obj == NULL ) return "C NULL value"; if (py_obj == Py_None ) return "Python None" ; if (PyCallable_Check(py_obj)) return "callable" ; @@ -2672,8 +2672,8 @@ /* Given a NumPy typecode, return a string describing the type. */ -char* typecode_string(int typecode) { - static char* type_names[25] = {"bool", "byte", "unsigned byte", +const char* typecode_string(int typecode) { + static const char* type_names[25] = {"bool", "byte", "unsigned byte", "short", "unsigned short", "int", "unsigned int", "long", "unsigned long", "long long", "unsigned long long", @@ -2704,16 +2704,16 @@ ary = (PyArrayObject*) input; } else if is_array(input) { - char* desired_type = typecode_string(typecode); - char* actual_type = typecode_string(array_type(input)); + const char* desired_type = typecode_string(typecode); + const char* actual_type = typecode_string(array_type(input)); PyErr_Format(PyExc_TypeError, "Array of type '%s' required. Array of type '%s' given", desired_type, actual_type); ary = NULL; } else { - char * desired_type = typecode_string(typecode); - char * actual_type = pytype_string(input); + const char * desired_type = typecode_string(typecode); + const char * actual_type = pytype_string(input); PyErr_Format(PyExc_TypeError, "Array of type '%s' required. A '%s' was given", desired_type, actual_type); Modified: trunk/scipy/sparse/sparsetools/coo_wrap.cxx =================================================================== --- trunk/scipy/sparse/sparsetools/coo_wrap.cxx 2008-03-20 17:44:00 UTC (rev 4047) +++ trunk/scipy/sparse/sparsetools/coo_wrap.cxx 2008-03-20 18:56:44 UTC (rev 4048) @@ -2653,7 +2653,7 @@ /* Given a PyObject, return a string describing its type. */ -char* pytype_string(PyObject* py_obj) { +const char* pytype_string(PyObject* py_obj) { if (py_obj == NULL ) return "C NULL value"; if (py_obj == Py_None ) return "Python None" ; if (PyCallable_Check(py_obj)) return "callable" ; @@ -2672,8 +2672,8 @@ /* Given a NumPy typecode, return a string describing the type. */ -char* typecode_string(int typecode) { - static char* type_names[25] = {"bool", "byte", "unsigned byte", +const char* typecode_string(int typecode) { + static const char* type_names[25] = {"bool", "byte", "unsigned byte", "short", "unsigned short", "int", "unsigned int", "long", "unsigned long", "long long", "unsigned long long", @@ -2704,16 +2704,16 @@ ary = (PyArrayObject*) input; } else if is_array(input) { - char* desired_type = typecode_string(typecode); - char* actual_type = typecode_string(array_type(input)); + const char* desired_type = typecode_string(typecode); + const char* actual_type = typecode_string(array_type(input)); PyErr_Format(PyExc_TypeError, "Array of type '%s' required. Array of type '%s' given", desired_type, actual_type); ary = NULL; } else { - char * desired_type = typecode_string(typecode); - char * actual_type = pytype_string(input); + const char * desired_type = typecode_string(typecode); + const char * actual_type = pytype_string(input); PyErr_Format(PyExc_TypeError, "Array of type '%s' required. A '%s' was given", desired_type, actual_type); Modified: trunk/scipy/sparse/sparsetools/csc_wrap.cxx =================================================================== --- trunk/scipy/sparse/sparsetools/csc_wrap.cxx 2008-03-20 17:44:00 UTC (rev 4047) +++ trunk/scipy/sparse/sparsetools/csc_wrap.cxx 2008-03-20 18:56:44 UTC (rev 4048) @@ -2653,7 +2653,7 @@ /* Given a PyObject, return a string describing its type. */ -char* pytype_string(PyObject* py_obj) { +const char* pytype_string(PyObject* py_obj) { if (py_obj == NULL ) return "C NULL value"; if (py_obj == Py_None ) return "Python None" ; if (PyCallable_Check(py_obj)) return "callable" ; @@ -2672,8 +2672,8 @@ /* Given a NumPy typecode, return a string describing the type. */ -char* typecode_string(int typecode) { - static char* type_names[25] = {"bool", "byte", "unsigned byte", +const char* typecode_string(int typecode) { + static const char* type_names[25] = {"bool", "byte", "unsigned byte", "short", "unsigned short", "int", "unsigned int", "long", "unsigned long", "long long", "unsigned long long", @@ -2704,16 +2704,16 @@ ary = (PyArrayObject*) input; } else if is_array(input) { - char* desired_type = typecode_string(typecode); - char* actual_type = typecode_string(array_type(input)); + const char* desired_type = typecode_string(typecode); + const char* actual_type = typecode_string(array_type(input)); PyErr_Format(PyExc_TypeError, "Array of type '%s' required. Array of type '%s' given", desired_type, actual_type); ary = NULL; } else { - char * desired_type = typecode_string(typecode); - char * actual_type = pytype_string(input); + const char * desired_type = typecode_string(typecode); + const char * actual_type = pytype_string(input); PyErr_Format(PyExc_TypeError, "Array of type '%s' required. A '%s' was given", desired_type, actual_type); Modified: trunk/scipy/sparse/sparsetools/csr_wrap.cxx =================================================================== --- trunk/scipy/sparse/sparsetools/csr_wrap.cxx 2008-03-20 17:44:00 UTC (rev 4047) +++ trunk/scipy/sparse/sparsetools/csr_wrap.cxx 2008-03-20 18:56:44 UTC (rev 4048) @@ -2667,7 +2667,7 @@ /* Given a PyObject, return a string describing its type. */ -char* pytype_string(PyObject* py_obj) { +const char* pytype_string(PyObject* py_obj) { if (py_obj == NULL ) return "C NULL value"; if (py_obj == Py_None ) return "Python None" ; if (PyCallable_Check(py_obj)) return "callable" ; @@ -2686,8 +2686,8 @@ /* Given a NumPy typecode, return a string describing the type. */ -char* typecode_string(int typecode) { - static char* type_names[25] = {"bool", "byte", "unsigned byte", +const char* typecode_string(int typecode) { + static const char* type_names[25] = {"bool", "byte", "unsigned byte", "short", "unsigned short", "int", "unsigned int", "long", "unsigned long", "long long", "unsigned long long", @@ -2718,16 +2718,16 @@ ary = (PyArrayObject*) input; } else if is_array(input) { - char* desired_type = typecode_string(typecode); - char* actual_type = typecode_string(array_type(input)); + const char* desired_type = typecode_string(typecode); + const char* actual_type = typecode_string(array_type(input)); PyErr_Format(PyExc_TypeError, "Array of type '%s' required. Array of type '%s' given", desired_type, actual_type); ary = NULL; } else { - char * desired_type = typecode_string(typecode); - char * actual_type = pytype_string(input); + const char * desired_type = typecode_string(typecode); + const char * actual_type = pytype_string(input); PyErr_Format(PyExc_TypeError, "Array of type '%s' required. A '%s' was given", desired_type, actual_type); Modified: trunk/scipy/sparse/sparsetools/dia_wrap.cxx =================================================================== --- trunk/scipy/sparse/sparsetools/dia_wrap.cxx 2008-03-20 17:44:00 UTC (rev 4047) +++ trunk/scipy/sparse/sparsetools/dia_wrap.cxx 2008-03-20 18:56:44 UTC (rev 4048) @@ -2653,7 +2653,7 @@ /* Given a PyObject, return a string describing its type. */ -char* pytype_string(PyObject* py_obj) { +const char* pytype_string(PyObject* py_obj) { if (py_obj == NULL ) return "C NULL value"; if (py_obj == Py_None ) return "Python None" ; if (PyCallable_Check(py_obj)) return "callable" ; @@ -2672,8 +2672,8 @@ /* Given a NumPy typecode, return a string describing the type. */ -char* typecode_string(int typecode) { - static char* type_names[25] = {"bool", "byte", "unsigned byte", +const char* typecode_string(int typecode) { + static const char* type_names[25] = {"bool", "byte", "unsigned byte", "short", "unsigned short", "int", "unsigned int", "long", "unsigned long", "long long", "unsigned long long", @@ -2704,16 +2704,16 @@ ary = (PyArrayObject*) input; } else if is_array(input) { - char* desired_type = typecode_string(typecode); - char* actual_type = typecode_string(array_type(input)); + const char* desired_type = typecode_string(typecode); + const char* actual_type = typecode_string(array_type(input)); PyErr_Format(PyExc_TypeError, "Array of type '%s' required. Array of type '%s' given", desired_type, actual_type); ary = NULL; } else { - char * desired_type = typecode_string(typecode); - char * actual_type = pytype_string(input); + const char * desired_type = typecode_string(typecode); + const char * actual_type = pytype_string(input); PyErr_Format(PyExc_TypeError, "Array of type '%s' required. A '%s' was given", desired_type, actual_type); Modified: trunk/scipy/sparse/sparsetools/numpy.i =================================================================== --- trunk/scipy/sparse/sparsetools/numpy.i 2008-03-20 17:44:00 UTC (rev 4047) +++ trunk/scipy/sparse/sparsetools/numpy.i 2008-03-20 18:56:44 UTC (rev 4048) @@ -59,7 +59,7 @@ /* Given a PyObject, return a string describing its type. */ -char* pytype_string(PyObject* py_obj) { +const char* pytype_string(PyObject* py_obj) { if (py_obj == NULL ) return "C NULL value"; if (py_obj == Py_None ) return "Python None" ; if (PyCallable_Check(py_obj)) return "callable" ; @@ -78,8 +78,8 @@ /* Given a NumPy typecode, return a string describing the type. */ -char* typecode_string(int typecode) { - static char* type_names[25] = {"bool", "byte", "unsigned byte", +const char* typecode_string(int typecode) { + static const char* type_names[25] = {"bool", "byte", "unsigned byte", "short", "unsigned short", "int", "unsigned int", "long", "unsigned long", "long long", "unsigned long long", @@ -110,16 +110,16 @@ ary = (PyArrayObject*) input; } else if is_array(input) { - char* desired_type = typecode_string(typecode); - char* actual_type = typecode_string(array_type(input)); + const char* desired_type = typecode_string(typecode); + const char* actual_type = typecode_string(array_type(input)); PyErr_Format(PyExc_TypeError, "Array of type '%s' required. Array of type '%s' given", desired_type, actual_type); ary = NULL; } else { - char * desired_type = typecode_string(typecode); - char * actual_type = pytype_string(input); + const char * desired_type = typecode_string(typecode); + const char * actual_type = pytype_string(input); PyErr_Format(PyExc_TypeError, "Array of type '%s' required. A '%s' was given", desired_type, actual_type); From scipy-svn at scipy.org Fri Mar 21 11:19:12 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Fri, 21 Mar 2008 10:19:12 -0500 (CDT) Subject: [Scipy-svn] r4049 - trunk/scipy/ndimage Message-ID: <20080321151912.E6C7539C034@new.scipy.org> Author: tom.waite Date: 2008-03-21 10:19:04 -0500 (Fri, 21 Mar 2008) New Revision: 4049 Modified: trunk/scipy/ndimage/_segmenter.py Log: added unit tests for edge and texture filters Modified: trunk/scipy/ndimage/_segmenter.py =================================================================== --- trunk/scipy/ndimage/_segmenter.py 2008-03-20 18:56:44 UTC (rev 4048) +++ trunk/scipy/ndimage/_segmenter.py 2008-03-21 15:19:04 UTC (rev 4049) @@ -884,3 +884,115 @@ return LAWSFilter + +# +# test pattern generators for demo and test +# + +def build_test_texture_discs(): + """ + discs = build_test_texture_discs() + + builds 4 discs with plane wave texture. used for test and demo + + Parameters + .......... + + None + + Returns + .......... + + discs : {nd_array} + a 512x512 image with 4 test discs (one per quadrant) + + """ + rows = 512 + cols = 512 + rad = NP.pi / 180.0 + test_image = NP.zeros(rows*cols, dtype=NP.float32).reshape(rows, cols) + [a, b] = NP.mgrid[0:rows, 0:cols] + test_image[0:255,0:255] = NP.sin(5.0*rad*a[0:255,0:255]) \ + + NP.sin(10.0*rad*b[0:255,0:255]) + test_image[255:512,0:255] = NP.sin(10.0*rad*a[255:512,0:255]) \ + + NP.sin(15.0*rad*b[255:512,0:255]) + test_image[0:255,255:512] = NP.sin(15.0*rad*a[0:255,255:512]) \ + + NP.sin(20.0*rad*b[0:255,255:512]) + test_image[255:512,255:512] = NP.sin(20.0*rad*a[255:512,255:512]) \ + + NP.sin(25.0*rad*b[255:512,255:512]) + + test_image = test_image + test_image.min() + discs = build_test_discs() + discs = discs * test_image + discs = discs - discs.min() + + return discs + + +def build_test_discs(): + """ + test_image = build_test_discs() + build 4 discs of equal radius and different mean values for edge/blob testing + + Parameters + .......... + + None + + Returns + .......... + + test_image : {nd_array} + a 512x512 image with 4 test discs (one per quadrant) + + """ + radius = 50 + rows = 512 + cols = 512 + test_image = NP.zeros(rows*cols, dtype=NP.int16).reshape(rows, cols) + y_indices = NP.array(range(-radius, radius+1)) + center_x = rows / 4 + center_y = cols / 4 + + for i in y_indices: + x = math.sqrt(float(radius)**2 - float(i)**2) + # different raw mean levels + test_image[1*center_y+i, 1*center_x-x:1*center_x+x] = 80 + test_image[1*center_y+i, 3*center_x-x:3*center_x+x] = 90 + test_image[3*center_y+i, 1*center_x-x:1*center_x+x] = 100 + test_image[3*center_y+i, 3*center_x-x:3*center_x+x] = 110 + + return test_image + +def build_test_impulses(): + """ + test_image = build_test_impulses() + + build 4 test impulses discs centered in the 4 discs. used + for testing filter kernels, esp. Laws' filter kernel. Filtering + with these test patterns will return Law's kernel outer product matrices. + + Parameters + .......... + + None + + Returns + .......... + + test_image : {nd_array} + a 512x512 image with 4 test discs (one per quadrant) + + """ + rows = 512 + cols = 512 + test_image = NP.zeros(rows*cols, dtype=NP.int16).reshape(rows, cols) + test_image[128,128] = 1 + test_image[378,128] = 1 + test_image[128,378] = 1 + test_image[378,378] = 1 + + return test_image + + + From scipy-svn at scipy.org Fri Mar 21 11:19:48 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Fri, 21 Mar 2008 10:19:48 -0500 (CDT) Subject: [Scipy-svn] r4050 - trunk/scipy/ndimage/tests Message-ID: <20080321151948.36ADE39C10A@new.scipy.org> Author: tom.waite Date: 2008-03-21 10:19:43 -0500 (Fri, 21 Mar 2008) New Revision: 4050 Modified: trunk/scipy/ndimage/tests/test_segment.py Log: added unit tests for edge and texture filters Modified: trunk/scipy/ndimage/tests/test_segment.py =================================================================== --- trunk/scipy/ndimage/tests/test_segment.py 2008-03-21 15:19:04 UTC (rev 4049) +++ trunk/scipy/ndimage/tests/test_segment.py 2008-03-21 15:19:43 UTC (rev 4050) @@ -1,43 +1,122 @@ - -from scipy.testing import * -from scipy.ndimage._segmenter import * - -inputname = 'slice112.raw' - -from os.path import join, dirname -filename = join(dirname(__file__), inputname) - -class TestSegment(TestCase): - def test1(self): - image = get_slice(filename) - sourceImage = image.copy() - edges, objects = sobel(image) - get_shape_mask(edges, objects) - get_voxel_measures(sourceImage, edges, objects) - get_texture_measures(sourceImage, edges, objects) - # measure the compactness and object boundry length - # Ventricle measure - assert_almost_equal(objects[7]['compactness'], 0.25657323, 4) - assert_almost_equal(objects[7]['bLength'], 1215.70980000, 4) - # Aorta measure - assert_almost_equal(objects[13]['compactness'], 0.91137904, 4) - assert_almost_equal(objects[13]['bLength'], 198.338090000, 4) - - def test2(self): - sourceImage, labeledMask, ROIList = segment_regions(filename) - # measure the compactness and object boundry length - # Ventricle measure - assert_almost_equal(ROIList[7]['compactness'], 0.25657323, 4) - assert_almost_equal(ROIList[7]['bLength'], 1215.70980000, 4) - # Aorta measure - assert_almost_equal(ROIList[13]['compactness'], 0.91137904, 4) - assert_almost_equal(ROIList[13]['bLength'], 198.338090000, 4) - - def test3(self): - regionMask, numberRegions = grow_regions(filename) - number_of_regions = regionMask.max() - assert_equal(number_of_regions, 21) - - -if __name__ == "__main__": - inittest.main() +import math +import numpy as NP +import scipy.ndimage._segmenter as seg +from scipy.testing import * + +def run_sobel(): + img = seg.build_test_discs() + filter = seg.build_2d_kernel(hiFilterCutoff=60.0) + fslice = seg.pre_filter(img, filter, low_threshold=0, high_threshold=255) + sobel_edge_image, sobel_stats = seg.sobel_image(fslice) + sobel_edge = seg.sobel_edges(sobel_edge_image, sobel_stats, sobel_threshold=0.8) + label_sobel, sobel_groups = seg.get_blobs(sobel_edge) + ROI = seg.get_blob_regions(label_sobel, sobel_groups) + measures = seg.get_all_bounding_boxes(ROI) + thin_kernel = seg.build_morpho_thin_masks() + sobel_edges = seg.mat_filter(label_sobel, thin_kernel, ROI) + seg.get_voxel_measures(label_sobel, img, ROI) + means = ROI[:]['voxelMean'] + return measures, means + +def run_canny(): + img = seg.build_test_discs() + filter = seg.build_2d_kernel(hiFilterCutoff=60.0) + fslice = seg.pre_filter(img, filter, low_threshold=0, high_threshold=255) + canny_kernel = seg.build_d_gauss_kernel() + horz, vert, imean = seg.canny_filter(fslice, canny_kernel) + mag, canny_stats = seg.canny_nonmax_supress(horz, vert, imean) + canny_edge = seg.canny_hysteresis(mag, canny_stats) + label_canny, canny_groups = seg.get_blobs(canny_edge) + ROI = seg.get_blob_regions(label_canny, canny_groups) + measures = seg.get_all_bounding_boxes(ROI) + seg.get_voxel_measures(label_canny, img, ROI) + means = ROI[:]['voxelMean'] + return measures, means + +def run_texture(): + filter = seg.build_2d_kernel(hiFilterCutoff=60.0) + img = seg.build_test_discs() + disc_mask = seg.pre_filter(img, filter, low_threshold=50, high_threshold=255, + conv_binary=1) + label_disc_mask, disc_mask_groups = seg.get_blobs(disc_mask) + disc_ROI = seg.get_blob_regions(label_disc_mask, disc_mask_groups) + laws_kernel = seg.build_laws_kernel() + impulse = seg.build_test_impulses() + calib = seg.texture_filter(impulse, label_disc_mask, laws_kernel, + ROI=disc_ROI, verbose=1) + kernels = calib[0] + x = laws_kernel['coefficients'][0] + m = NP.outer(x, x) + m = m * 2 + laws_LL = kernels[0, 50-4:50+3, 50-3:50+4] + return m, laws_LL + +class TestSegment(TestCase): + def test_sobel(self): + # generate 4 discs, find the bounding boxes and + # confirm the bounding boxes are at the true position + measures, voxel_means = run_sobel() + number = measures.size + _shortstruct = NP.dtype([('left', 'i'), + ('right', 'i'), + ('top', 'i'), + ('bottom', 'i')]) + + assert_equal(number, 4) + # load the ground truth + truth = NP.zeros(number, dtype=_shortstruct) + truth[0] = (76, 179, 179, 77) + truth[1] = (332, 435, 179, 77) + truth[2] = (76, 179, 435, 333) + truth[3] = (332, 435, 435, 333) + match = (truth==measures).all() + assert_equal(match, True) + # load the ground truth for the bounding box test image mean value + voxel_truth = NP.zeros(number, dtype=NP.float64) + voxel_truth = (80.0, 90.0, 100.0, 110.0) + match = (voxel_truth==voxel_means).all() + assert_equal(match, True) + + return + + def test_canny(self): + # generate 4 discs, find the bounding boxes and + # confirm the bounding boxes are at the true position + measures, voxel_means = run_canny() + number = measures.size + _shortstruct = NP.dtype([('left', 'i'), + ('right', 'i'), + ('top', 'i'), + ('bottom', 'i')]) + + assert_equal(number, 4) + # load the ground truth for the bounding box + truth = NP.zeros(number, dtype=_shortstruct) + truth[0] = (78, 177, 177, 79) + truth[1] = (334, 433, 177, 79) + truth[2] = (78, 177, 433, 335) + truth[3] = (334, 433, 433, 335) + match = (truth==measures).all() + assert_equal(match, True) + # load the ground truth for the bounding box test image mean value + voxel_truth = NP.zeros(number, dtype=NP.float64) + voxel_truth = (80.0, 90.0, 100.0, 110.0) + match = (voxel_truth==voxel_means).all() + assert_equal(match, True) + + return + + def test_texture(self): + # generate 4 discs; two tests (two test images) + # [1] image 1 is delta functions and confirm the + # filter result is outer product of the L kernel + # [2] image 2 is 4 plane waves and assert the 20-element feature + # vector for each disc is correct + M, Laws_LL = run_texture() + match = (Laws_LL==M).all() + assert_equal(match, True) + return + +if __name__ == "__main__": + inittest.main() + From scipy-svn at scipy.org Wed Mar 26 19:36:10 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Wed, 26 Mar 2008 18:36:10 -0500 (CDT) Subject: [Scipy-svn] r4051 - trunk/scipy/ndimage/tests Message-ID: <20080326233610.422DD39C24B@new.scipy.org> Author: tom.waite Date: 2008-03-26 18:36:07 -0500 (Wed, 26 Mar 2008) New Revision: 4051 Modified: trunk/scipy/ndimage/tests/test_segment.py Log: new tests Modified: trunk/scipy/ndimage/tests/test_segment.py =================================================================== --- trunk/scipy/ndimage/tests/test_segment.py 2008-03-21 15:19:43 UTC (rev 4050) +++ trunk/scipy/ndimage/tests/test_segment.py 2008-03-26 23:36:07 UTC (rev 4051) @@ -33,7 +33,7 @@ means = ROI[:]['voxelMean'] return measures, means -def run_texture(): +def run_texture1(): filter = seg.build_2d_kernel(hiFilterCutoff=60.0) img = seg.build_test_discs() disc_mask = seg.pre_filter(img, filter, low_threshold=50, high_threshold=255, @@ -51,6 +51,22 @@ laws_LL = kernels[0, 50-4:50+3, 50-3:50+4] return m, laws_LL + +def run_texture2(): + filter = seg.build_2d_kernel(hiFilterCutoff=60.0) + img = seg.build_test_unit_discs() + disc = seg.pre_filter(img, filter, low_threshold=50, high_threshold=255) + disc_mask = seg.pre_filter(img, filter, low_threshold=50, high_threshold=255, + conv_binary=1) + label_disc_mask, disc_mask_groups = seg.get_blobs(disc_mask) + disc_ROI = seg.get_blob_regions(label_disc_mask, disc_mask_groups) + laws_kernel = seg.build_laws_kernel() + texture_img = seg.build_test_texture_discs() + seg.texture_filter(texture_img, label_disc_mask, laws_kernel, ROI=disc_ROI, + mean_feature=1, verbose=0) + tem = disc_ROI['TEM'] + return tem + class TestSegment(TestCase): def test_sobel(self): # generate 4 discs, find the bounding boxes and @@ -106,17 +122,38 @@ return - def test_texture(self): - # generate 4 discs; two tests (two test images) - # [1] image 1 is delta functions and confirm the + def test_texture1(self): + # [1] texture1 is delta functions and confirm the # filter result is outer product of the L kernel - # [2] image 2 is 4 plane waves and assert the 20-element feature - # vector for each disc is correct - M, Laws_LL = run_texture() + M, Laws_LL = run_texture1() match = (Laws_LL==M).all() assert_equal(match, True) return + def test_texture2(self): + # [2] texture2 is 2 plane waves and assert the 20-element feature + # vector for each disc is correct + tem = run_texture2() + tem0 = tem[0] + tem1 = tem[1] + truth_tem0 = NP.array( + [ 0. , 0. , 0. , 0. , 0. , + 0. , 0.13306101, 0.08511007, 0.05084148, 0.07550675, + 0.4334695 , 0.03715914, 0.00289055, 0.02755581, 0.48142046, + 0.03137803, 0.00671277, 0.51568902, 0.01795249, 0.49102375, 1. + ], dtype=NP.float32) + truth_tem1 = NP.array( + [ 0. , 0. , 0. , 0. , 0. , + 0. , 0.02970393, 0.00164266, 0.00922416, 0.01221788, + 0.51485199, 0.03298925, 0.02212243, 0.01912871, 0.48350537, + 0.01125561, 0.00826189, 0.49437219, 0.00526817, 0.49736592, 1. + ], dtype=NP.float32) + + assert_array_almost_equal(tem0, truth_tem0, decimal=6) + assert_array_almost_equal(tem1, truth_tem1, decimal=6) + + return + if __name__ == "__main__": inittest.main() From scipy-svn at scipy.org Wed Mar 26 19:36:59 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Wed, 26 Mar 2008 18:36:59 -0500 (CDT) Subject: [Scipy-svn] r4052 - trunk/scipy/ndimage/src/segment Message-ID: <20080326233659.6FD7839C24B@new.scipy.org> Author: tom.waite Date: 2008-03-26 18:36:52 -0500 (Wed, 26 Mar 2008) New Revision: 4052 Modified: trunk/scipy/ndimage/src/segment/ndImage_Segmenter_structs.h Log: completed Law's texture feature code. Modified: trunk/scipy/ndimage/src/segment/ndImage_Segmenter_structs.h =================================================================== --- trunk/scipy/ndimage/src/segment/ndImage_Segmenter_structs.h 2008-03-26 23:36:07 UTC (rev 4051) +++ trunk/scipy/ndimage/src/segment/ndImage_Segmenter_structs.h 2008-03-26 23:36:52 UTC (rev 4052) @@ -4,31 +4,6 @@ #define bool unsigned char typedef struct{ - int x; - int y; -}POINT; - -typedef struct{ - int x; - int y; - int linkIndex; - bool haveLink; -}bPOINT; - -typedef struct{ - int left; - int right; - int top; - int bottom; -}RECT; - -typedef struct{ - char filterName[20]; - float Mean; - float Variance; -}tTEM; - -typedef struct{ int numberKernels; int kernelLength; int numberFilterLayers; @@ -46,51 +21,6 @@ int Area; float cX; float cY; - // filled in BuildBoundary - int curveClose; - float cXBoundary; - float cYBoundary; - float boundaryLength; - float minRadius; - float maxRadius; - float aveRadius; - float ratio; - float compactness; - // filled in VoxelMeasures - float voxelMean; - float voxelVar; - // filled in TextureMeasures - float TEM[20]; }objStruct; -typedef struct{ - int numberPoints; - int curveClose; - int classify; - float boundaryLength; - float minRadius; - float maxRadius; - float aveRadius; - float ratio; - float compactness; - float voxelMean; - float voxelVar; - RECT rectangle; - POINT centroid; - bool isWithin; - bool closedCurve; - bool criticalSize; - int Label; -}boundaryIndex; - - -typedef struct{ - POINT xy; -}blobBoundary; - - -// -// prototypes -// - #endif From scipy-svn at scipy.org Wed Mar 26 19:37:26 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Wed, 26 Mar 2008 18:37:26 -0500 (CDT) Subject: [Scipy-svn] r4053 - trunk/scipy/ndimage/src/segment Message-ID: <20080326233726.A011739C28C@new.scipy.org> Author: tom.waite Date: 2008-03-26 18:37:22 -0500 (Wed, 26 Mar 2008) New Revision: 4053 Modified: trunk/scipy/ndimage/src/segment/Segmenter_IMPL.c Log: completed texture feature code. Modified: trunk/scipy/ndimage/src/segment/Segmenter_IMPL.c =================================================================== --- trunk/scipy/ndimage/src/segment/Segmenter_IMPL.c 2008-03-26 23:36:52 UTC (rev 4052) +++ trunk/scipy/ndimage/src/segment/Segmenter_IMPL.c 2008-03-26 23:37:22 UTC (rev 4053) @@ -918,11 +918,10 @@ filterResult1 = lawsConvolution(myImage, rowFilter, colFilter, kernelSize); /* lawsLayer 0 is the LP and needs to be used to scale. */ if(outerKernelNumber){ - // to normalize based on Laws LL kernel. not implemented now. - //lawsImage[lawsLayer*layerStep + i*srcCols + j] = (float)2.0 * filterResult1 / lawsLL; lawsImage[lawsLayer*layerStep + i*srcCols + j] = (float)2.0 * filterResult1; } else{ + lawsLL = filterResult1; lawsLL = (float)2.0 * filterResult1; lawsImage[lawsLayer*layerStep + i*srcCols + j] = (float)2.0 * filterResult1; } @@ -937,8 +936,6 @@ filterResult1 = lawsConvolution(myImage, rowFilter, colFilter, kernelSize); filterResult2 = lawsConvolution(myImage, colFilter, rowFilter, kernelSize); lawsImage[lawsLayer*layerStep + i*srcCols + j] = filterResult1 + filterResult2; - // (filterResult1 / lawsLL) + (filterResult2 / lawsLL); - // to normalize based on Laws LL kernel. not implemented now. ++lawsLayer; } } From scipy-svn at scipy.org Wed Mar 26 19:38:07 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Wed, 26 Mar 2008 18:38:07 -0500 (CDT) Subject: [Scipy-svn] r4054 - trunk/scipy/ndimage Message-ID: <20080326233807.4C10039C24B@new.scipy.org> Author: tom.waite Date: 2008-03-26 18:38:04 -0500 (Wed, 26 Mar 2008) New Revision: 4054 Modified: trunk/scipy/ndimage/_segmenter.py Log: new unit test code support and docs. Modified: trunk/scipy/ndimage/_segmenter.py =================================================================== --- trunk/scipy/ndimage/_segmenter.py 2008-03-26 23:37:22 UTC (rev 4053) +++ trunk/scipy/ndimage/_segmenter.py 2008-03-26 23:38:04 UTC (rev 4054) @@ -21,7 +21,7 @@ ('compactness', 'f'), ('voxelMean', 'f'), ('voxelVar', 'f'), - ('TEM', 'f', 20)] + ('TEM', 'f', 21)] ) @@ -247,7 +247,8 @@ return mat_image -def texture_filter(raw_image, label_image, laws_kernel, ROI=None, verbose=0): +def texture_filter(raw_image, label_image, laws_kernel, ROI=None, dc_thres=1.0, + mean_feature=1, verbose=0): """ texture_images = texture_filter(raw_image, label_image, laws_kernel, ROI=None, verbose=1) . @@ -270,6 +271,16 @@ ROI : {dictionary} Region of Interest structure that has blob bounding boxes + dc_thres : {float} + used as a filter. Sets texture feature to 0.0 when the + mean level is above this. Removes the low frequency, high amplitude + image regions from the feature list + + mean_feature : {0, 1}, optional + when set to 1, the feature is the mean value of the + selected Law's texture filter. When 0 the feature is + the standard deviation. + verbose : {0, 1}, optional determines if return is to include Law's filter images @@ -291,10 +302,10 @@ ROI['T'] = rows-3 laws_image_list = {} - number_regions = ROI.size - layers = laws_kernel['filters'] - indices = range(0, number_regions) - filters = range(1, layers) + number_regions = ROI.size + layers = laws_kernel['filters'] + indices = range(0, number_regions) + filters = range(0, layers) for i in indices: left = ROI[i]['L'] right = ROI[i]['R'] @@ -309,6 +320,7 @@ # load the labeled region label_region[0:rows, 0:cols][label_image[bottom:top, left:right]==Label] = 1 source_region[0:rows, 0:cols] = raw_image[bottom:top, left:right] + S.laws_texture_metric(label_region, source_region, laws_block, laws_kernel['numKernels'], laws_kernel['kernelSize'], laws_kernel['filters'], laws_kernel['coefficients'][0], laws_kernel['coefficients'][1], @@ -318,10 +330,17 @@ for j in filters: # compute the energy measure for each filter in the ROI mask_image = laws_block[j, :, :][label_region[:, :]>0] - mean = mask_image.mean() - # TBD: scale by mean, or autoscale the TEM vector - ROI[i]['TEM'][j-1] = mask_image.std() + mean = abs(mask_image.mean()) + std = mask_image.std() + if mean > dc_thres: + mean = 0.0 + std = 0.0 + if mean_feature == 1: + ROI[i]['TEM'][j] = mean + else: + ROI[i]['TEM'][j] = std + ROI[i]['TEM'][:] = ROI[i]['TEM'][:] / ROI[i]['TEM'][:].max() # accumulate the 21 Law's filtered ROI's and optional # return as image (3D) laws_image_list[i] = laws_block @@ -414,10 +433,33 @@ """ + + _c_ext_struct = NP.dtype([('L', 'i'), + ('R', 'i'), + ('T', 'i'), + ('B', 'i'), + ('Label', 'i'), + ('Area', 'i'), + ('cX', 'f'), + ('cY', 'f')] + ) + + c_ext_ROI = NP.zeros(groups, dtype=_c_ext_struct) ROIList = NP.zeros(groups, dtype=_objstruct) # return the bounding box for each connected edge - S.get_blob_regions(labeled_image, ROIList) + S.get_blob_regions(labeled_image, c_ext_ROI) + indices = range(0, groups) + for i in indices: + ROIList[i]['L'] = c_ext_ROI[i]['L'] + ROIList[i]['R'] = c_ext_ROI[i]['R'] + ROIList[i]['B'] = c_ext_ROI[i]['B'] + ROIList[i]['T'] = c_ext_ROI[i]['T'] + ROIList[i]['Label'] = c_ext_ROI[i]['Label'] + ROIList[i]['Area'] = c_ext_ROI[i]['Area'] + ROIList[i]['cX'] = c_ext_ROI[i]['cX'] + ROIList[i]['cY'] = c_ext_ROI[i]['cY'] + return ROIList[ROIList['Area']>dust] @@ -624,9 +666,9 @@ number = ROI.size indices = range(0, ROI.size) _shortstruct = NP.dtype([('left', 'i'), - ('right', 'i'), - ('top', 'i'), - ('bottom', 'i')]) + ('right', 'i'), + ('top', 'i'), + ('bottom', 'i')]) measures = NP.zeros(number, dtype=_shortstruct) for i in indices: measures[i]['left'] = ROI[i]['L'] @@ -871,20 +913,75 @@ coefficients = NP.zeros((aperature), dtype=NP.float64) names = ('L', 'E', 'S', 'W', 'R', 'O' ) - coefficients[0, :] = ( 1.0, 6.0, 15.0, 20.0, 15.0, 6.0, 1.0 ) - coefficients[1, :] = (-1.0, -4.0, -5.0, 0.0, 5.0, 4.0, 1.0 ) - coefficients[2, :] = (-1.0, -2.0, 1.0, 4.0, 1.0, -2.0, -1.0 ) - coefficients[3, :] = (-1.0, 0.0, 3.0, 0.0, -3.0, 0.0, 1.0 ) - coefficients[4, :] = ( 1.0, -2.0, -1.0, 4.0, -1.0, -2.0, 1.0 ) - coefficients[5, :] = (-1.0, 6.0, -15.0, 20.0, -15.0, 6.0, -1.0 ) + coefficients[0, :] = ( 1.0, 6.0, 15.0, 20.0, 15.0, 6.0, 1.0) + coefficients[1, :] = (-1.0, -4.0, -5.0, 0.0, 5.0, 4.0, 1.0) + coefficients[2, :] = (-1.0, -2.0, 1.0, 4.0, 1.0, -2.0, -1.0) + coefficients[3, :] = (-1.0, 0.0, 3.0, 0.0, -3.0, 0.0, 1.0) + coefficients[4, :] = ( 1.0, -2.0, -1.0, 4.0, -1.0, -2.0, 1.0) + coefficients[5, :] = (-1.0, 6.0, -15.0, 20.0, -15.0, 6.0, -1.0) LAWSFilter= {'numKernels' : 6, 'kernelSize' : 7, 'filters' : 21, 'coefficients': coefficients, 'names': names} return LAWSFilter +def build_laws_masks(LAWSFilter): + """ + masks = build_laws_masks(LAWSFilter) + takes the Laws Filter dictionary and builds the 21 7x7 kernel masks that are + used in Laws texture feature extraction. + + Parameters + .......... + + LAWSFilter : {dictionary} + a set of 6 length-7 Laws texture kernels + + Returns + .......... + + masks : {list} + a list of 21 7x7 kernels (2D nd_array) + + Examples: + use this along with FFT Pack to view the spatial frequency response. Create a 256x256 zero + array and pad the first 7x7 with the Laws kernel and then get the 2D power spectrum and display + with pylab + + + LAWSFilter = build_laws_kernel() + mask = build_laws_masks(LAWSFilter) + + mask_2 = masks[2] + + z = NP.zeros(256*256, dtype=NP.float32).reshape(256, 256) + z[0:7, 0:7] = mask_0 + x = abs(fftshift(fft2(z))) + pylab.imshow(x) + + """ + + outer_indices = range(0, LAWSFilter['numKernels']) + mask_array = {} + count = 0 + for i in outer_indices: + rowFilter = LAWSFilter['coefficients'][i] + colFilter = LAWSFilter['coefficients'][i] + matrix = NP.outer(rowFilter, colFilter) + mask_array[count] = 2.0*matrix + count = count + 1 + inner_indices = range(i+1, LAWSFilter['numKernels']) + for j in inner_indices: + colFilter = LAWSFilter['coefficients'][j] + matrix = NP.outer(rowFilter, colFilter) + NP.outer(colFilter, rowFilter) + mask_array[count] = matrix + count = count + 1 + + return mask_array + + # # test pattern generators for demo and test # @@ -912,19 +1009,13 @@ rad = NP.pi / 180.0 test_image = NP.zeros(rows*cols, dtype=NP.float32).reshape(rows, cols) [a, b] = NP.mgrid[0:rows, 0:cols] - test_image[0:255,0:255] = NP.sin(5.0*rad*a[0:255,0:255]) \ - + NP.sin(10.0*rad*b[0:255,0:255]) - test_image[255:512,0:255] = NP.sin(10.0*rad*a[255:512,0:255]) \ - + NP.sin(15.0*rad*b[255:512,0:255]) - test_image[0:255,255:512] = NP.sin(15.0*rad*a[0:255,255:512]) \ - + NP.sin(20.0*rad*b[0:255,255:512]) - test_image[255:512,255:512] = NP.sin(20.0*rad*a[255:512,255:512]) \ - + NP.sin(25.0*rad*b[255:512,255:512]) + test_image[0:255,0:255] = NP.sin(4.0*rad*a[0:255,0:255]) + NP.sin(-4.0*rad*b[0:255,0:255]) + test_image[256:511,256:511] = NP.sin(24.0*rad*a[0:255,0:255]) + NP.sin(20.0*rad*b[0:255,0:255]) + test_image = test_image + test_image.min() - discs = build_test_discs() + discs = build_test_unit_discs() discs = discs * test_image - discs = discs - discs.min() return discs @@ -964,6 +1055,41 @@ return test_image + +def build_test_unit_discs(): + """ + test_image = build_test_unit_discs() + build 2 discs of equal radius and same mean values for texture testing + + Parameters + .......... + + None + + Returns + .......... + + test_image : {nd_array} + a 512x512 image with 4 test discs (one per quadrant) + + """ + radius = 50 + rows = 512 + cols = 512 + test_image = NP.zeros(rows*cols, dtype=NP.int16).reshape(rows, cols) + y_indices = NP.array(range(-radius, radius+1)) + center_x = rows / 4 + center_y = cols / 4 + + for i in y_indices: + x = math.sqrt(float(radius)**2 - float(i)**2) + # different raw mean levels + test_image[1*center_y+i, 1*center_x-x:1*center_x+x] = 100 + test_image[3*center_y+i, 3*center_x-x:3*center_x+x] = 100 + + return test_image + + def build_test_impulses(): """ test_image = build_test_impulses() From scipy-svn at scipy.org Thu Mar 27 20:27:46 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Thu, 27 Mar 2008 19:27:46 -0500 (CDT) Subject: [Scipy-svn] r4055 - trunk/scipy/ndimage Message-ID: <20080328002746.EBDE839C01B@new.scipy.org> Author: tom.waite Date: 2008-03-27 19:27:43 -0500 (Thu, 27 Mar 2008) New Revision: 4055 Modified: trunk/scipy/ndimage/_registration.py Log: Added MSE cost measure in optimize. Fixed docstring underline. Modified: trunk/scipy/ndimage/_registration.py =================================================================== --- trunk/scipy/ndimage/_registration.py 2008-03-26 23:38:04 UTC (rev 4054) +++ trunk/scipy/ndimage/_registration.py 2008-03-28 00:27:43 UTC (rev 4055) @@ -1,6 +1,6 @@ import math import os -import numpy as N +import numpy as NP import scipy.ndimage._register as R import scipy.special as SP import scipy.ndimage as NDI @@ -38,7 +38,7 @@ image [mat] is the 4x4 voxel-to-physical conversion matrix. Parameters - .......... + ---------- imageG : {dictionary} imageG is the source image to be resized. it is a dictionary with @@ -51,11 +51,11 @@ sampling dimensions. Returns - ....... + ------- zoom_image : {dictionary} Examples - ........ + -------- >>> import _registration as reg >>> measures, imageF_anat, fmri_series = reg.demo_MRI_coregistration() @@ -66,29 +66,29 @@ """ - Z = N.zeros(3, dtype=N.float64); + Z = NP.zeros(3, dtype=NP.float64); # get the zoom Z[0] = imageG['mat'][0][0] / imageF_mat[0][0] Z[1] = imageG['mat'][1][1] / imageF_mat[1][1] Z[2] = imageG['mat'][2][2] / imageF_mat[2][2] # new volume dimensions (rounded) - D = N.zeros(3, dtype=N.int32); + D = NP.zeros(3, dtype=NP.int32); D[0] = int(float(imageG['dim'][0])*Z[0]+0.5) D[1] = int(float(imageG['dim'][1])*Z[1]+0.5) D[2] = int(float(imageG['dim'][2])*Z[2]+0.5) - M = N.eye(4, dtype=N.float64); + M = NP.eye(4, dtype=NP.float64); # for the test data, set the xyz voxel sizes for fMRI volume M[0][0] = imageG['mat'][0][0]/Z[0] M[1][1] = imageG['mat'][1][1]/Z[1] M[2][2] = imageG['mat'][2][2]/Z[2] - image = N.zeros(D[2]*D[1]*D[0], dtype=N.uint8).reshape(D[2], D[0], D[1]) + image = NP.zeros(D[2]*D[1]*D[0], dtype=NP.uint8).reshape(D[2], D[0], D[1]) mode = 2 scale = 0 R.register_volume_resample(imageG['data'], image, Z, scale, mode) - F = N.zeros(3, dtype=N.float64); + F = NP.zeros(3, dtype=NP.float64); zoom_image = {'data' : image, 'mat' : M, 'dim' : D, 'fwhm' : F} return zoom_image @@ -102,7 +102,7 @@ method. Parameters - .......... + ---------- image : {dictionary} image is the source image to be remapped. it is a dictionary with the data as an ndarray in the ['data'] component. @@ -115,11 +115,11 @@ Returns - ....... + ------- remaped_image : {dictionary} Examples - ........ + -------- image = fmri_series[i] x[0:6] = measures[i]['align_rotate'][0:6] # overwrite the fMRI volume with the aligned volume @@ -134,7 +134,7 @@ M_inverse = get_inverse_mappings(parm_vector) (layers, rows, cols) = image['data'].shape # allocate the zero image - remaped_image = N.zeros(layers*rows*cols, dtype=N.uint8).reshape(layers, rows, cols) + remaped_image = NP.zeros(layers*rows*cols, dtype=NP.uint8).reshape(layers, rows, cols) remaped_image = {'data' : remaped_image, 'mat' : image['mat'], 'dim' : image['dim'], 'fwhm' : image['fwhm']} imdata = build_structs() @@ -156,19 +156,19 @@ 4x4 mapping matrix M_inverse that will map imageG to imageF orientation Parameters - .......... + ---------- parm_vector : {nd_array} Returns - ....... + ------- M_inverse : {nd_array} Examples - ........ + -------- - >>> import numpy as N + >>> import numpy as NP >>> import _registration as reg - >>> array = N.zeros(6, dtype=float) + >>> array = NP.zeros(6, dtype=float) >>> M = reg.get_inverse_mappings(array) >>> M @@ -204,7 +204,7 @@ package. The optimal parameter is returned. Parameters - .......... + ---------- image1 : {dictionary} image1 is the source image to be remapped during the registration. it is a dictionary with the data as an ndarray in the ['data'] component. @@ -235,15 +235,15 @@ Returns - ....... + ------- parm_vector : {nd_array} this is the optimal alignment (6-dim) array with 3 angles and 3 translations. Examples - ........ + -------- - >>> import numpy as N + >>> import numpy as NP >>> import _registration as reg >>> image1, image2, imdata = reg.demo_MRI_volume_align() @@ -268,7 +268,7 @@ provies timing for registration. Parameters - .......... + ---------- image1 : {dictionary} image1 is the source image to be remapped during the registration. @@ -293,16 +293,16 @@ 2 are powell, in hybrid pass 2 is conjugate gradient. Returns - ....... + ------- x : {nd_array} this is the optimal alignment (6-dim) array with 3 angles and 3 translations. Examples - ........ + -------- (calling this from python_coreg which optionally filters image2) - >>> import numpy as N + >>> import numpy as NP >>> import _registration as reg >>> image1, image2, imdata = reg.demo_MRI_volume_align() >>> parm_vector = python_coreg(image1, image2, imdata) @@ -375,7 +375,7 @@ provide domain of kernel and sampling parameters. Parameters - .......... + ---------- fwhm : {int} used for kernel width x : {nd_array} @@ -385,18 +385,18 @@ Returns - ....... + ------- kernel : {nd_array} Examples - ........ + -------- - >>> import numpy as N + >>> import numpy as NP >>> import _registration as reg >>> fwhm = 3 >>> ftype = 2 - >>> p = N.ceil(2*fwhm).astype(int) - >>> x = N.array(range(-p, p+1)) + >>> p = NP.ceil(2*fwhm).astype(int) + >>> x = NP.array(range(-p, p+1)) >>> kernel = reg.smooth_kernel(fwhm, x, ktype=ftype) >>> kernel @@ -409,19 +409,19 @@ """ eps = 0.00001 - s = N.square((fwhm/math.sqrt(8.0*math.log(2.0)))) + eps + s = NP.square((fwhm/math.sqrt(8.0*math.log(2.0)))) + eps if ktype==1: # from SPM: Gauss kernel convolved with 1st degree B spline w1 = 0.5 * math.sqrt(2.0/s) w2 = -0.5 / s w3 = math.sqrt((s*math.pi) /2.0) kernel = 0.5*(SP.erf(w1*(x+1))*(x+1) + SP.erf(w1*(x-1))*(x-1) - 2.0*SP.erf(w1*(x))*(x) + - w3*(N.exp(w2*N.square(x+1))) + N.exp(w2*(N.square(x-1))) - 2.0*N.exp(w2*N.square(x))) + w3*(NP.exp(w2*NP.square(x+1))) + NP.exp(w2*(NP.square(x-1))) - 2.0*NP.exp(w2*NP.square(x))) kernel[kernel<0] = 0 kernel = kernel / kernel.sum() else: # Gauss kernel - kernel = (1.0/math.sqrt(2.0*math.pi*s)) * N.exp(-N.square(x)/(2.0*s)) + kernel = (1.0/math.sqrt(2.0*math.pi*s)) * NP.exp(-NP.square(x)/(2.0*s)) kernel = kernel / kernel.sum() return kernel @@ -432,7 +432,7 @@ does 3D separable digital filtering using scipy.ndimage.correlate1d Parameters - .......... + ---------- imageRaw : {nd_array} the unfiltered 3D volume image fwhm : {int} @@ -441,12 +441,12 @@ kernel type. 1 is Gauss convoled with spline, 2 is Gauss Returns - ....... + ------- image_F_xyz : {nd_array} 3D filtered volume image Examples - ........ + -------- >>> import _registration as reg >>> image1, image2, imdata = reg.demo_MRI_volume_align() @@ -455,14 +455,14 @@ >>> image1['data'] = image_Filter_xyz """ - p = N.ceil(2*fwhm[0]).astype(int) - x = N.array(range(-p, p+1)) + p = NP.ceil(2*fwhm[0]).astype(int) + x = NP.array(range(-p, p+1)) kernel_x = smooth_kernel(fwhm[0], x, ktype=ftype) - p = N.ceil(2*fwhm[1]).astype(int) - x = N.array(range(-p, p+1)) + p = NP.ceil(2*fwhm[1]).astype(int) + x = NP.array(range(-p, p+1)) kernel_y = smooth_kernel(fwhm[1], x, ktype=ftype) - p = N.ceil(2*fwhm[2]).astype(int) - x = N.array(range(-p, p+1)) + p = NP.ceil(2*fwhm[2]).astype(int) + x = NP.array(range(-p, p+1)) kernel_z = smooth_kernel(fwhm[2], x, ktype=ftype) output=None # 3D filter in 3 1D separable stages @@ -481,7 +481,7 @@ builds the low pass filter kernel sigma value from the image pixel sampling Parameters - .......... + ---------- M : {nd_array} input 4x4 voxel to physical map matrix (called 'MAT') @@ -489,14 +489,14 @@ 1x3 sample increment array. should be = (1, 1, 1) Returns - ....... + ------- fwhm : {nd_array} the 3D Gaussian kernel width Examples - ........ + -------- - >>> import numpy as N + >>> import numpy as NP >>> import _registration as reg >>> anat_desc = reg.load_anatMRI_desc() >>> image1 = reg.load_volume(anat_desc, imagename='ANAT1_V0001.img') @@ -504,15 +504,15 @@ >>> image1['fwhm'] = reg.build_fwhm(image1['mat'], imdata['step']) """ - view_3x3 = N.square(M[0:3, 0:3]) + view_3x3 = NP.square(M[0:3, 0:3]) # sum the elements inn the first row - vxg = N.sqrt(view_3x3.sum(axis=0)) + vxg = NP.sqrt(view_3x3.sum(axis=0)) # assumes that sampling is the same for xyz - size = N.array([1,1,1])*S[0] - x = N.square(size) - N.square(vxg) + size = NP.array([1,1,1])*S[0] + x = NP.square(size) - NP.square(vxg) # clip x[x<0] = 0 - fwhm = N.sqrt(x) / vxg + fwhm = NP.sqrt(x) / vxg # pathology when stepsize = 1 for MAT equal to the identity matrix fwhm[fwhm==0] = 1 # return the 3D Gaussian kernel width (xyz) @@ -529,7 +529,7 @@ is called prior to this. Parameters - ....... + ---------- x : {nd_array} this is the current (6-dim) array with 3 angles and 3 translations. @@ -553,16 +553,17 @@ smooth : {0, 1} flag for joint histogram low pass filtering. 0 for no filter, 1 for do filter. - method : {'nmi', 'mi', 'ncc', 'ecc'} + method : {'nmi', 'mi', 'ncc', 'ecc', 'mse'} flag for type of registration metric. nmi is normalized mutual information; mi is mutual information; ecc is entropy cross - correlation; ncc is normalized cross correlation. + correlation; ncc is normalized cross correlation. mse is mean + square error. with mse there is no joint histogram. ret_histo : {0, 1} if 0 return is: cost if 0 return is: cost, joint_histogram Returns - ....... + ------- cost : {float} the negative of one of the mutual information metrics or negative cross correlation. use negative as the optimization @@ -580,9 +581,9 @@ Examples - ........ + -------- - >>> import numpy as N + >>> import numpy as NP >>> import _registration as reg >>> anat_desc = reg.load_anatMRI_desc() >>> image1 = reg.load_volume(anat_desc, imagename='ANAT1_V0001.img') @@ -595,7 +596,7 @@ >>> smhist = 0 >>> ret_histo = 1 >>> optfunc_args = (image1, image2, imdata['step'], imdata['fwhm'], lite, smhist, method, ret_histo) - >>> x = N.zeros(6, dtype=N.float64) + >>> x = NP.zeros(6, dtype=NP.float64) >>> return cost, joint_histogram = reg.optimize_function(x, optfunc_args) @@ -618,88 +619,111 @@ # rot_matrix is the 4x4 constructed (current angles and translates) transform matrix # sample_vector is the subsample vector for x-y-z - F_inv = N.linalg.inv(image_F['mat']) - composite = N.dot(F_inv, image_G['mat']) - composite = N.dot(composite, rot_matrix) + F_inv = NP.linalg.inv(image_F['mat']) + composite = NP.dot(F_inv, image_G['mat']) + composite = NP.dot(composite, rot_matrix) - # allocate memory for 2D histogram - joint_histogram = N.zeros([256, 256], dtype=N.float64); + if method == 'mse': + # + # mean squard error method + # - if do_lite: - R.register_histogram_lite(image_F['data'], image_G['data'], composite, sample_vector, joint_histogram) + (layers, rows, cols) = image_F['data'].shape + # allocate the zero image + remap_image_F = NP.zeros(layers*rows*cols, dtype=NP.uint8).reshape(layers, rows, cols) + imdata = build_structs() + # trilinear interpolation mapping. + R.register_linear_resample(image_F['data'], remap_image_F, composite, + imdata['step']) + cost = (NP.square(image_G['data']-remap_image_F)).mean() + + return cost + else: - R.register_histogram(image_F['data'], image_G['data'], composite, sample_vector, joint_histogram) + # + # histogram-based methods (nmi, ncc, mi, ecc) + # - # smooth the histogram - if smooth: - p = N.ceil(2*fwhm[0]).astype(int) - x = N.array(range(-p, p+1)) - kernel1 = smooth_kernel(fwhm[0], x) - p = N.ceil(2*fwhm[1]).astype(int) - x = N.array(range(-p, p+1)) - kernel2 = smooth_kernel(fwhm[1], x) - output=None - # 2D filter in 1D separable stages - axis = 0 - result = NDI.correlate1d(joint_histogram, kernel1, axis, output) - axis = 1 - joint_histogram = NDI.correlate1d(result, kernel1, axis, output) + # allocate memory for 2D histogram + joint_histogram = NP.zeros([256, 256], dtype=NP.float64); - joint_histogram += epsilon # prevent log(0) - # normalize the joint histogram - joint_histogram /= joint_histogram.sum() - # get the marginals - marginal_col = joint_histogram.sum(axis=0) - marginal_row = joint_histogram.sum(axis=1) + if do_lite: + R.register_histogram_lite(image_F['data'], image_G['data'], composite, + sample_vector, joint_histogram) + else: + R.register_histogram(image_F['data'], image_G['data'], composite, + sample_vector, joint_histogram) - if method == 'mi': - # mutual information - marginal_outer = N.outer(marginal_col, marginal_row) - H = joint_histogram * N.log(joint_histogram / marginal_outer) - mutual_information = H.sum() - cost = -mutual_information + # smooth the histogram + if smooth: + p = NP.ceil(2*fwhm[0]).astype(int) + x = NP.array(range(-p, p+1)) + kernel1 = smooth_kernel(fwhm[0], x) + p = NP.ceil(2*fwhm[1]).astype(int) + x = NP.array(range(-p, p+1)) + kernel2 = smooth_kernel(fwhm[1], x) + output=None + # 2D filter in 1D separable stages + axis = 0 + result = NDI.correlate1d(joint_histogram, kernel1, axis, output) + axis = 1 + joint_histogram = NDI.correlate1d(result, kernel1, axis, output) - elif method == 'ecc': - # entropy correlation coefficient - marginal_outer = N.outer(marginal_col, marginal_row) - H = joint_histogram * N.log(joint_histogram / marginal_outer) - mutual_information = H.sum() - row_entropy = marginal_row * N.log(marginal_row) - col_entropy = marginal_col * N.log(marginal_col) - ecc = -2.0*mutual_information/(row_entropy.sum() + col_entropy.sum()) - cost = -ecc + joint_histogram += epsilon # prevent log(0) + # normalize the joint histogram + joint_histogram /= joint_histogram.sum() + # get the marginals + marginal_col = joint_histogram.sum(axis=0) + marginal_row = joint_histogram.sum(axis=1) - elif method == 'nmi': - # normalized mutual information - row_entropy = marginal_row * N.log(marginal_row) - col_entropy = marginal_col * N.log(marginal_col) - H = joint_histogram * N.log(joint_histogram) - nmi = (row_entropy.sum() + col_entropy.sum()) / (H.sum()) - cost = -nmi + if method == 'mi': + # mutual information + marginal_outer = NP.outer(marginal_col, marginal_row) + H = joint_histogram * NP.log(joint_histogram / marginal_outer) + mutual_information = H.sum() + cost = -mutual_information - elif method == 'ncc': - # cross correlation from the joint histogram - r, c = joint_histogram.shape - i = N.array(range(1,c+1)) - j = N.array(range(1,r+1)) - m1 = (marginal_row * i).sum() - m2 = (marginal_col * j).sum() - sig1 = N.sqrt((marginal_row*(N.square(i-m1))).sum()) - sig2 = N.sqrt((marginal_col*(N.square(j-m2))).sum()) - [a, b] = N.mgrid[1:c+1, 1:r+1] - a = a - m1 - b = b - m2 - # element multiplies in the joint histogram and grids - H = ((joint_histogram * a) * b).sum() - ncc = H / (N.dot(sig1, sig2)) - cost = -ncc + elif method == 'ecc': + # entropy correlation coefficient + marginal_outer = NP.outer(marginal_col, marginal_row) + H = joint_histogram * NP.log(joint_histogram / marginal_outer) + mutual_information = H.sum() + row_entropy = marginal_row * NP.log(marginal_row) + col_entropy = marginal_col * NP.log(marginal_col) + ecc = -2.0*mutual_information/(row_entropy.sum() + col_entropy.sum()) + cost = -ecc - if ret_histo: - return cost, joint_histogram - else: - return cost + elif method == 'nmi': + # normalized mutual information + row_entropy = marginal_row * NP.log(marginal_row) + col_entropy = marginal_col * NP.log(marginal_col) + H = joint_histogram * NP.log(joint_histogram) + nmi = (row_entropy.sum() + col_entropy.sum()) / (H.sum()) + cost = -nmi + elif method == 'ncc': + # cross correlation from the joint histogram + r, c = joint_histogram.shape + i = NP.array(range(1,c+1)) + j = NP.array(range(1,r+1)) + m1 = (marginal_row * i).sum() + m2 = (marginal_col * j).sum() + sig1 = NP.sqrt((marginal_row*(NP.square(i-m1))).sum()) + sig2 = NP.sqrt((marginal_col*(NP.square(j-m2))).sum()) + [a, b] = NP.mgrid[1:c+1, 1:r+1] + a = a - m1 + b = b - m2 + # element multiplies in the joint histogram and grids + H = ((joint_histogram * a) * b).sum() + ncc = H / (NP.dot(sig1, sig2)) + cost = -ncc + if ret_histo: + return cost, joint_histogram + else: + return cost + + def build_structs(step=1): """ img_data = build_structs(step=1) @@ -708,30 +732,30 @@ storage in the co-registration. Parameters - ....... + ---------- step : {int} : optional default is 1 and is the sample increment in voxels. This sets the sample for x,y,z and is the same value in all 3 axes. only change the default for debug. Returns - ....... + ------- img_data : {dictionary} Examples - ........ + -------- - >>> import numpy as N + >>> import numpy as NP >>> import _registration as reg >>> imdata = reg.build_structs() """ # build image data structures here - P = N.zeros(6, dtype=N.float64); - T = N.zeros(6, dtype=N.float64); - F = N.zeros(2, dtype=N.int32); - S = N.ones(3, dtype=N.int32); - sample = N.zeros(2, dtype=N.int32); + P = NP.zeros(6, dtype=NP.float64); + T = NP.zeros(6, dtype=NP.float64); + F = NP.zeros(2, dtype=NP.int32); + S = NP.ones(3, dtype=NP.int32); + sample = NP.zeros(2, dtype=NP.int32); S[0] = step S[1] = step S[2] = step @@ -765,22 +789,22 @@ takes the 6 element vector (3 angles, 3 translations) and build the 4x4 mapping matrix Parameters - ....... + ---------- img_data_parms : {nd_array} this is the current (6-dim) array with 3 angles and 3 translations. Returns - ....... + ------- rot_matrix: {nd_array} the 4x4 mapping matrix Examples - ........ + -------- - >>> import numpy as N + >>> import numpy as NP >>> import _registration as reg >>> imdata = reg.build_structs() - >>> x = N.zeros(6, dtype=N.float64) + >>> x = NP.zeros(6, dtype=NP.float64) >>> M = reg.build_rotate_matrix(x) >>> M array([[ 1., 0., 0., 0.], @@ -791,10 +815,10 @@ """ - R1 = N.zeros([4,4], dtype=N.float64); - R2 = N.zeros([4,4], dtype=N.float64); - R3 = N.zeros([4,4], dtype=N.float64); - T = N.eye(4, dtype=N.float64); + R1 = NP.zeros([4,4], dtype=NP.float64); + R2 = NP.zeros([4,4], dtype=NP.float64); + R3 = NP.zeros([4,4], dtype=NP.float64); + T = NP.eye(4, dtype=NP.float64); alpha = math.radians(img_data_parms[0]) beta = math.radians(img_data_parms[1]) @@ -829,9 +853,9 @@ T[1][3] = img_data_parms[4] T[2][3] = img_data_parms[5] - rot_matrix = N.dot(T, R1); - rot_matrix = N.dot(rot_matrix, R2); - rot_matrix = N.dot(rot_matrix, R3); + rot_matrix = NP.dot(T, R1); + rot_matrix = NP.dot(rot_matrix, R2); + rot_matrix = NP.dot(rot_matrix, R3); return rot_matrix @@ -847,7 +871,7 @@ The current method uses numpy fromfile and will be replaced by neuroimage nifti load. Parameters - ....... + ---------- imagedesc : {dictionary} imagedesc is the descriptor of the image to be read. @@ -866,7 +890,7 @@ amplitude index where the provided threshold occured. Returns - ....... + ------- image : {dictionary} the volume data assoicated with the filename or a blank volume of the same dimensions as specified in imagedesc. @@ -888,9 +912,9 @@ crosses the 'threshold' provided. Examples - ........ + -------- - >>> import numpy as N + >>> import numpy as NP >>> import _registration as reg >>> anat_desc = reg.load_anatMRI_desc() >>> image_anat, h, ih, index = reg.load_volume(anat_desc, imagename='ANAT1_V0001.img', debug=1) @@ -904,37 +928,37 @@ # autoscale is using integrated histogram to deal with outlier high amplitude voxels if imagename == None: # imagename of none means to create a blank image - ImageVolume = N.zeros(imagedesc['layers']*imagedesc['rows']*imagedesc['cols'], - dtype=N.uint16).reshape(imagedesc['layers'], imagedesc['rows'], imagedesc['cols']) + ImageVolume = NP.zeros(imagedesc['layers']*imagedesc['rows']*imagedesc['cols'], + dtype=NP.uint16).reshape(imagedesc['layers'], imagedesc['rows'], imagedesc['cols']) else: - ImageVolume = N.fromfile(imagename, - dtype=N.uint16).reshape(imagedesc['layers'], imagedesc['rows'], imagedesc['cols']); + ImageVolume = NP.fromfile(imagename, + dtype=NP.uint16).reshape(imagedesc['layers'], imagedesc['rows'], imagedesc['cols']); # the mat (voxel to physical) matrix - M = N.eye(4, dtype=N.float64); + M = NP.eye(4, dtype=NP.float64); # for now just the sample size (mm units) in x, y and z M[0][0] = imagedesc['sample_x'] M[1][1] = imagedesc['sample_y'] M[2][2] = imagedesc['sample_z'] # dimensions - D = N.zeros(3, dtype=N.int32); + D = NP.zeros(3, dtype=NP.int32); # Gaussian kernel - fill in with build_fwhm() - F = N.zeros(3, dtype=N.float64); + F = NP.zeros(3, dtype=NP.float64); D[0] = imagedesc['rows'] D[1] = imagedesc['cols'] D[2] = imagedesc['layers'] if imagename == None: # no voxels to scale to 8 bits - ImageVolume = ImageVolume.astype(N.uint8) + ImageVolume = ImageVolume.astype(NP.uint8) image = {'data' : ImageVolume, 'mat' : M, 'dim' : D, 'fwhm' : F} return image # 8 bit scale with threshold clip of the volume integrated histogram max = ImageVolume.max() min = ImageVolume.min() - ih = N.zeros(max-min+1, dtype=N.float64); - h = N.zeros(max-min+1, dtype=N.float64); + ih = NP.zeros(max-min+1, dtype=NP.float64); + h = NP.zeros(max-min+1, dtype=NP.float64); if threshold <= 0: threshold = 0.999 elif threshold > 1.0: @@ -944,9 +968,9 @@ index = R.register_image_threshold(ImageVolume, h, ih, threshold) scale = 255.0 / (index-min) # generate the scaled 8 bit image - images = (scale*(ImageVolume.astype(N.float)-min)) + images = (scale*(ImageVolume.astype(NP.float)-min)) images[images>255] = 255 - image = {'data' : images.astype(N.uint8), 'mat' : M, 'dim' : D, 'fwhm' : F} + image = {'data' : images.astype(NP.uint8), 'mat' : M, 'dim' : D, 'fwhm' : F} if debug == 1: return image, h, ih, index else: @@ -1017,14 +1041,14 @@ (layers, rows, cols) = image['data'].shape M = image['mat'] * scale # dimensions - D = N.zeros(3, dtype=N.int32); + D = NP.zeros(3, dtype=NP.int32); # Gaussian kernel - fill in with build_fwhm() - F = N.zeros(3, dtype=N.float64); - Z = N.zeros(3, dtype=N.float64); + F = NP.zeros(3, dtype=NP.float64); + Z = NP.zeros(3, dtype=NP.float64); D[0] = rows/scale D[1] = cols/scale D[2] = layers/scale - image2 = N.zeros(D[2]*D[1]*D[0], dtype=N.uint8).reshape(D[2], D[0], D[1]); + image2 = NP.zeros(D[2]*D[1]*D[0], dtype=NP.uint8).reshape(D[2], D[0], D[1]); mode = 1; R.register_volume_resample(image['data'], image2, Z, scale, mode) scaled_image = {'data' : image2, 'mat' : M, 'dim' : D, 'fwhm' : F} @@ -1146,7 +1170,7 @@ imageF_anat['fwhm'] = build_fwhm(imageF_anat['mat'], imdata['step']) # read in the file list of the fMRI data - metric_test = N.dtype([('cost', 'f'), + metric_test = NP.dtype([('cost', 'f'), ('align_cost', 'f'), ('rotate', 'f', 6), ('align_rotate', 'f', 6)]) @@ -1154,11 +1178,11 @@ fMRIdata = read_fMRI_directory('fMRIData\*.img') fmri_desc = load_fMRI_desc() fmri_series = {} - ave_fMRI_volume = N.zeros(fmri_desc['layers']*fmri_desc['rows']*fmri_desc['cols'], - dtype=N.float64).reshape(fmri_desc['layers'], fmri_desc['rows'], fmri_desc['cols']) + ave_fMRI_volume = NP.zeros(fmri_desc['layers']*fmri_desc['rows']*fmri_desc['cols'], + dtype=NP.float64).reshape(fmri_desc['layers'], fmri_desc['rows'], fmri_desc['cols']) count = 0 number_volumes = len(fMRIdata) - measures = N.zeros(number_volumes, dtype=metric_test) + measures = NP.zeros(number_volumes, dtype=metric_test) # load and perturb (rotation, translation) the fMRI volumes for i in fMRIdata: image = load_volume(fmri_desc, i) @@ -1168,7 +1192,7 @@ fmri_series[count] = image count = count + 1 else: - x = N.random.random(6) - 0.5 + x = NP.random.random(6) - 0.5 x = 10.0 * x fmri_series[count] = demo_rotate_fMRI_volume(image, x) measures[count]['rotate'][0:6] = x[0:6] @@ -1194,15 +1218,15 @@ # align the volumes and average them for co-registration with the anatomical MRI - ave_fMRI_volume = fmri_series[0]['data'].astype(N.float64) + ave_fMRI_volume = fmri_series[0]['data'].astype(NP.float64) for i in range(1, number_volumes): image = fmri_series[i] x[0:6] = measures[i]['align_rotate'][0:6] # overwrite the fMRI volume with the aligned volume fmri_series[i] = remap_image(image, x, resample='cubic') - ave_fMRI_volume = ave_fMRI_volume + fmri_series[i]['data'].astype(N.float64) + ave_fMRI_volume = ave_fMRI_volume + fmri_series[i]['data'].astype(NP.float64) - ave_fMRI_volume = (ave_fMRI_volume / float(number_volumes)).astype(N.uint8) + ave_fMRI_volume = (ave_fMRI_volume / float(number_volumes)).astype(NP.uint8) ave_fMRI_volume = {'data' : ave_fMRI_volume, 'mat' : imageF['mat'], 'dim' : imageF['dim'], 'fwhm' : imageF['fwhm']} # register (using normalized mutual information) with the anatomical MRI From scipy-svn at scipy.org Thu Mar 27 20:28:13 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Thu, 27 Mar 2008 19:28:13 -0500 (CDT) Subject: [Scipy-svn] r4056 - trunk/scipy/ndimage Message-ID: <20080328002813.0879039C01B@new.scipy.org> Author: tom.waite Date: 2008-03-27 19:28:09 -0500 (Thu, 27 Mar 2008) New Revision: 4056 Modified: trunk/scipy/ndimage/_segmenter.py Log: Fixed docstring underline. Modified: trunk/scipy/ndimage/_segmenter.py =================================================================== --- trunk/scipy/ndimage/_segmenter.py 2008-03-28 00:27:43 UTC (rev 4055) +++ trunk/scipy/ndimage/_segmenter.py 2008-03-28 00:28:09 UTC (rev 4056) @@ -41,7 +41,7 @@ hystereis stage of Canny filter Parameters - .......... + ---------- magnitude : {nd_array} the output from the canny_nonmax_supress() method @@ -50,7 +50,7 @@ contains the low and high thesholds determined from canny_nonmax_supress() Returns - .......... + ---------- edge_image : {nd_array} the labeled edge image that can be displayed and used for later processing @@ -70,7 +70,7 @@ non-max supression stage of Canny filter Parameters - .......... + ---------- horz_DGFilter : {nd_array} the horizonal filtered image using the derivative of Gaussian kernel filter. @@ -96,7 +96,7 @@ high threshold applied to magnitude filtered Returns - .......... + ---------- magnitude : {nd_array} magnitude of X and Y filtered for critical samples @@ -123,7 +123,7 @@ returns the X and Y filterd image Parameters - .......... + ---------- slice : {nd_array} 2D image array @@ -132,7 +132,7 @@ derivative of Gaussian kernel from build_d_gauss_kernel() Returns - .......... + ---------- horz_DGFilter : {nd_array} X filtered image @@ -165,7 +165,7 @@ bounding box set equal to the full image Parameters - .......... + ---------- label_image : {nd_array} an image with labeled regions from get_blobs() method @@ -177,7 +177,7 @@ Region of Interest structure that has blob bounding boxes Returns - .......... + ---------- mat_image : {nd_array} thinned edge image @@ -257,7 +257,7 @@ texture_filter(raw_image, label_image, laws_kernel, ROI=None, verbose=0) Parameters - .......... + ---------- raw_image : {nd_array} raw double image @@ -285,7 +285,7 @@ determines if return is to include Law's filter images Returns - .......... + ---------- laws_image : {dictionary} contains 21 Laws filtered regions for each ROI @@ -360,7 +360,7 @@ from each ROI in the raw data. Parameters - .......... + ---------- label_image : {nd_array} an image with labeled regions from get_blobs() method @@ -373,7 +373,7 @@ Returns - .......... + ---------- none @@ -416,7 +416,7 @@ stage processing to add blob features. Parameters - .......... + ---------- label_image : {nd_array} an image with labeled regions from get_blobs() method @@ -425,7 +425,7 @@ number of blobs in image determined by get_blobs() method Returns - .......... + ---------- ROIList : {dictionary} structure that has the bounding box and area of each blob @@ -472,13 +472,13 @@ image to labelled regions Parameters - .......... + ---------- binary_edge_image : {nd_array} an binary image Returns - .......... + ---------- label_image : {nd_array} an image with labeled regions from get_blobs() method @@ -500,7 +500,7 @@ take sobel-filtered image and return binary edges Parameters - .......... + ---------- sobel_edge_image : {nd_array} edge-filtered image from sobel_image() method @@ -515,7 +515,7 @@ low threshold applied to edge filtered image for edge generation Returns - .......... + ---------- sobel_edge : {nd_array} binary edge-image @@ -536,13 +536,13 @@ take 2D raw or filtered image slice and get sobel-filtered image Parameters - .......... + ---------- filtered_slice : {nd_array} raw or pre-processed (filtered and thresholded) 2D image Returns - .......... + ---------- sobel_edge_image : {nd_array} edge-filtered image from sobel_image() method @@ -574,7 +574,7 @@ take 2D image slice and filter and pre-filter and threshold prior to segmentation Parameters - .......... + ---------- slice : {nd_array} input 2D image. gets cast to int16 @@ -592,7 +592,7 @@ is binary conversion off Returns - .......... + ---------- edge_filter : {nd_array} filtered and thresholded image that can be (optional) binary. @@ -623,14 +623,14 @@ take an ROI structure and find the maximum area bounding box Parameters - .......... + ---------- ROI : {dictionary} the ROI is the automatically extracted blob regions of interest and contains the rectangular bounding box of each blob. Returns - .......... + ---------- bounding_box : {dictionary} the Left, Right, Top and Bottom of the LARGEST bounding box in the ROI @@ -649,14 +649,14 @@ get all bounding boxes in the ROI (feature) dictionary Parameters - .......... + ---------- ROI : {dictionary} the ROI is the automatically extracted blob regions of interest and contains the rectangular bounding box of each blob. Returns - .......... + ---------- measures : {dictionary} the Left, Right, Top and Bottom of all bounding boxes in the ROI @@ -687,7 +687,7 @@ build hamming-windowed FIR filter with sinc kernel Parameters - .......... + ---------- aperature : {int}, optional the number of coefficients in the filter. default is 21. needs to be ODD @@ -696,7 +696,7 @@ the upper cutoff in digital frequency units Returns - .......... + ---------- FIRFilter : {dictionary} filter kernel @@ -741,7 +741,7 @@ build the derivative of Gaussian kernel for Canny edge filter Parameters - .......... + ---------- gWdith : {int}, optional width of derivative of Gaussian kernel. default value is 20 @@ -751,7 +751,7 @@ default value is 1.0 Returns - .......... + ---------- DGFilter : {dictionary} filter kernel @@ -779,12 +779,12 @@ Parameters - .......... + ---------- None Returns - .......... + ---------- MATFilter : {dictionary} morphology filter kernels. there are 2 sets of 8 3x3 masks @@ -898,12 +898,12 @@ Parameters - .......... + ---------- None Returns - .......... + ---------- LAWSFilter : {dictionary} a set of 6 length-7 Laws texture kernels @@ -934,13 +934,13 @@ used in Laws texture feature extraction. Parameters - .......... + ---------- LAWSFilter : {dictionary} a set of 6 length-7 Laws texture kernels Returns - .......... + ---------- masks : {list} a list of 21 7x7 kernels (2D nd_array) @@ -993,12 +993,12 @@ builds 4 discs with plane wave texture. used for test and demo Parameters - .......... + ---------- None Returns - .......... + ---------- discs : {nd_array} a 512x512 image with 4 test discs (one per quadrant) @@ -1026,12 +1026,12 @@ build 4 discs of equal radius and different mean values for edge/blob testing Parameters - .......... + ---------- None Returns - .......... + ---------- test_image : {nd_array} a 512x512 image with 4 test discs (one per quadrant) @@ -1062,12 +1062,12 @@ build 2 discs of equal radius and same mean values for texture testing Parameters - .......... + ---------- None Returns - .......... + ---------- test_image : {nd_array} a 512x512 image with 4 test discs (one per quadrant) @@ -1099,12 +1099,12 @@ with these test patterns will return Law's kernel outer product matrices. Parameters - .......... + ---------- None Returns - .......... + ---------- test_image : {nd_array} a 512x512 image with 4 test discs (one per quadrant) From scipy-svn at scipy.org Mon Mar 31 10:43:36 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Mon, 31 Mar 2008 09:43:36 -0500 (CDT) Subject: [Scipy-svn] r4057 - trunk/scipy/sparse/linalg/eigen Message-ID: <20080331144336.2185139C13A@new.scipy.org> Author: wnbell Date: 2008-03-31 09:43:29 -0500 (Mon, 31 Mar 2008) New Revision: 4057 Added: trunk/scipy/sparse/linalg/eigen/lobpcg/ Log: copied lobpcg to sparse.linalg.eigen Copied: trunk/scipy/sparse/linalg/eigen/lobpcg (from rev 4056, trunk/scipy/sandbox/lobpcg) From scipy-svn at scipy.org Mon Mar 31 13:35:37 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Mon, 31 Mar 2008 12:35:37 -0500 (CDT) Subject: [Scipy-svn] r4058 - trunk/scipy/sparse/linalg/eigen/lobpcg Message-ID: <20080331173537.D780C39C018@new.scipy.org> Author: wnbell Date: 2008-03-31 12:35:30 -0500 (Mon, 31 Mar 2008) New Revision: 4058 Removed: trunk/scipy/sparse/linalg/eigen/lobpcg/README Modified: trunk/scipy/sparse/linalg/eigen/lobpcg/__init__.py trunk/scipy/sparse/linalg/eigen/lobpcg/info.py trunk/scipy/sparse/linalg/eigen/lobpcg/lobpcg.py trunk/scipy/sparse/linalg/eigen/lobpcg/setup.py Log: updated docstrings Deleted: trunk/scipy/sparse/linalg/eigen/lobpcg/README =================================================================== --- trunk/scipy/sparse/linalg/eigen/lobpcg/README 2008-03-31 14:43:29 UTC (rev 4057) +++ trunk/scipy/sparse/linalg/eigen/lobpcg/README 2008-03-31 17:35:30 UTC (rev 4058) @@ -1,12 +0,0 @@ -Pure SciPy implementation of Locally Optimal Block Preconditioned Conjugate -Gradient Method (LOBPCG), see -http://www-math.cudenver.edu/~aknyazev/software/BLOPEX/ - -lobpcg.py code was written by Robert Cimrman. Many thanks belong to Andrew -Knyazev, the author of the algorithm, for lots of advice and support. - -The algorithm of LOBPCG is described in detail in: - -A. V. Knyazev, Toward the Optimal Preconditioned Eigensolver: Locally Optimal Block Preconditioned Conjugate Gradient Method. SIAM Journal on Scientific Computing 23 (2001), no. 2, pp. 517-541. http://dx.doi.org/10.1137/S1064827500366124 - -A. V. Knyazev, I. Lashuk, M. E. Argentati, and E. Ovchinnikov, Block Locally Optimal Preconditioned Eigenvalue Xolvers (BLOPEX) in hypre and PETSc (2007). http://arxiv.org/abs/0705.2626 Modified: trunk/scipy/sparse/linalg/eigen/lobpcg/__init__.py =================================================================== --- trunk/scipy/sparse/linalg/eigen/lobpcg/__init__.py 2008-03-31 14:43:29 UTC (rev 4057) +++ trunk/scipy/sparse/linalg/eigen/lobpcg/__init__.py 2008-03-31 17:35:30 UTC (rev 4058) @@ -1,4 +1,4 @@ -"LOBPCG" +"""LOBPCG eigensolver""" from info import __doc__ import lobpcg Modified: trunk/scipy/sparse/linalg/eigen/lobpcg/info.py =================================================================== --- trunk/scipy/sparse/linalg/eigen/lobpcg/info.py 2008-03-31 14:43:29 UTC (rev 4057) +++ trunk/scipy/sparse/linalg/eigen/lobpcg/info.py 2008-03-31 17:35:30 UTC (rev 4058) @@ -1,88 +1,108 @@ """ -The algorithm of LOBPCG is described in detail in: +Locally Optimal Block Preconditioned Conjugate Gradient Method (LOBPCG) -A. V. Knyazev, Toward the Optimal Preconditioned Eigensolver: Locally Optimal -Block Preconditioned Conjugate Gradient Method. SIAM Journal on Scientific -Computing 23 (2001), no. 2, -pp. 517-541. http://dx.doi.org/10.1137/S1064827500366124 +LOBPCG is a preconditioned eigensolver for large symmetric positive definite +(SPD) generalized eigenproblems. -A. V. Knyazev, I. Lashuk, M. E. Argentati, and E. Ovchinnikov, Block Locally -Optimal Preconditioned Eigenvalue Xolvers (BLOPEX) in hypre and PETSc -(2007). http://arxiv.org/abs/0705.2626 - Call the function lobpcg - see help for lobpcg.lobpcg. See also lobpcg.as2d, which can be used in the preconditioner (example below) -Example: +Acknowledgements +---------------- - # Solve A x = lambda B x with constraints and preconditioning. +lobpcg.py code was written by Robert Cimrman. Many thanks belong to Andrew +Knyazev, the author of the algorithm, for lots of advice and support. - n = 100 - vals = [nm.arange( n, dtype = nm.float64 ) + 1] +Examples +-------- - # Matrix A. - operatorA = spdiags( vals, 0, n, n ) - - # Matrix B - operatorB = nm.eye( n, n ) - - # Constraints. - Y = nm.eye( n, 3 ) - - # Initial guess for eigenvectors, should have linearly independent - # columns. Column dimension = number of requested eigenvalues. - X = sc.rand( n, 3 ) - - # Preconditioner - inverse of A. - ivals = [1./vals[0]] - def precond( x ): +>>> # Solve A x = lambda B x with constraints and preconditioning. +>>> n = 100 +>>> vals = [nm.arange( n, dtype = nm.float64 ) + 1] +>>> # Matrix A. +>>> operatorA = spdiags( vals, 0, n, n ) +>>> # Matrix B +>>> operatorB = nm.eye( n, n ) +>>> # Constraints. +>>> Y = nm.eye( n, 3 ) +>>> # Initial guess for eigenvectors, should have linearly independent +>>> # columns. Column dimension = number of requested eigenvalues. +>>> X = sc.rand( n, 3 ) +>>> # Preconditioner - inverse of A. +>>> ivals = [1./vals[0]] +>>> def precond( x ): invA = spdiags( ivals, 0, n, n ) y = invA * x if sp.issparse( y ): y = y.toarray() - + return as2d( y ) - # Alternative way of providing the same preconditioner. - #precond = spdiags( ivals, 0, n, n ) - tt = time.clock() - eigs, vecs = lobpcg( X, operatorA, operatorB, blockVectorY = Y, - operatorT = precond, - residualTolerance = 1e-4, maxIterations = 40, - largest = False, verbosityLevel = 1 ) - print 'solution time:', time.clock() - tt - print eigs +>>> +>>> # Alternative way of providing the same preconditioner. +>>> #precond = spdiags( ivals, 0, n, n ) +>>> +>>> tt = time.clock() +>>> eigs, vecs = lobpcg( X, operatorA, operatorB, blockVectorY = Y, +>>> operatorT = precond, +>>> residualTolerance = 1e-4, maxIterations = 40, +>>> largest = False, verbosityLevel = 1 ) +>>> print 'solution time:', time.clock() - tt +>>> print eigs -Usage notes: -Notation: n - matrix size, m - number of required eigenvalues (smallest or -largest) -1) The LOBPCG code internally solves eigenproblems of the size 3m on every - iteration by calling the"standard" eigensolver, so if m is not small enough - compared to n, it does not make sense to call the LOBPCG code, but rather - one should use the "standard" eigensolver, e.g. symeig function in this - case. If one calls the LOBPCG algorithm for 5m>n, it will most likely break - internally, so the code tries to call symeig instead. +Notes +----- - It is not that n should be large for the LOBPCG to work, but rather the - ratio n/m should be large. It you call the LOBPCG code with m=1 and n=10, it - should work, though n is small. The method is intended for extremely large - n/m, see e.g., reference [28] in http://arxiv.org/abs/0705.2626 +In the following ``n`` denotes the matrix size and ``m`` the number +of required eigenvalues (smallest or largest). -2) The convergence speed depends basically on two factors: +The LOBPCG code internally solves eigenproblems of the size 3``m`` on every +iteration by calling the "standard" dense eigensolver, so if ``m`` is not +small enough compared to ``n``, it does not make sense to call the LOBPCG +code, but rather one should use the "standard" eigensolver, e.g. symeig +function in this case. If one calls the LOBPCG algorithm for 5``m``>``n``, +it will most likely break internally, so the code tries to call symeig +instead. - a) how well relatively separated the seeking eigenvalues are from the rest of - the eigenvalues. One can try to vary m to make this better. +It is not that n should be large for the LOBPCG to work, but rather the +ratio ``n``/``m`` should be large. It you call the LOBPCG code with ``m``=1 +and ``n``=10, it should work, though ``n`` is small. The method is intended +for extremely large ``n``/``m``, see e.g., reference [28] in +http://arxiv.org/abs/0705.2626 - b) how "well conditioned" the problem is. This can be changed by using proper - preconditioning. For example, a rod vibration test problem (under tests - directory) is ill-conditioned - for large n, so convergence will be slow, unless efficient preconditioning is - used. For this specific problem, a good simple preconditioner function would - be a linear solve for A, which is easy to code since A is tridiagonal. +The convergence speed depends basically on two factors: +1. How well relatively separated the seeking eigenvalues are from the rest of + the eigenvalues. One can try to vary ``m`` to make this better. + +2. How well conditioned the problem is. This can be changed by using proper + preconditioning. For example, a rod vibration test problem (under tests + directory) is ill-conditioned for large ``n``, so convergence will be + slow, unless efficient preconditioning is used. For this specific problem, + a good simple preconditioner function would be a linear solve for A, which + is easy to code since A is tridiagonal. + + +References +---------- +A. V. Knyazev, Toward the Optimal Preconditioned Eigensolver: Locally Optimal +Block Preconditioned Conjugate Gradient Method. SIAM Journal on Scientific +Computing 23 (2001), no. 2, +pp. 517-541. http://dx.doi.org/10.1137/S1064827500366124 + +A. V. Knyazev, I. Lashuk, M. E. Argentati, and E. Ovchinnikov, Block Locally +Optimal Preconditioned Eigenvalue Xolvers (BLOPEX) in hypre and PETSc +(2007). http://arxiv.org/abs/0705.2626 + +A. V. Knyazev's C and MATLAB implementations: +http://www-math.cudenver.edu/~aknyazev/software/BLOPEX/ + """ + +__docformat__ = "restructuredtext en" + postpone_import = 1 Modified: trunk/scipy/sparse/linalg/eigen/lobpcg/lobpcg.py =================================================================== --- trunk/scipy/sparse/linalg/eigen/lobpcg/lobpcg.py 2008-03-31 14:43:29 UTC (rev 4057) +++ trunk/scipy/sparse/linalg/eigen/lobpcg/lobpcg.py 2008-03-31 17:35:30 UTC (rev 4058) @@ -138,59 +138,61 @@ residualTolerance = None, maxIterations = 20, largest = True, verbosityLevel = 0, retLambdaHistory = False, retResidualNormsHistory = False ): - """ - LOBPCG solves symmetric partial eigenproblems using preconditioning. + """LOBPCG solves symmetric partial eigenproblems using preconditioning. - Required input: + TODO write in terms of Ax=lambda B x - blockVectorX - initial approximation to eigenvectors, full or sparse matrix - n-by-blockSize + Parameters + ---------- + blockVectorX : array_like + initial approximation to eigenvectors shape=(n,blockSize) + operatorA : {dense matrix, sparse matrix, LinearOperator} + the linear operator of the problem, usually a sparse matrix + often called the "stiffness matrix" - operatorA - the operator of the problem, can be given as a matrix or as an - M-file + Returns + ------- + (lambda,blockVectorV) : tuple of arrays + blockVectorX and lambda are computed blockSize eigenpairs, where + blockSize=size(blockVectorX,2) for the initial guess blockVectorX + if it is full rank. + Other Parameters + ---------------- + operatorB : {dense matrix, sparse matrix, LinearOperator} + the right hand side operator in a generalized eigenproblem. + by default, operatorB = Identity + often called the "mass matrix" + operatorT : {dense matrix, sparse matrix, LinearOperator} + preconditioner to operatorA; by default operatorT = Identity + operatorT should approximate the inverse of operatorA + blockVectorY : array_like + n-by-sizeY matrix of constraints, sizeY < n + The iterations will be performed in the (operatorB-) orthogonal + complement of the column-space of blockVectorY. + blockVectorY must be full rank. - Optional input: + residualTolerance : scalar + solver tolerance. default: residualTolerance=n*sqrt(eps) + maxIterations: integer + maximum number of iterations + by default: maxIterations=min(n,20) + largest : boolean + when True, solve for the largest eigenvalues, otherwise the smallest + verbosityLevel : integer + controls solver output. default: verbosityLevel = 0. + retLambdaHistory : boolean + whether to return eigenvalue history + retResidualNormsHistory : boolean + whether to return history of residual norms - operatorB - the second operator, if solving a generalized eigenproblem; by - default, or if empty, operatorB = I. - operatorT - preconditioner; by default, operatorT = I. - - - Optional constraints input: - - blockVectorY - n-by-sizeY matrix of constraints, sizeY < n. The iterations - will be performed in the (operatorB-) orthogonal complement of the - column-space of blockVectorY. blockVectorY must be full rank. - - - Optional scalar input parameters: - - residualTolerance - tolerance, by default, residualTolerance=n*sqrt(eps) - - maxIterations - max number of iterations, by default, maxIterations = - min(n,20) - - largest - when true, solve for the largest eigenvalues, otherwise for the - smallest - - verbosityLevel - by default, verbosityLevel = 0. - - retLambdaHistory - return eigenvalue history - - retResidualNormsHistory - return history of residual norms - - Output: - - blockVectorX and lambda are computed blockSize eigenpairs, where - blockSize=size(blockVectorX,2) for the initial guess blockVectorX if it is - full rank. - + Notes + ----- If both retLambdaHistory and retResidualNormsHistory are True, the - return tuple has the flollowing order: + return tuple has the following format: + (lambda, blockVectorV, lambda history, residual norms history) - lambda, blockVectorX, lambda history, residual norms history """ failureFlag = True Modified: trunk/scipy/sparse/linalg/eigen/lobpcg/setup.py =================================================================== --- trunk/scipy/sparse/linalg/eigen/lobpcg/setup.py 2008-03-31 14:43:29 UTC (rev 4057) +++ trunk/scipy/sparse/linalg/eigen/lobpcg/setup.py 2008-03-31 17:35:30 UTC (rev 4058) @@ -1,6 +1,4 @@ #!/usr/bin/env python -from os.path import join -import sys def configuration(parent_package='',top_path=None): from numpy.distutils.misc_util import Configuration From scipy-svn at scipy.org Mon Mar 31 16:51:46 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Mon, 31 Mar 2008 15:51:46 -0500 (CDT) Subject: [Scipy-svn] r4059 - in trunk/scipy/sparse/linalg/eigen: . lobpcg lobpcg/tests Message-ID: <20080331205146.7AE8139C15D@new.scipy.org> Author: wnbell Date: 2008-03-31 15:51:41 -0500 (Mon, 31 Mar 2008) New Revision: 4059 Modified: trunk/scipy/sparse/linalg/eigen/lobpcg/lobpcg.py trunk/scipy/sparse/linalg/eigen/lobpcg/tests/test_lobpcg.py trunk/scipy/sparse/linalg/eigen/setup.py Log: reworked LOBPCG unittests Modified: trunk/scipy/sparse/linalg/eigen/lobpcg/lobpcg.py =================================================================== --- trunk/scipy/sparse/linalg/eigen/lobpcg/lobpcg.py 2008-03-31 17:35:30 UTC (rev 4058) +++ trunk/scipy/sparse/linalg/eigen/lobpcg/lobpcg.py 2008-03-31 20:51:41 UTC (rev 4059) @@ -296,8 +296,7 @@ # gramYBY is a Cholesky factor from now on... gramYBY = la.cho_factor( gramYBY ) except: - print 'cannot handle linear dependent constraints' - raise + raise ValueError('cannot handle linear dependent constraints') applyConstraints( blockVectorX, gramYBY, blockVectorBY, blockVectorY ) Modified: trunk/scipy/sparse/linalg/eigen/lobpcg/tests/test_lobpcg.py =================================================================== --- trunk/scipy/sparse/linalg/eigen/lobpcg/tests/test_lobpcg.py 2008-03-31 17:35:30 UTC (rev 4058) +++ trunk/scipy/sparse/linalg/eigen/lobpcg/tests/test_lobpcg.py 2008-03-31 20:51:41 UTC (rev 4059) @@ -1,11 +1,25 @@ +#!/usr/bin/env python +""" Test functions for the sparse.linalg.eigen.lobpcg module +""" + +import numpy +from scipy.testing import * + from scipy import array, arange, ones, sort, cos, pi, rand, \ set_printoptions, r_, diag, linalg -from scipy.sandbox import lobpcg -from symeig import symeig -from pylab import plot, show, legend, xlabel, ylabel +from scipy.sparse.linalg.eigen import lobpcg + +try: + from symeig import symeig +except: + raise ImportError('lobpcg requires symeig') + set_printoptions(precision=3,linewidth=90) -def check1(n): + + +def ElasticRod(n): + # Fixed-free elastic rod L = 1.0 le=L/n rho = 7.85e3 @@ -17,7 +31,9 @@ B = mass*(diag(r_[4.*ones(n-1),2])+diag(ones(n-1),1)+diag(ones(n-1),-1)) return A,B -def check2(n): +def MikotaPair(n): + # Mikota pair acts as a nice test since the eigenvalues + # are the squares of the integers n, n=1,2,... x = arange(1,n+1) B = diag(1./x) y = arange(n-1,0,-1) @@ -25,24 +41,39 @@ A = diag(z)-diag(y,-1)-diag(y,1) return A,B -n = 100 # Dimension -def test_1and2(): - A,B = check1(n) # Fixed-free elastic rod - A,B = check2(n) # Mikota pair acts as a nice test since the eigenvalues are the squares of the integers n, n=1,2,... - - m = 20 +def compare_solutions(A,B,m): + n = A.shape[0] + + numpy.random.seed(0) + V = rand(n,m) X = linalg.orth(V) - eigs,vecs = lobpcg.lobpcg(X,A,B) - eigs = sort(eigs) + eigs,vecs = lobpcg.lobpcg(X,A,B,residualTolerance=1e-5, maxIterations=30) + eigs.sort() - w,v=symeig(A,B) + w,v = symeig(A,B) - plot(arange(0,len(w[:m])),w[:m],'bx',label='Results by symeig') - plot(arange(0,len(eigs)),eigs,'r+',label='Results by lobpcg') - legend() - xlabel(r'Eigenvalue $i$') - ylabel(r'$\lambda_i$') - show() + assert_almost_equal(w[:m/2],eigs[:m/2],decimal=2) + + #from pylab import plot, show, legend, xlabel, ylabel + #plot(arange(0,len(w[:m])),w[:m],'bx',label='Results by symeig') + #plot(arange(0,len(eigs)),eigs,'r+',label='Results by lobpcg') + #legend() + #xlabel(r'Eigenvalue $i$') + #ylabel(r'$\lambda_i$') + #show() + + +def test_ElasticRod(): + A,B = ElasticRod(100) + compare_solutions(A,B,20) + +def test_MikotaPair(): + A,B = MikotaPair(100) + compare_solutions(A,B,20) + + +if __name__ == "__main__": + nose.run(argv=['', __file__]) Modified: trunk/scipy/sparse/linalg/eigen/setup.py =================================================================== --- trunk/scipy/sparse/linalg/eigen/setup.py 2008-03-31 17:35:30 UTC (rev 4058) +++ trunk/scipy/sparse/linalg/eigen/setup.py 2008-03-31 20:51:41 UTC (rev 4059) @@ -6,6 +6,7 @@ config = Configuration('eigen',parent_package,top_path) config.add_subpackage(('arpack')) + #config.add_subpackage(('lobpcg')) return config From scipy-svn at scipy.org Mon Mar 31 21:55:42 2008 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Mon, 31 Mar 2008 20:55:42 -0500 (CDT) Subject: [Scipy-svn] r4060 - in trunk/scipy/sparse/linalg: . tests Message-ID: <20080401015542.ECD2839C012@new.scipy.org> Author: wnbell Date: 2008-03-31 20:55:34 -0500 (Mon, 31 Mar 2008) New Revision: 4060 Modified: trunk/scipy/sparse/linalg/interface.py trunk/scipy/sparse/linalg/tests/test_interface.py Log: added matmat() support to LinearOperator Modified: trunk/scipy/sparse/linalg/interface.py =================================================================== --- trunk/scipy/sparse/linalg/interface.py 2008-03-31 20:51:41 UTC (rev 4059) +++ trunk/scipy/sparse/linalg/interface.py 2008-04-01 01:55:34 UTC (rev 4060) @@ -1,48 +1,54 @@ import numpy -from numpy import matrix, ndarray, asarray, dot, atleast_2d +from numpy import matrix, ndarray, asarray, dot, atleast_2d, hstack from scipy.sparse.sputils import isshape from scipy.sparse import isspmatrix __all__ = ['LinearOperator', 'aslinearoperator'] class LinearOperator: - def __init__( self, shape, matvec, rmatvec=None, dtype=None ): - """Common interface for performing matrix vector products + """Common interface for performing matrix vector products - Many iterative methods (e.g. cg, gmres) do not need to know the - individual entries of a matrix to solve a linear system A*x=b. - Such solvers only require the computation of matrix vector - products, A*v where v is a dense vector. This class serves as - an abstract interface between iterative solvers and matrix-like - objects. + Many iterative methods (e.g. cg, gmres) do not need to know the + individual entries of a matrix to solve a linear system A*x=b. + Such solvers only require the computation of matrix vector + products, A*v where v is a dense vector. This class serves as + an abstract interface between iterative solvers and matrix-like + objects. - Required Parameters: - shape : tuple of matrix dimensions (M,N) - matvec(x) : function that returns A * x + Required Parameters + ------------------- + shape : tuple of matrix dimensions (M,N) + matvec(x) : function that returns A * v - Optional Parameters: - rmatvec(x) : function that returns A^H * x where A^H represents - the Hermitian (conjugate) transpose of A - dtype : data type of the matrix - + Optional Parameters + ------------------- + rmatvec(v) : function that returns A^H * v where A^H represents + the Hermitian (conjugate) transpose of A + matmat(V) : function that returns A * V where V is a dense + matrix with dimensions (N,K) + dtype : data type of the matrix + - See Also: - aslinearoperator() : Construct LinearOperators for SciPy classes + See Also + -------- + aslinearoperator() : Construct LinearOperators for SciPy classes - Example: + Examples + -------- - >>> from scipy.sparse.linalg import LinearOperator - >>> from scipy import * - >>> def mv(x): - ... return array([ 2*x[0], 3*x[1]]) - ... - >>> A = LinearOperator( (2,2), matvec=mv ) - >>> A - <2x2 LinearOperator with unspecified dtype> - >>> A.matvec( ones(2) ) - array([ 2., 3.]) - - """ + >>> from scipy.sparse.linalg import LinearOperator + >>> from scipy import * + >>> def mv(v): + ... return array([ 2*v[0], 3*v[1]]) + ... + >>> A = LinearOperator( (2,2), matvec=mv ) + >>> A + <2x2 LinearOperator with unspecified dtype> + >>> A.matvec( ones(2) ) + array([ 2., 3.]) + + """ + def __init__( self, shape, matvec, rmatvec=None, matmat=None, dtype=None ): shape = tuple(shape) @@ -53,12 +59,21 @@ self.matvec = matvec if rmatvec is None: - def rmatvec(x): + def rmatvec(v): raise NotImplementedError('rmatvec is not defined') self.rmatvec = rmatvec else: self.rmatvec = rmatvec + if matmat is None: + # matvec each column of V + def matmat(V): + V = asarray(V) + return hstack( [ matvec(col.reshape(-1,1)) for col in V.T ] ) + self.matmat = matmat + else: + self.matmat = matmat + if dtype is not None: self.dtype = numpy.dtype(dtype) @@ -102,14 +117,18 @@ A = atleast_2d(asarray(A)) - def matvec(x): - return dot(A,x) - def rmatvec(x): - return dot(A.conj().transpose(),x) - return LinearOperator( A.shape, matvec, rmatvec=rmatvec, dtype=A.dtype ) + def matvec(v): + return dot(A, v) + def rmatvec(v): + return dot(A.conj().transpose(), v) + def matmat(V): + return dot(A, V) + return LinearOperator( A.shape, matvec, rmatvec=rmatvec, \ + matmat=matmat, dtype=A.dtype ) elif isspmatrix(A): - return LinearOperator( A.shape, A.matvec, rmatvec=A.rmatvec, dtype=A.dtype ) + return LinearOperator( A.shape, A.matvec, rmatvec=A.rmatvec, \ + matmat=A.dot, dtype=A.dtype ) else: if hasattr(A,'shape') and hasattr(A,'matvec'): Modified: trunk/scipy/sparse/linalg/tests/test_interface.py =================================================================== --- trunk/scipy/sparse/linalg/tests/test_interface.py 2008-03-31 20:51:41 UTC (rev 4059) +++ trunk/scipy/sparse/linalg/tests/test_interface.py 2008-04-01 01:55:34 UTC (rev 4060) @@ -42,12 +42,15 @@ A = aslinearoperator(M) M,N = A.shape - assert_equal(A.matvec(array([1,2,3])), [14,32]) - assert_equal(A.matvec(array([[1],[2],[3]])),[[14],[32]]) + assert_equal(A.matvec(array([1,2,3])), [14,32]) + assert_equal(A.matvec(array([[1],[2],[3]])), [[14],[32]]) - assert_equal(A.rmatvec(array([1,2])), [9,12,15]) - assert_equal(A.rmatvec(array([[1],[2]])),[[9],[12],[15]]) + assert_equal(A.rmatvec(array([1,2])), [9,12,15]) + assert_equal(A.rmatvec(array([[1],[2]])), [[9],[12],[15]]) + assert_equal(A.matmat(array([[1,4],[2,5],[3,6]])), \ + [[14,32],[32,77]] ) + if hasattr(M,'dtype'): assert_equal(A.dtype, M.dtype)