diff --git a/.github/workflows/build-publish.yml b/.github/workflows/build-publish.yml new file mode 100644 index 0000000..fa431ed --- /dev/null +++ b/.github/workflows/build-publish.yml @@ -0,0 +1,55 @@ +name: Ubuntu and Mac builds + +on: push + +jobs: + + build_and_publish: + strategy: + matrix: + os: + - ubuntu-latest + - macos-latest + + runs-on: ${{ matrix.os }} + if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')" + + steps: + - uses: actions/checkout@v2 + with: + submodules: recursive + + - name: Install pacakges + run: python3 -m pip install --upgrade --upgrade-strategy eager twine cibuildwheel + + #- name: Build and Test + # run: | + # python3 setup.py build_ext --inplace + # python3 -m unittest discover -v -s tests -p "test_*.py" + + - name: Build Wheels + run: | + python3 -m cibuildwheel --output-dir wheelhouse + python3 setup.py sdist + ls -lrt wheelhouse/* + + - uses: actions/upload-artifact@v2 + with: + name: pygeoda-${{ matrix.os }} + path: wheelhouse/ + + - name: Publish to Pypi + if: github.event_name == 'release' && github.event.action == 'created' + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + run: | + python3 -m twine upload wheelhouse/*.whl + + - name: Publish Source to Pypi + if: matrix.os == 'macos-latest' && github.event_name == 'release' && github.event.action == 'created' + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + run: | + python3 -m twine upload dist/*.tar.gz \ No newline at end of file diff --git a/.github/workflows/win-build-publish.yml b/.github/workflows/win-build-publish.yml new file mode 100644 index 0000000..16a8a30 --- /dev/null +++ b/.github/workflows/win-build-publish.yml @@ -0,0 +1,95 @@ +# This is a basic workflow to help you get started with Actions + +name: Windows builds + +# Controls when the action will run. +on: + # Triggers the workflow on push or pull request events but only for the master branch + push: + branches: [ master ] + pull_request: + branches: [ master ] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + windows_build: + runs-on: windows-latest + #if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')" + + strategy: + matrix: + msvc_arch: + - amd64 + - win32 + + python_ver: + - 3.6 + - 3.7 + - 3.8 + - 3.9 + + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + with: + submodules: recursive + + - name: Setup for Python 3.9 + if: "contains(matrix.python_ver, '3.9')" + uses: ilammy/msvc-dev-cmd@v1 + with: + arch: ${{ matrix.msvc_arch }} + toolset: 14.2 + + - name: Setup for Python 3.6, 3.7, 3.8 + if: "!contains(matrix.python_ver, '3.9')" + uses: ilammy/msvc-dev-cmd@v1 + with: + arch: ${{ matrix.msvc_arch }} + toolset: 14.1 + + - name: Setup Python Architecture x64 + if: "contains(matrix.msvc_arch, 'amd64')" + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python_ver }} + architecture: 'x64' + + - name: Setup Python Architecture x86 + if: "!contains(matrix.msvc_arch, 'amd64')" + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python_ver }} + architecture: 'x86' + + - name: Build and Test + shell: pwsh + run: | + python -m pip install --upgrade pip + python -m pip install --upgrade setuptools wheel virtualenv twine + python -m virtualenv venv + venv\\Scripts\\activate + python setup.py build_ext --inplace + python -m unittest + + - name: Build Wheels + shell: pwsh + run: | + venv\\Scripts\\activate + pip wheel -v -w wheelhouse --no-deps . + dir wheelhouse/* + + - uses: actions/upload-artifact@v2 + with: + name: pygeoda-${{ matrix.python_ver }}-${{ matrix.msvc_arch }}-win + path: wheelhouse/ + + - name: Publish to Pypi + if: github.event_name == 'release' && github.event.action == 'created' + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + run: | + python -m twine upload wheelhouse/*.whl diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index bea82ab..0000000 --- a/.travis.yml +++ /dev/null @@ -1,35 +0,0 @@ -language: python - -jobs: - include: - # perform a linux build - - services: docker - # and a mac build - - os: osx - # PyPy 7.3.2 needs macOS >= 10.14 - osx_image: xcode10.2 - language: shell - -env: - global: - - TWINE_USERNAME=__token__ - # Note: TWINE_PASSWORD is set to a PyPI API token in Travis settings - -install: - - python3 -m pip install --upgrade --upgrade-strategy eager twine cibuildwheel - -script: - # build the wheels, put them into './wheelhouse' - - python3 -m cibuildwheel --output-dir wheelhouse - #- python3 -m pip wheel -v -w wheelhouse --no-deps . - #- auditwheel repair wheelhouse/pygeoda*whl -w output/ - - python3 setup.py sdist - -after_success: - # if the release was tagged, upload them to PyPI - - | - if [[ $TRAVIS_TAG ]]; then - python3 -m pip install twine - python3 -m twine upload wheelhouse/*.whl - python3 -m twine upload dist/*.tar.gz - fi diff --git a/Development.md b/Development.md index fe0164b..9d8b950 100644 --- a/Development.md +++ b/Development.md @@ -7,14 +7,19 @@ Pygeoda for windows is built using Appveyor (see: appveyor.yml) NOTE: -python 3.5.0 msc 1900 visual c++ 2015 msvc14.0 -python 3.6.1 msc 1900 visual c++ 2015 (!!as conda-forge, msvc14.1 for py36) -python 3.7.0 msc 1914 visual c++ 2017 msvc14.1 -python 3.8.1 msc 1916 visual c++ 2017 -python 3.9.1 msc 1928 visual c++ 2019 msvc14.2 +python 3.5.0 msc 1900 visual c++ 2015 msvc14.0 (vs2015) +(NOTE: python3.5 will not be supported on PyPi after 0.0.8-1) + +python 3.6.1 msc 1900 visual c++ 2015 (!!as conda-forge, msvc14.1 for py36) (vs2017) +python 3.7.0 msc 1914 visual c++ 2017 msvc14.1 (vs2017) +python 3.8.1 msc 1916 visual c++ 2017 msvc14.1 (vs2017) +python 3.9.1 msc 1928 visual c++ 2019 msvc14.2 (vs2019) Pygeoda for Linux and Mac OSX is built using Travis (see .travis.yml) + +## conda-forge + For conda-forge, the pygeoda PyPI package is used as the source. So, when updating pygeoda PyPI package, the conda-forge package should be automatically updated. diff --git a/README.md b/README.md index 46b266b..99b25a7 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,9 @@ # pygeoda [![PyPI version](https://badge.fury.io/py/pygeoda.svg)](https://badge.fury.io/py/pygeoda) -[![Conda Version](https://img.shields.io/conda/vn/conda-forge/pygeoda.svg)](https://anaconda.org/conda-forge/pygeoda) +![PyPI - Downloads](https://img.shields.io/pypi/dm/pygeoda) +[![Anaconda-Server Badge](https://anaconda.org/conda-forge/pygeoda/badges/version.svg)](https://anaconda.org/conda-forge/pygeoda) +[![Anaconda-Server Badge](https://anaconda.org/conda-forge/pygeoda/badges/downloads.svg)](https://anaconda.org/conda-forge/pygeoda) pygeoda is a python library for spatial data analysis based on libgeoda and GeoDa. It provides spatial data analysis functionalities including Exploratory Spatial Data Analysis, Spatial Cluster Detection and Clustering Analysis, Regionalization, etc. based on the C++ source code of GeoDa, which is an open-source software tool that serves as an introduction to spatial data analysis. diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index f3e2f92..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,166 +0,0 @@ -image: - - Visual Studio 2019 - - Visual Studio 2017 - - Visual Studio 2015 - -# Start builds on tags only (GitHub and BitBucket) -skip_non_tags: false - -# Do not build feature branch with open Pull Requests -skip_branch_with_pr: true - -# Maximum number of concurrent jobs for the project -max_jobs: 1 - -environment: - global: - TWINE_USERNAME: "lixun910" - TWINE_PASSWORD: - secure: r1f70+i5UeM8tQYITBMMkQ== - - matrix: - - - PYTHON: "C:\\Python35" - PYTHON_VERSION: "3.5.x" - PYTHON_ARCH: "32" - - - PYTHON: "C:\\Python35-x64" - PYTHON_VERSION: "3.5.x" - PYTHON_ARCH: "64" - - - PYTHON: "C:\\Python36" - PYTHON_VERSION: "3.6.x" - PYTHON_ARCH: "32" - - - PYTHON: "C:\\Python36-x64" - PYTHON_VERSION: "3.6.x" - PYTHON_ARCH: "64" - - - PYTHON: "C:\\Python37" - PYTHON_VERSION: "3.7.x" - PYTHON_ARCH: "32" - - - PYTHON: "C:\\Python37-x64" - PYTHON_VERSION: "3.7.x" - PYTHON_ARCH: "64" - - - PYTHON: "C:\\Python38" - PYTHON_VERSION: "3.8.x" - PYTHON_ARCH: "32" - - - PYTHON: "C:\\Python38-x64" - PYTHON_VERSION: "3.8.x" - PYTHON_ARCH: "64" - - - PYTHON: "C:\\Python39" - PYTHON_VERSION: "3.9.x" - PYTHON_ARCH: "32" - - - PYTHON: "C:\\Python39-x64" - PYTHON_VERSION: "3.9.x" - PYTHON_ARCH: "64" - -matrix: - fast_finish: true - - exclude: - - image: Visual Studio 2019 - PYTHON: "C:\\Python35" - - image: Visual Studio 2019 - PYTHON: "C:\\Python35-x64" - - image: Visual Studio 2017 - PYTHON: "C:\\Python35" - - image: Visual Studio 2017 - PYTHON: "C:\\Python35-x64" - - image: Visual Studio 2019 - PYTHON: "C:\\Python36" - - image: Visual Studio 2019 - PYTHON: "C:\\Python36-x64" - - image: Visual Studio 2015 - PYTHON: "C:\\Python36" - - image: Visual Studio 2015 - PYTHON: "C:\\Python36-x64" - - image: Visual Studio 2019 - PYTHON: "C:\\Python37" - - image: Visual Studio 2019 - PYTHON: "C:\\Python37-x64" - - image: Visual Studio 2015 - PYTHON: "C:\\Python37" - - image: Visual Studio 2015 - PYTHON: "C:\\Python37-x64" - - image: Visual Studio 2019 - PYTHON: "C:\\Python38" - - image: Visual Studio 2019 - PYTHON: "C:\\Python38-x64" - - image: Visual Studio 2015 - PYTHON: "C:\\Python38" - - image: Visual Studio 2015 - PYTHON: "C:\\Python38-x64" - - image: Visual Studio 2017 - PYTHON: "C:\\Python39" - - image: Visual Studio 2017 - PYTHON: "C:\\Python39-x64" - - image: Visual Studio 2015 - PYTHON: "C:\\Python39" - - image: Visual Studio 2015 - PYTHON: "C:\\Python39-x64" - -install: - # note: VS 2010 has stdint.h bundled so simply copy it. Cython should not - # depend on it for py27 (works fine when compiling using C code) - # but this works differently for C++ (maybe there is some other issue - # with environment setup). - # try to do a dirty workaround for Cython with C++ for py27 - - ps: >- - if(Test-Path "c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdint.h") { - cp "c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdint.h" "C:\Users\appveyor\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\include\stdint.h" - } - - # Prepend Python to the PATH of this build - - "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%" - - # Check that we have the expected version and architecture for Python - - "python --version" - - "python -c \"import struct; print(struct.calcsize('P') * 8)\"" - - # Upgrade to the latest version of pip to avoid it displaying warnings - # about it being out of date. - - "python -m pip install --upgrade pip" - - # Upgrade setuptools, wheel and virtualenv - - "python -m pip install --upgrade setuptools wheel virtualenv" - - # Create new virtual environment and activate it - - "python -m virtualenv venv" - - "venv\\Scripts\\activate" - - "python -c \"import sys; print(sys.executable)\"" - -build_script: - - "echo $env:APPVEYOR_REPO_TAG" - # checkout submodules - - "git submodule update --init --recursive" - # build wheel - - "cd %APPVEYOR_BUILD_FOLDER%" - - "python setup.py build_ext --inplace" - - "pip wheel -v -w wheelhouse --no-deps ." - -test_script: - # install from wheel - - "pip install --no-index --find-links wheelhouse pygeoda" - # run tests against installed package - - "python -m unittest discover -v -s tests -p \"test_*.py\"" - -artifacts: - # Archive the generated wheel package in the ci.appveyor.com build report. - - path: wheelhouse\*.whl - -# deploy wheels to PyPI on tagged commits -deploy_script: - - ps: >- - if($env:APPVEYOR_REPO_TAG -eq 'true') { - Write-Output ("Deploying " + $env:APPVEYOR_REPO_TAG_NAME + " to PyPI...") - pip install --upgrade twine - twine upload wheelhouse/*.whl - } else { - Write-Output "Not deploying as this is not a tagged commit" - } \ No newline at end of file diff --git a/docs/spatial_auto.html b/docs/spatial_auto.html index f6f4d5a..f90f7ce 100644 --- a/docs/spatial_auto.html +++ b/docs/spatial_auto.html @@ -1,43 +1,40 @@ - + + - + - + 5 Local Indicators of Spatial Association–LISA — pygeoda 0.0.8 rc documentation - - - - - - - - + - - - + + + + + + + + @@ -78,7 +75,6 @@ - - @@ -273,20 +268,18 @@ - -
@@ -679,6 +672,7 @@

6.10 Neighbor Match Test + diff --git a/docs/spatial_clustering.html b/docs/spatial_clustering.html index e3e300b..3368a17 100644 --- a/docs/spatial_clustering.html +++ b/docs/spatial_clustering.html @@ -1,43 +1,40 @@ - + + - + - + 6 Spatial Clustering — pygeoda 0.0.8 rc documentation - - - - - - - - + - - - + + + + + + + + @@ -78,7 +75,6 @@ - - @@ -273,20 +268,18 @@ - -

7.3.1 AZP greedy

-
-
The original AZP heuristic is a local optimization procedure that cycles through

a series of possible swaps between spatial units at the boundary of a set +

The original AZP heuristic is a local optimization procedure that cycles +through a series of possible swaps between spatial units at the boundary of a set of regions. The process starts with an initial feasible solution, i.e., a grouping of n spatial units into p contiguous regions. This initial solution can be constructed in several different ways. The initial @@ -449,8 +442,6 @@

7.3.1 AZP greedy +

- © Copyright 2019, Xun Li; Luc Anselin.. + © Copyright 2019, Xun Li; Luc Anselin.

- - - - Built with Sphinx using a - - theme - - provided by Read the Docs. + Built with Sphinx using a theme provided by Read the Docs. +

@@ -664,6 +655,7 @@

7.4.3 Max-p Simulated Annealing jQuery(function () { SphinxRtdTheme.Navigation.enable(true); @@ -681,7 +673,6 @@

7.4.3 Max-p Simulated Annealing(argp1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (bool)(arg1)->CheckConnectivity(); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_bool(static_cast< bool >(result)); + return resultobj; +fail: + return NULL; +} + + SWIGINTERN PyObject *_wrap_GeoDaWeight_CheckNeighbor(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; GeoDaWeight *arg1 = (GeoDaWeight *) 0 ; @@ -43102,6 +43129,117 @@ SWIGINTERN PyObject *_wrap_GeoDaWeight_Save(PyObject *self, PyObject *args) { } +SWIGINTERN PyObject *_wrap_GeoDaWeight_SetNeighbors(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + GeoDaWeight *arg1 = (GeoDaWeight *) 0 ; + int arg2 ; + std::vector< int,std::allocator< int > > *arg3 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int res3 = SWIG_OLDOBJ ; + PyObject *swig_obj[3] ; + + if (!SWIG_Python_UnpackTuple(args, "GeoDaWeight_SetNeighbors", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_GeoDaWeight, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GeoDaWeight_SetNeighbors" "', argument " "1"" of type '" "GeoDaWeight *""'"); + } + arg1 = reinterpret_cast< GeoDaWeight * >(argp1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GeoDaWeight_SetNeighbors" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + { + std::vector< int,std::allocator< int > > *ptr = (std::vector< int,std::allocator< int > > *)0; + res3 = swig::asptr(swig_obj[2], &ptr); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "GeoDaWeight_SetNeighbors" "', argument " "3"" of type '" "std::vector< int,std::allocator< int > > const &""'"); + } + if (!ptr) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "GeoDaWeight_SetNeighbors" "', argument " "3"" of type '" "std::vector< int,std::allocator< int > > const &""'"); + } + arg3 = ptr; + } + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + (arg1)->SetNeighbors(arg2,(std::vector< int,std::allocator< int > > const &)*arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_Py_Void(); + if (SWIG_IsNewObj(res3)) delete arg3; + return resultobj; +fail: + if (SWIG_IsNewObj(res3)) delete arg3; + return NULL; +} + + +SWIGINTERN PyObject *_wrap_GeoDaWeight_SetNeighborsAndWeights(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + GeoDaWeight *arg1 = (GeoDaWeight *) 0 ; + int arg2 ; + std::vector< int,std::allocator< int > > *arg3 = 0 ; + std::vector< double,std::allocator< double > > *arg4 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int res3 = SWIG_OLDOBJ ; + int res4 = SWIG_OLDOBJ ; + PyObject *swig_obj[4] ; + + if (!SWIG_Python_UnpackTuple(args, "GeoDaWeight_SetNeighborsAndWeights", 4, 4, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_GeoDaWeight, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GeoDaWeight_SetNeighborsAndWeights" "', argument " "1"" of type '" "GeoDaWeight *""'"); + } + arg1 = reinterpret_cast< GeoDaWeight * >(argp1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GeoDaWeight_SetNeighborsAndWeights" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + { + std::vector< int,std::allocator< int > > *ptr = (std::vector< int,std::allocator< int > > *)0; + res3 = swig::asptr(swig_obj[2], &ptr); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "GeoDaWeight_SetNeighborsAndWeights" "', argument " "3"" of type '" "std::vector< int,std::allocator< int > > const &""'"); + } + if (!ptr) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "GeoDaWeight_SetNeighborsAndWeights" "', argument " "3"" of type '" "std::vector< int,std::allocator< int > > const &""'"); + } + arg3 = ptr; + } + { + std::vector< double,std::allocator< double > > *ptr = (std::vector< double,std::allocator< double > > *)0; + res4 = swig::asptr(swig_obj[3], &ptr); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "GeoDaWeight_SetNeighborsAndWeights" "', argument " "4"" of type '" "std::vector< double,std::allocator< double > > const &""'"); + } + if (!ptr) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "GeoDaWeight_SetNeighborsAndWeights" "', argument " "4"" of type '" "std::vector< double,std::allocator< double > > const &""'"); + } + arg4 = ptr; + } + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + (arg1)->SetNeighborsAndWeights(arg2,(std::vector< int,std::allocator< int > > const &)*arg3,(std::vector< double,std::allocator< double > > const &)*arg4); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_Py_Void(); + if (SWIG_IsNewObj(res3)) delete arg3; + if (SWIG_IsNewObj(res4)) delete arg4; + return resultobj; +fail: + if (SWIG_IsNewObj(res3)) delete arg3; + if (SWIG_IsNewObj(res4)) delete arg4; + return NULL; +} + + SWIGINTERN PyObject *_wrap_GeoDaWeight_IsSymmetric(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; GeoDaWeight *arg1 = (GeoDaWeight *) 0 ; @@ -43318,6 +43456,40 @@ SWIGINTERN PyObject *_wrap_GeoDaWeight_IsInternalUse(PyObject *SWIGUNUSEDPARM(se } +SWIGINTERN PyObject *_wrap_GeoDaWeight_IsMasked(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + GeoDaWeight *arg1 = (GeoDaWeight *) 0 ; + int arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; + bool result; + + if (!SWIG_Python_UnpackTuple(args, "GeoDaWeight_IsMasked", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_GeoDaWeight, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GeoDaWeight_IsMasked" "', argument " "1"" of type '" "GeoDaWeight *""'"); + } + arg1 = reinterpret_cast< GeoDaWeight * >(argp1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GeoDaWeight_IsMasked" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (bool)(arg1)->IsMasked(arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_bool(static_cast< bool >(result)); + return resultobj; +fail: + return NULL; +} + + SWIGINTERN PyObject *_wrap_GeoDaWeight_GetTitle(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; GeoDaWeight *arg1 = (GeoDaWeight *) 0 ; @@ -51330,7 +51502,7 @@ SWIGINTERN PyObject *_wrap_gda_bo(PyObject *SWIGUNUSEDPARM(self), PyObject *args } -SWIGINTERN PyObject *_wrap_gda_neighbor_match_test(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_gda_neighbor_match_test__SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; AbstractGeoDa *arg1 = (AbstractGeoDa *) 0 ; unsigned int arg2 ; @@ -51356,10 +51528,9 @@ SWIGINTERN PyObject *_wrap_gda_neighbor_match_test(PyObject *SWIGUNUSEDPARM(self int res7 = SWIG_OLDOBJ ; int res8 = SWIG_OLDOBJ ; int res9 = SWIG_OLDOBJ ; - PyObject *swig_obj[9] ; std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > result; - if (!SWIG_Python_UnpackTuple(args, "gda_neighbor_match_test", 9, 9, swig_obj)) SWIG_fail; + if ((nobjs < 9) || (nobjs > 9)) SWIG_fail; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_AbstractGeoDa, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gda_neighbor_match_test" "', argument " "1"" of type '" "AbstractGeoDa *""'"); @@ -51441,96 +51612,270 @@ SWIGINTERN PyObject *_wrap_gda_neighbor_match_test(PyObject *SWIGUNUSEDPARM(self } -SWIGINTERN PyObject *_wrap_gda_demean(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_gda_neighbor_match_test__SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; - std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *arg1 = 0 ; - int res1 = SWIG_OLDOBJ ; - PyObject *swig_obj[1] ; + GeoDaWeight *arg1 = (GeoDaWeight *) 0 ; + unsigned int arg2 ; + std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *arg3 = 0 ; + std::string *arg4 = 0 ; + std::string *arg5 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + unsigned int val2 ; + int ecode2 = 0 ; + int res3 = SWIG_OLDOBJ ; + int res4 = SWIG_OLDOBJ ; + int res5 = SWIG_OLDOBJ ; std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > result; - if (!args) SWIG_fail; - swig_obj[0] = args; + if ((nobjs < 5) || (nobjs > 5)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_GeoDaWeight, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gda_neighbor_match_test" "', argument " "1"" of type '" "GeoDaWeight *""'"); + } + arg1 = reinterpret_cast< GeoDaWeight * >(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "gda_neighbor_match_test" "', argument " "2"" of type '" "unsigned int""'"); + } + arg2 = static_cast< unsigned int >(val2); { std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *ptr = (std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *)0; - res1 = swig::asptr(swig_obj[0], &ptr); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gda_demean" "', argument " "1"" of type '" "std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > const &""'"); + res3 = swig::asptr(swig_obj[2], &ptr); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "gda_neighbor_match_test" "', argument " "3"" of type '" "std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > const &""'"); } if (!ptr) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "gda_demean" "', argument " "1"" of type '" "std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > const &""'"); + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "gda_neighbor_match_test" "', argument " "3"" of type '" "std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > const &""'"); } - arg1 = ptr; + arg3 = ptr; } { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = gda_demean((std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > const &)*arg1); - SWIG_PYTHON_THREAD_END_ALLOW; + std::string *ptr = (std::string *)0; + res4 = SWIG_AsPtr_std_string(swig_obj[3], &ptr); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "gda_neighbor_match_test" "', argument " "4"" of type '" "std::string const &""'"); + } + if (!ptr) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "gda_neighbor_match_test" "', argument " "4"" of type '" "std::string const &""'"); + } + arg4 = ptr; } - resultobj = swig::from(static_cast< std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > >(result)); - if (SWIG_IsNewObj(res1)) delete arg1; - return resultobj; -fail: - if (SWIG_IsNewObj(res1)) delete arg1; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_gda_standardize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *arg1 = 0 ; - int res1 = SWIG_OLDOBJ ; - PyObject *swig_obj[1] ; - std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > result; - - if (!args) SWIG_fail; - swig_obj[0] = args; { - std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *ptr = (std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *)0; - res1 = swig::asptr(swig_obj[0], &ptr); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gda_standardize" "', argument " "1"" of type '" "std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > const &""'"); + std::string *ptr = (std::string *)0; + res5 = SWIG_AsPtr_std_string(swig_obj[4], &ptr); + if (!SWIG_IsOK(res5)) { + SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "gda_neighbor_match_test" "', argument " "5"" of type '" "std::string const &""'"); } if (!ptr) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "gda_standardize" "', argument " "1"" of type '" "std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > const &""'"); + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "gda_neighbor_match_test" "', argument " "5"" of type '" "std::string const &""'"); } - arg1 = ptr; + arg5 = ptr; } { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = gda_standardize((std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > const &)*arg1); + result = gda_neighbor_match_test(arg1,arg2,(std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > const &)*arg3,(std::string const &)*arg4,(std::string const &)*arg5); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = swig::from(static_cast< std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > >(result)); - if (SWIG_IsNewObj(res1)) delete arg1; + if (SWIG_IsNewObj(res3)) delete arg3; + if (SWIG_IsNewObj(res4)) delete arg4; + if (SWIG_IsNewObj(res5)) delete arg5; return resultobj; fail: - if (SWIG_IsNewObj(res1)) delete arg1; + if (SWIG_IsNewObj(res3)) delete arg3; + if (SWIG_IsNewObj(res4)) delete arg4; + if (SWIG_IsNewObj(res5)) delete arg5; return NULL; } -SWIGINTERN PyObject *_wrap_gda_standardize_mad(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *arg1 = 0 ; - int res1 = SWIG_OLDOBJ ; - PyObject *swig_obj[1] ; - std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > result; +SWIGINTERN PyObject *_wrap_gda_neighbor_match_test(PyObject *self, PyObject *args) { + Py_ssize_t argc; + PyObject *argv[10] = { + 0 + }; - if (!args) SWIG_fail; - swig_obj[0] = args; - { - std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *ptr = (std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *)0; - res1 = swig::asptr(swig_obj[0], &ptr); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gda_standardize_mad" "', argument " "1"" of type '" "std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > const &""'"); - } - if (!ptr) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "gda_standardize_mad" "', argument " "1"" of type '" "std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > const &""'"); - } - arg1 = ptr; - } - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; + if (!(argc = SWIG_Python_UnpackTuple(args, "gda_neighbor_match_test", 0, 9, argv))) SWIG_fail; + --argc; + if (argc == 5) { + int _v; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_GeoDaWeight, 0); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_unsigned_SS_int(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + int res = swig::asptr(argv[2], (std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + int res = SWIG_AsPtr_std_string(argv[3], (std::string**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + int res = SWIG_AsPtr_std_string(argv[4], (std::string**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_gda_neighbor_match_test__SWIG_1(self, argc, argv); + } + } + } + } + } + } + if (argc == 9) { + int _v; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_AbstractGeoDa, 0); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_unsigned_SS_int(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_double(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_bool(argv[3], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_bool(argv[4], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_bool(argv[5], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + int res = swig::asptr(argv[6], (std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + int res = SWIG_AsPtr_std_string(argv[7], (std::string**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + int res = SWIG_AsPtr_std_string(argv[8], (std::string**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_gda_neighbor_match_test__SWIG_0(self, argc, argv); + } + } + } + } + } + } + } + } + } + } + +fail: + SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'gda_neighbor_match_test'.\n" + " Possible C/C++ prototypes are:\n" + " gda_neighbor_match_test(AbstractGeoDa *,unsigned int,double,bool,bool,bool,std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > const &,std::string const &,std::string const &)\n" + " gda_neighbor_match_test(GeoDaWeight *,unsigned int,std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > const &,std::string const &,std::string const &)\n"); + return 0; +} + + +SWIGINTERN PyObject *_wrap_gda_demean(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *arg1 = 0 ; + int res1 = SWIG_OLDOBJ ; + PyObject *swig_obj[1] ; + std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > result; + + if (!args) SWIG_fail; + swig_obj[0] = args; + { + std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *ptr = (std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *)0; + res1 = swig::asptr(swig_obj[0], &ptr); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gda_demean" "', argument " "1"" of type '" "std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > const &""'"); + } + if (!ptr) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "gda_demean" "', argument " "1"" of type '" "std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > const &""'"); + } + arg1 = ptr; + } + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = gda_demean((std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > const &)*arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = swig::from(static_cast< std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > >(result)); + if (SWIG_IsNewObj(res1)) delete arg1; + return resultobj; +fail: + if (SWIG_IsNewObj(res1)) delete arg1; + return NULL; +} + + +SWIGINTERN PyObject *_wrap_gda_standardize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *arg1 = 0 ; + int res1 = SWIG_OLDOBJ ; + PyObject *swig_obj[1] ; + std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > result; + + if (!args) SWIG_fail; + swig_obj[0] = args; + { + std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *ptr = (std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *)0; + res1 = swig::asptr(swig_obj[0], &ptr); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gda_standardize" "', argument " "1"" of type '" "std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > const &""'"); + } + if (!ptr) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "gda_standardize" "', argument " "1"" of type '" "std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > const &""'"); + } + arg1 = ptr; + } + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = gda_standardize((std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > const &)*arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = swig::from(static_cast< std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > >(result)); + if (SWIG_IsNewObj(res1)) delete arg1; + return resultobj; +fail: + if (SWIG_IsNewObj(res1)) delete arg1; + return NULL; +} + + +SWIGINTERN PyObject *_wrap_gda_standardize_mad(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *arg1 = 0 ; + int res1 = SWIG_OLDOBJ ; + PyObject *swig_obj[1] ; + std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > result; + + if (!args) SWIG_fail; + swig_obj[0] = args; + { + std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *ptr = (std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *)0; + res1 = swig::asptr(swig_obj[0], &ptr); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gda_standardize_mad" "', argument " "1"" of type '" "std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > const &""'"); + } + if (!ptr) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "gda_standardize_mad" "', argument " "1"" of type '" "std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > const &""'"); + } + arg1 = ptr; + } + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; result = gda_standardize_mad((std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > const &)*arg1); SWIG_PYTHON_THREAD_END_ALLOW; } @@ -52180,56 +52525,192 @@ SWIGINTERN PyObject *_wrap_gda_knn_weights(PyObject *SWIGUNUSEDPARM(self), PyObj } -SWIGINTERN PyObject *_wrap_gda_min_distthreshold(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_gda_knn_weights_sub(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; AbstractGeoDa *arg1 = (AbstractGeoDa *) 0 ; - bool arg2 ; - bool arg3 ; + unsigned int arg2 ; + int arg3 ; + int arg4 ; + double arg5 ; + bool arg6 ; + bool arg7 ; + bool arg8 ; + std::string *arg9 = 0 ; + double arg10 ; + bool arg11 ; + bool arg12 ; + std::string *arg13 = 0 ; void *argp1 = 0 ; int res1 = 0 ; - bool val2 ; + unsigned int val2 ; int ecode2 = 0 ; - bool val3 ; + int val3 ; int ecode3 = 0 ; - PyObject *swig_obj[3] ; - double result; + int val4 ; + int ecode4 = 0 ; + double val5 ; + int ecode5 = 0 ; + bool val6 ; + int ecode6 = 0 ; + bool val7 ; + int ecode7 = 0 ; + bool val8 ; + int ecode8 = 0 ; + int res9 = SWIG_OLDOBJ ; + double val10 ; + int ecode10 = 0 ; + bool val11 ; + int ecode11 = 0 ; + bool val12 ; + int ecode12 = 0 ; + int res13 = SWIG_OLDOBJ ; + PyObject *swig_obj[13] ; + GeoDaWeight *result = 0 ; - if (!SWIG_Python_UnpackTuple(args, "gda_min_distthreshold", 3, 3, swig_obj)) SWIG_fail; + if (!SWIG_Python_UnpackTuple(args, "gda_knn_weights_sub", 13, 13, swig_obj)) SWIG_fail; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_AbstractGeoDa, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gda_min_distthreshold" "', argument " "1"" of type '" "AbstractGeoDa *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gda_knn_weights_sub" "', argument " "1"" of type '" "AbstractGeoDa *""'"); } arg1 = reinterpret_cast< AbstractGeoDa * >(argp1); - ecode2 = SWIG_AsVal_bool(swig_obj[1], &val2); + ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "gda_min_distthreshold" "', argument " "2"" of type '" "bool""'"); + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "gda_knn_weights_sub" "', argument " "2"" of type '" "unsigned int""'"); } - arg2 = static_cast< bool >(val2); - ecode3 = SWIG_AsVal_bool(swig_obj[2], &val3); + arg2 = static_cast< unsigned int >(val2); + ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "gda_min_distthreshold" "', argument " "3"" of type '" "bool""'"); + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "gda_knn_weights_sub" "', argument " "3"" of type '" "int""'"); } - arg3 = static_cast< bool >(val3); + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_int(swig_obj[3], &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "gda_knn_weights_sub" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + ecode5 = SWIG_AsVal_double(swig_obj[4], &val5); + if (!SWIG_IsOK(ecode5)) { + SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "gda_knn_weights_sub" "', argument " "5"" of type '" "double""'"); + } + arg5 = static_cast< double >(val5); + ecode6 = SWIG_AsVal_bool(swig_obj[5], &val6); + if (!SWIG_IsOK(ecode6)) { + SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "gda_knn_weights_sub" "', argument " "6"" of type '" "bool""'"); + } + arg6 = static_cast< bool >(val6); + ecode7 = SWIG_AsVal_bool(swig_obj[6], &val7); + if (!SWIG_IsOK(ecode7)) { + SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "gda_knn_weights_sub" "', argument " "7"" of type '" "bool""'"); + } + arg7 = static_cast< bool >(val7); + ecode8 = SWIG_AsVal_bool(swig_obj[7], &val8); + if (!SWIG_IsOK(ecode8)) { + SWIG_exception_fail(SWIG_ArgError(ecode8), "in method '" "gda_knn_weights_sub" "', argument " "8"" of type '" "bool""'"); + } + arg8 = static_cast< bool >(val8); + { + std::string *ptr = (std::string *)0; + res9 = SWIG_AsPtr_std_string(swig_obj[8], &ptr); + if (!SWIG_IsOK(res9)) { + SWIG_exception_fail(SWIG_ArgError(res9), "in method '" "gda_knn_weights_sub" "', argument " "9"" of type '" "std::string const &""'"); + } + if (!ptr) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "gda_knn_weights_sub" "', argument " "9"" of type '" "std::string const &""'"); + } + arg9 = ptr; + } + ecode10 = SWIG_AsVal_double(swig_obj[9], &val10); + if (!SWIG_IsOK(ecode10)) { + SWIG_exception_fail(SWIG_ArgError(ecode10), "in method '" "gda_knn_weights_sub" "', argument " "10"" of type '" "double""'"); + } + arg10 = static_cast< double >(val10); + ecode11 = SWIG_AsVal_bool(swig_obj[10], &val11); + if (!SWIG_IsOK(ecode11)) { + SWIG_exception_fail(SWIG_ArgError(ecode11), "in method '" "gda_knn_weights_sub" "', argument " "11"" of type '" "bool""'"); + } + arg11 = static_cast< bool >(val11); + ecode12 = SWIG_AsVal_bool(swig_obj[11], &val12); + if (!SWIG_IsOK(ecode12)) { + SWIG_exception_fail(SWIG_ArgError(ecode12), "in method '" "gda_knn_weights_sub" "', argument " "12"" of type '" "bool""'"); + } + arg12 = static_cast< bool >(val12); + { + std::string *ptr = (std::string *)0; + res13 = SWIG_AsPtr_std_string(swig_obj[12], &ptr); + if (!SWIG_IsOK(res13)) { + SWIG_exception_fail(SWIG_ArgError(res13), "in method '" "gda_knn_weights_sub" "', argument " "13"" of type '" "std::string const &""'"); + } + if (!ptr) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "gda_knn_weights_sub" "', argument " "13"" of type '" "std::string const &""'"); + } + arg13 = ptr; + } { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (double)gda_min_distthreshold(arg1,arg2,arg3); + result = (GeoDaWeight *)gda_knn_weights_sub(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,(std::string const &)*arg9,arg10,arg11,arg12,(std::string const &)*arg13); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = SWIG_From_double(static_cast< double >(result)); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeoDaWeight, 0 | 0 ); + if (SWIG_IsNewObj(res9)) delete arg9; + if (SWIG_IsNewObj(res13)) delete arg13; return resultobj; fail: + if (SWIG_IsNewObj(res9)) delete arg9; + if (SWIG_IsNewObj(res13)) delete arg13; return NULL; } -SWIGINTERN PyObject *_wrap_gda_distance_weights(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_gda_min_distthreshold(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; AbstractGeoDa *arg1 = (AbstractGeoDa *) 0 ; - double arg2 ; - std::string *arg3 = 0 ; - double arg4 ; - bool arg5 ; - bool arg6 ; + bool arg2 ; + bool arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + bool val2 ; + int ecode2 = 0 ; + bool val3 ; + int ecode3 = 0 ; + PyObject *swig_obj[3] ; + double result; + + if (!SWIG_Python_UnpackTuple(args, "gda_min_distthreshold", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_AbstractGeoDa, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gda_min_distthreshold" "', argument " "1"" of type '" "AbstractGeoDa *""'"); + } + arg1 = reinterpret_cast< AbstractGeoDa * >(argp1); + ecode2 = SWIG_AsVal_bool(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "gda_min_distthreshold" "', argument " "2"" of type '" "bool""'"); + } + arg2 = static_cast< bool >(val2); + ecode3 = SWIG_AsVal_bool(swig_obj[2], &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "gda_min_distthreshold" "', argument " "3"" of type '" "bool""'"); + } + arg3 = static_cast< bool >(val3); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (double)gda_min_distthreshold(arg1,arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_double(static_cast< double >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_gda_distance_weights(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + AbstractGeoDa *arg1 = (AbstractGeoDa *) 0 ; + double arg2 ; + std::string *arg3 = 0 ; + double arg4 ; + bool arg5 ; + bool arg6 ; bool arg7 ; std::string *arg8 = 0 ; bool arg9 ; @@ -52326,190 +52807,345 @@ SWIGINTERN PyObject *_wrap_gda_distance_weights(PyObject *SWIGUNUSEDPARM(self), } -SWIGINTERN PyObject *_wrap_gda_load_weights(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_gda_load_gal__SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; char *arg1 = (char *) 0 ; + std::vector< std::string,std::allocator< std::string > > *arg2 = 0 ; int res1 ; char *buf1 = 0 ; int alloc1 = 0 ; - PyObject *swig_obj[1] ; + int res2 = SWIG_OLDOBJ ; GeoDaWeight *result = 0 ; - if (!args) SWIG_fail; - swig_obj[0] = args; + if ((nobjs < 2) || (nobjs > 2)) SWIG_fail; res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gda_load_weights" "', argument " "1"" of type '" "char const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gda_load_gal" "', argument " "1"" of type '" "char const *""'"); } arg1 = reinterpret_cast< char * >(buf1); + { + std::vector< std::string,std::allocator< std::string > > *ptr = (std::vector< std::string,std::allocator< std::string > > *)0; + res2 = swig::asptr(swig_obj[1], &ptr); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "gda_load_gal" "', argument " "2"" of type '" "std::vector< std::string,std::allocator< std::string > > const &""'"); + } + if (!ptr) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "gda_load_gal" "', argument " "2"" of type '" "std::vector< std::string,std::allocator< std::string > > const &""'"); + } + arg2 = ptr; + } { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (GeoDaWeight *)gda_load_weights((char const *)arg1); + result = (GeoDaWeight *)gda_load_gal((char const *)arg1,(std::vector< std::string,std::allocator< std::string > > const &)*arg2); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeoDaWeight, 0 | 0 ); if (alloc1 == SWIG_NEWOBJ) delete[] buf1; + if (SWIG_IsNewObj(res2)) delete arg2; return resultobj; fail: if (alloc1 == SWIG_NEWOBJ) delete[] buf1; + if (SWIG_IsNewObj(res2)) delete arg2; return NULL; } -SWIGINTERN PyObject *_wrap_gda_azp_greedy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_gda_load_gal__SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; - int arg1 ; - GeoDaWeight *arg2 = (GeoDaWeight *) 0 ; - std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *arg3 = 0 ; - std::string *arg4 = 0 ; - int arg5 ; - std::vector< std::pair< double,std::vector< double,std::allocator< double > > >,std::allocator< std::pair< double,std::vector< double,std::allocator< double > > > > > *arg6 = 0 ; - std::vector< std::pair< double,std::vector< double,std::allocator< double > > >,std::allocator< std::pair< double,std::vector< double,std::allocator< double > > > > > *arg7 = 0 ; - std::vector< int,std::allocator< int > > *arg8 = 0 ; - std::string *arg9 = 0 ; - int arg10 ; - int val1 ; - int ecode1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int res3 = SWIG_OLDOBJ ; - int res4 = SWIG_OLDOBJ ; - int val5 ; - int ecode5 = 0 ; - int res6 = SWIG_OLDOBJ ; - int res7 = SWIG_OLDOBJ ; - int res8 = SWIG_OLDOBJ ; - int res9 = SWIG_OLDOBJ ; - int val10 ; - int ecode10 = 0 ; - PyObject *swig_obj[10] ; - std::vector< std::vector< int,std::allocator< int > >,std::allocator< std::vector< int,std::allocator< int > > > > result; + char *arg1 = (char *) 0 ; + int res1 ; + char *buf1 = 0 ; + int alloc1 = 0 ; + GeoDaWeight *result = 0 ; - if (!SWIG_Python_UnpackTuple(args, "gda_azp_greedy", 10, 10, swig_obj)) SWIG_fail; - ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gda_azp_greedy" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_GeoDaWeight, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "gda_azp_greedy" "', argument " "2"" of type '" "GeoDaWeight *""'"); - } - arg2 = reinterpret_cast< GeoDaWeight * >(argp2); - { - std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *ptr = (std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *)0; - res3 = swig::asptr(swig_obj[2], &ptr); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "gda_azp_greedy" "', argument " "3"" of type '" "std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > const &""'"); - } - if (!ptr) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "gda_azp_greedy" "', argument " "3"" of type '" "std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > const &""'"); - } - arg3 = ptr; + if ((nobjs < 1) || (nobjs > 1)) SWIG_fail; + res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gda_load_gal" "', argument " "1"" of type '" "char const *""'"); } + arg1 = reinterpret_cast< char * >(buf1); { - std::string *ptr = (std::string *)0; - res4 = SWIG_AsPtr_std_string(swig_obj[3], &ptr); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "gda_azp_greedy" "', argument " "4"" of type '" "std::string const &""'"); - } - if (!ptr) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "gda_azp_greedy" "', argument " "4"" of type '" "std::string const &""'"); - } - arg4 = ptr; + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (GeoDaWeight *)gda_load_gal((char const *)arg1); + SWIG_PYTHON_THREAD_END_ALLOW; } - ecode5 = SWIG_AsVal_int(swig_obj[4], &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "gda_azp_greedy" "', argument " "5"" of type '" "int""'"); - } - arg5 = static_cast< int >(val5); - { - std::vector< std::pair< double,std::vector< double,std::allocator< double > > >,std::allocator< std::pair< double,std::vector< double,std::allocator< double > > > > > *ptr = (std::vector< std::pair< double,std::vector< double,std::allocator< double > > >,std::allocator< std::pair< double,std::vector< double,std::allocator< double > > > > > *)0; - res6 = swig::asptr(swig_obj[5], &ptr); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "gda_azp_greedy" "', argument " "6"" of type '" "std::vector< std::pair< double,std::vector< double,std::allocator< double > > >,std::allocator< std::pair< double,std::vector< double,std::allocator< double > > > > > const &""'"); - } - if (!ptr) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "gda_azp_greedy" "', argument " "6"" of type '" "std::vector< std::pair< double,std::vector< double,std::allocator< double > > >,std::allocator< std::pair< double,std::vector< double,std::allocator< double > > > > > const &""'"); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeoDaWeight, 0 | 0 ); + if (alloc1 == SWIG_NEWOBJ) delete[] buf1; + return resultobj; +fail: + if (alloc1 == SWIG_NEWOBJ) delete[] buf1; + return NULL; +} + + +SWIGINTERN PyObject *_wrap_gda_load_gal(PyObject *self, PyObject *args) { + Py_ssize_t argc; + PyObject *argv[3] = { + 0 + }; + + if (!(argc = SWIG_Python_UnpackTuple(args, "gda_load_gal", 0, 2, argv))) SWIG_fail; + --argc; + if (argc == 1) { + int _v; + int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_gda_load_gal__SWIG_1(self, argc, argv); } - arg6 = ptr; } - { - std::vector< std::pair< double,std::vector< double,std::allocator< double > > >,std::allocator< std::pair< double,std::vector< double,std::allocator< double > > > > > *ptr = (std::vector< std::pair< double,std::vector< double,std::allocator< double > > >,std::allocator< std::pair< double,std::vector< double,std::allocator< double > > > > > *)0; - res7 = swig::asptr(swig_obj[6], &ptr); - if (!SWIG_IsOK(res7)) { - SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "gda_azp_greedy" "', argument " "7"" of type '" "std::vector< std::pair< double,std::vector< double,std::allocator< double > > >,std::allocator< std::pair< double,std::vector< double,std::allocator< double > > > > > const &""'"); - } - if (!ptr) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "gda_azp_greedy" "', argument " "7"" of type '" "std::vector< std::pair< double,std::vector< double,std::allocator< double > > >,std::allocator< std::pair< double,std::vector< double,std::allocator< double > > > > > const &""'"); + if (argc == 2) { + int _v; + int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0); + _v = SWIG_CheckState(res); + if (_v) { + int res = swig::asptr(argv[1], (std::vector< std::string,std::allocator< std::string > >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_gda_load_gal__SWIG_0(self, argc, argv); + } } - arg7 = ptr; } - { - std::vector< int,std::allocator< int > > *ptr = (std::vector< int,std::allocator< int > > *)0; - res8 = swig::asptr(swig_obj[7], &ptr); - if (!SWIG_IsOK(res8)) { - SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "gda_azp_greedy" "', argument " "8"" of type '" "std::vector< int,std::allocator< int > > const &""'"); - } - if (!ptr) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "gda_azp_greedy" "', argument " "8"" of type '" "std::vector< int,std::allocator< int > > const &""'"); - } - arg8 = ptr; + +fail: + SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'gda_load_gal'.\n" + " Possible C/C++ prototypes are:\n" + " gda_load_gal(char const *,std::vector< std::string,std::allocator< std::string > > const &)\n" + " gda_load_gal(char const *)\n"); + return 0; +} + + +SWIGINTERN PyObject *_wrap_gda_load_gwt__SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { + PyObject *resultobj = 0; + char *arg1 = (char *) 0 ; + std::vector< std::string,std::allocator< std::string > > *arg2 = 0 ; + int res1 ; + char *buf1 = 0 ; + int alloc1 = 0 ; + int res2 = SWIG_OLDOBJ ; + GeoDaWeight *result = 0 ; + + if ((nobjs < 2) || (nobjs > 2)) SWIG_fail; + res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gda_load_gwt" "', argument " "1"" of type '" "char const *""'"); } + arg1 = reinterpret_cast< char * >(buf1); { - std::string *ptr = (std::string *)0; - res9 = SWIG_AsPtr_std_string(swig_obj[8], &ptr); - if (!SWIG_IsOK(res9)) { - SWIG_exception_fail(SWIG_ArgError(res9), "in method '" "gda_azp_greedy" "', argument " "9"" of type '" "std::string const &""'"); + std::vector< std::string,std::allocator< std::string > > *ptr = (std::vector< std::string,std::allocator< std::string > > *)0; + res2 = swig::asptr(swig_obj[1], &ptr); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "gda_load_gwt" "', argument " "2"" of type '" "std::vector< std::string,std::allocator< std::string > > const &""'"); } if (!ptr) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "gda_azp_greedy" "', argument " "9"" of type '" "std::string const &""'"); + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "gda_load_gwt" "', argument " "2"" of type '" "std::vector< std::string,std::allocator< std::string > > const &""'"); } - arg9 = ptr; + arg2 = ptr; } - ecode10 = SWIG_AsVal_int(swig_obj[9], &val10); - if (!SWIG_IsOK(ecode10)) { - SWIG_exception_fail(SWIG_ArgError(ecode10), "in method '" "gda_azp_greedy" "', argument " "10"" of type '" "int""'"); - } - arg10 = static_cast< int >(val10); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = gda_azp_greedy(arg1,arg2,(std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > const &)*arg3,(std::string const &)*arg4,arg5,(std::vector< std::pair< double,std::vector< double,std::allocator< double > > >,std::allocator< std::pair< double,std::vector< double,std::allocator< double > > > > > const &)*arg6,(std::vector< std::pair< double,std::vector< double,std::allocator< double > > >,std::allocator< std::pair< double,std::vector< double,std::allocator< double > > > > > const &)*arg7,(std::vector< int,std::allocator< int > > const &)*arg8,(std::string const &)*arg9,arg10); + result = (GeoDaWeight *)gda_load_gwt((char const *)arg1,(std::vector< std::string,std::allocator< std::string > > const &)*arg2); SWIG_PYTHON_THREAD_END_ALLOW; } - resultobj = swig::from(static_cast< std::vector< std::vector< int,std::allocator< int > >,std::allocator< std::vector< int,std::allocator< int > > > > >(result)); - if (SWIG_IsNewObj(res3)) delete arg3; - if (SWIG_IsNewObj(res4)) delete arg4; - if (SWIG_IsNewObj(res6)) delete arg6; - if (SWIG_IsNewObj(res7)) delete arg7; - if (SWIG_IsNewObj(res8)) delete arg8; - if (SWIG_IsNewObj(res9)) delete arg9; + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeoDaWeight, 0 | 0 ); + if (alloc1 == SWIG_NEWOBJ) delete[] buf1; + if (SWIG_IsNewObj(res2)) delete arg2; return resultobj; fail: - if (SWIG_IsNewObj(res3)) delete arg3; - if (SWIG_IsNewObj(res4)) delete arg4; - if (SWIG_IsNewObj(res6)) delete arg6; - if (SWIG_IsNewObj(res7)) delete arg7; - if (SWIG_IsNewObj(res8)) delete arg8; - if (SWIG_IsNewObj(res9)) delete arg9; + if (alloc1 == SWIG_NEWOBJ) delete[] buf1; + if (SWIG_IsNewObj(res2)) delete arg2; return NULL; } -SWIGINTERN PyObject *_wrap_gda_azp_sa(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_gda_load_gwt__SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; - int arg1 ; - GeoDaWeight *arg2 = (GeoDaWeight *) 0 ; - std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *arg3 = 0 ; - std::string *arg4 = 0 ; - int arg5 ; - double arg6 ; - int arg7 ; - std::vector< std::pair< double,std::vector< double,std::allocator< double > > >,std::allocator< std::pair< double,std::vector< double,std::allocator< double > > > > > *arg8 = 0 ; - std::vector< std::pair< double,std::vector< double,std::allocator< double > > >,std::allocator< std::pair< double,std::vector< double,std::allocator< double > > > > > *arg9 = 0 ; - std::vector< int,std::allocator< int > > *arg10 = 0 ; - std::string *arg11 = 0 ; - int arg12 ; + char *arg1 = (char *) 0 ; + int res1 ; + char *buf1 = 0 ; + int alloc1 = 0 ; + GeoDaWeight *result = 0 ; + + if ((nobjs < 1) || (nobjs > 1)) SWIG_fail; + res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gda_load_gwt" "', argument " "1"" of type '" "char const *""'"); + } + arg1 = reinterpret_cast< char * >(buf1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (GeoDaWeight *)gda_load_gwt((char const *)arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeoDaWeight, 0 | 0 ); + if (alloc1 == SWIG_NEWOBJ) delete[] buf1; + return resultobj; +fail: + if (alloc1 == SWIG_NEWOBJ) delete[] buf1; + return NULL; +} + + +SWIGINTERN PyObject *_wrap_gda_load_gwt(PyObject *self, PyObject *args) { + Py_ssize_t argc; + PyObject *argv[3] = { + 0 + }; + + if (!(argc = SWIG_Python_UnpackTuple(args, "gda_load_gwt", 0, 2, argv))) SWIG_fail; + --argc; + if (argc == 1) { + int _v; + int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_gda_load_gwt__SWIG_1(self, argc, argv); + } + } + if (argc == 2) { + int _v; + int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0); + _v = SWIG_CheckState(res); + if (_v) { + int res = swig::asptr(argv[1], (std::vector< std::string,std::allocator< std::string > >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_gda_load_gwt__SWIG_0(self, argc, argv); + } + } + } + +fail: + SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'gda_load_gwt'.\n" + " Possible C/C++ prototypes are:\n" + " gda_load_gwt(char const *,std::vector< std::string,std::allocator< std::string > > const &)\n" + " gda_load_gwt(char const *)\n"); + return 0; +} + + +SWIGINTERN PyObject *_wrap_gda_load_swm__SWIG_0(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { + PyObject *resultobj = 0; + char *arg1 = (char *) 0 ; + std::vector< int,std::allocator< int > > *arg2 = 0 ; + int res1 ; + char *buf1 = 0 ; + int alloc1 = 0 ; + int res2 = SWIG_OLDOBJ ; + GeoDaWeight *result = 0 ; + + if ((nobjs < 2) || (nobjs > 2)) SWIG_fail; + res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gda_load_swm" "', argument " "1"" of type '" "char const *""'"); + } + arg1 = reinterpret_cast< char * >(buf1); + { + std::vector< int,std::allocator< int > > *ptr = (std::vector< int,std::allocator< int > > *)0; + res2 = swig::asptr(swig_obj[1], &ptr); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "gda_load_swm" "', argument " "2"" of type '" "std::vector< int,std::allocator< int > > const &""'"); + } + if (!ptr) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "gda_load_swm" "', argument " "2"" of type '" "std::vector< int,std::allocator< int > > const &""'"); + } + arg2 = ptr; + } + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (GeoDaWeight *)gda_load_swm((char const *)arg1,(std::vector< int,std::allocator< int > > const &)*arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeoDaWeight, 0 | 0 ); + if (alloc1 == SWIG_NEWOBJ) delete[] buf1; + if (SWIG_IsNewObj(res2)) delete arg2; + return resultobj; +fail: + if (alloc1 == SWIG_NEWOBJ) delete[] buf1; + if (SWIG_IsNewObj(res2)) delete arg2; + return NULL; +} + + +SWIGINTERN PyObject *_wrap_gda_load_swm__SWIG_1(PyObject *SWIGUNUSEDPARM(self), Py_ssize_t nobjs, PyObject **swig_obj) { + PyObject *resultobj = 0; + char *arg1 = (char *) 0 ; + int res1 ; + char *buf1 = 0 ; + int alloc1 = 0 ; + GeoDaWeight *result = 0 ; + + if ((nobjs < 1) || (nobjs > 1)) SWIG_fail; + res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gda_load_swm" "', argument " "1"" of type '" "char const *""'"); + } + arg1 = reinterpret_cast< char * >(buf1); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (GeoDaWeight *)gda_load_swm((char const *)arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeoDaWeight, 0 | 0 ); + if (alloc1 == SWIG_NEWOBJ) delete[] buf1; + return resultobj; +fail: + if (alloc1 == SWIG_NEWOBJ) delete[] buf1; + return NULL; +} + + +SWIGINTERN PyObject *_wrap_gda_load_swm(PyObject *self, PyObject *args) { + Py_ssize_t argc; + PyObject *argv[3] = { + 0 + }; + + if (!(argc = SWIG_Python_UnpackTuple(args, "gda_load_swm", 0, 2, argv))) SWIG_fail; + --argc; + if (argc == 1) { + int _v; + int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_gda_load_swm__SWIG_1(self, argc, argv); + } + } + if (argc == 2) { + int _v; + int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0); + _v = SWIG_CheckState(res); + if (_v) { + int res = swig::asptr(argv[1], (std::vector< int,std::allocator< int > >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_gda_load_swm__SWIG_0(self, argc, argv); + } + } + } + +fail: + SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'gda_load_swm'.\n" + " Possible C/C++ prototypes are:\n" + " gda_load_swm(char const *,std::vector< int,std::allocator< int > > const &)\n" + " gda_load_swm(char const *)\n"); + return 0; +} + + +SWIGINTERN PyObject *_wrap_gda_azp_greedy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + int arg1 ; + GeoDaWeight *arg2 = (GeoDaWeight *) 0 ; + std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *arg3 = 0 ; + std::string *arg4 = 0 ; + int arg5 ; + std::vector< std::pair< double,std::vector< double,std::allocator< double > > >,std::allocator< std::pair< double,std::vector< double,std::allocator< double > > > > > *arg6 = 0 ; + std::vector< std::pair< double,std::vector< double,std::allocator< double > > >,std::allocator< std::pair< double,std::vector< double,std::allocator< double > > > > > *arg7 = 0 ; + std::vector< int,std::allocator< int > > *arg8 = 0 ; + std::string *arg9 = 0 ; + int arg10 ; int val1 ; int ecode1 = 0 ; void *argp2 = 0 ; @@ -52518,38 +53154,34 @@ SWIGINTERN PyObject *_wrap_gda_azp_sa(PyObject *SWIGUNUSEDPARM(self), PyObject * int res4 = SWIG_OLDOBJ ; int val5 ; int ecode5 = 0 ; - double val6 ; - int ecode6 = 0 ; - int val7 ; - int ecode7 = 0 ; + int res6 = SWIG_OLDOBJ ; + int res7 = SWIG_OLDOBJ ; int res8 = SWIG_OLDOBJ ; int res9 = SWIG_OLDOBJ ; - int res10 = SWIG_OLDOBJ ; - int res11 = SWIG_OLDOBJ ; - int val12 ; - int ecode12 = 0 ; - PyObject *swig_obj[12] ; + int val10 ; + int ecode10 = 0 ; + PyObject *swig_obj[10] ; std::vector< std::vector< int,std::allocator< int > >,std::allocator< std::vector< int,std::allocator< int > > > > result; - if (!SWIG_Python_UnpackTuple(args, "gda_azp_sa", 12, 12, swig_obj)) SWIG_fail; + if (!SWIG_Python_UnpackTuple(args, "gda_azp_greedy", 10, 10, swig_obj)) SWIG_fail; ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gda_azp_sa" "', argument " "1"" of type '" "int""'"); + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gda_azp_greedy" "', argument " "1"" of type '" "int""'"); } arg1 = static_cast< int >(val1); res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_GeoDaWeight, 0 | 0 ); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "gda_azp_sa" "', argument " "2"" of type '" "GeoDaWeight *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "gda_azp_greedy" "', argument " "2"" of type '" "GeoDaWeight *""'"); } arg2 = reinterpret_cast< GeoDaWeight * >(argp2); { std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *ptr = (std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *)0; res3 = swig::asptr(swig_obj[2], &ptr); if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "gda_azp_sa" "', argument " "3"" of type '" "std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > const &""'"); + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "gda_azp_greedy" "', argument " "3"" of type '" "std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > const &""'"); } if (!ptr) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "gda_azp_sa" "', argument " "3"" of type '" "std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > const &""'"); + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "gda_azp_greedy" "', argument " "3"" of type '" "std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > const &""'"); } arg3 = ptr; } @@ -52557,80 +53189,226 @@ SWIGINTERN PyObject *_wrap_gda_azp_sa(PyObject *SWIGUNUSEDPARM(self), PyObject * std::string *ptr = (std::string *)0; res4 = SWIG_AsPtr_std_string(swig_obj[3], &ptr); if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "gda_azp_sa" "', argument " "4"" of type '" "std::string const &""'"); + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "gda_azp_greedy" "', argument " "4"" of type '" "std::string const &""'"); } if (!ptr) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "gda_azp_sa" "', argument " "4"" of type '" "std::string const &""'"); + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "gda_azp_greedy" "', argument " "4"" of type '" "std::string const &""'"); } arg4 = ptr; } ecode5 = SWIG_AsVal_int(swig_obj[4], &val5); if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "gda_azp_sa" "', argument " "5"" of type '" "int""'"); + SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "gda_azp_greedy" "', argument " "5"" of type '" "int""'"); } arg5 = static_cast< int >(val5); - ecode6 = SWIG_AsVal_double(swig_obj[5], &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "gda_azp_sa" "', argument " "6"" of type '" "double""'"); - } - arg6 = static_cast< double >(val6); - ecode7 = SWIG_AsVal_int(swig_obj[6], &val7); - if (!SWIG_IsOK(ecode7)) { - SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "gda_azp_sa" "', argument " "7"" of type '" "int""'"); - } - arg7 = static_cast< int >(val7); { std::vector< std::pair< double,std::vector< double,std::allocator< double > > >,std::allocator< std::pair< double,std::vector< double,std::allocator< double > > > > > *ptr = (std::vector< std::pair< double,std::vector< double,std::allocator< double > > >,std::allocator< std::pair< double,std::vector< double,std::allocator< double > > > > > *)0; - res8 = swig::asptr(swig_obj[7], &ptr); - if (!SWIG_IsOK(res8)) { - SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "gda_azp_sa" "', argument " "8"" of type '" "std::vector< std::pair< double,std::vector< double,std::allocator< double > > >,std::allocator< std::pair< double,std::vector< double,std::allocator< double > > > > > const &""'"); + res6 = swig::asptr(swig_obj[5], &ptr); + if (!SWIG_IsOK(res6)) { + SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "gda_azp_greedy" "', argument " "6"" of type '" "std::vector< std::pair< double,std::vector< double,std::allocator< double > > >,std::allocator< std::pair< double,std::vector< double,std::allocator< double > > > > > const &""'"); } if (!ptr) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "gda_azp_sa" "', argument " "8"" of type '" "std::vector< std::pair< double,std::vector< double,std::allocator< double > > >,std::allocator< std::pair< double,std::vector< double,std::allocator< double > > > > > const &""'"); + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "gda_azp_greedy" "', argument " "6"" of type '" "std::vector< std::pair< double,std::vector< double,std::allocator< double > > >,std::allocator< std::pair< double,std::vector< double,std::allocator< double > > > > > const &""'"); } - arg8 = ptr; + arg6 = ptr; } { std::vector< std::pair< double,std::vector< double,std::allocator< double > > >,std::allocator< std::pair< double,std::vector< double,std::allocator< double > > > > > *ptr = (std::vector< std::pair< double,std::vector< double,std::allocator< double > > >,std::allocator< std::pair< double,std::vector< double,std::allocator< double > > > > > *)0; - res9 = swig::asptr(swig_obj[8], &ptr); - if (!SWIG_IsOK(res9)) { - SWIG_exception_fail(SWIG_ArgError(res9), "in method '" "gda_azp_sa" "', argument " "9"" of type '" "std::vector< std::pair< double,std::vector< double,std::allocator< double > > >,std::allocator< std::pair< double,std::vector< double,std::allocator< double > > > > > const &""'"); + res7 = swig::asptr(swig_obj[6], &ptr); + if (!SWIG_IsOK(res7)) { + SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "gda_azp_greedy" "', argument " "7"" of type '" "std::vector< std::pair< double,std::vector< double,std::allocator< double > > >,std::allocator< std::pair< double,std::vector< double,std::allocator< double > > > > > const &""'"); } if (!ptr) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "gda_azp_sa" "', argument " "9"" of type '" "std::vector< std::pair< double,std::vector< double,std::allocator< double > > >,std::allocator< std::pair< double,std::vector< double,std::allocator< double > > > > > const &""'"); + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "gda_azp_greedy" "', argument " "7"" of type '" "std::vector< std::pair< double,std::vector< double,std::allocator< double > > >,std::allocator< std::pair< double,std::vector< double,std::allocator< double > > > > > const &""'"); } - arg9 = ptr; + arg7 = ptr; } { std::vector< int,std::allocator< int > > *ptr = (std::vector< int,std::allocator< int > > *)0; - res10 = swig::asptr(swig_obj[9], &ptr); - if (!SWIG_IsOK(res10)) { - SWIG_exception_fail(SWIG_ArgError(res10), "in method '" "gda_azp_sa" "', argument " "10"" of type '" "std::vector< int,std::allocator< int > > const &""'"); + res8 = swig::asptr(swig_obj[7], &ptr); + if (!SWIG_IsOK(res8)) { + SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "gda_azp_greedy" "', argument " "8"" of type '" "std::vector< int,std::allocator< int > > const &""'"); } if (!ptr) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "gda_azp_sa" "', argument " "10"" of type '" "std::vector< int,std::allocator< int > > const &""'"); + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "gda_azp_greedy" "', argument " "8"" of type '" "std::vector< int,std::allocator< int > > const &""'"); } - arg10 = ptr; + arg8 = ptr; } { std::string *ptr = (std::string *)0; - res11 = SWIG_AsPtr_std_string(swig_obj[10], &ptr); - if (!SWIG_IsOK(res11)) { - SWIG_exception_fail(SWIG_ArgError(res11), "in method '" "gda_azp_sa" "', argument " "11"" of type '" "std::string const &""'"); + res9 = SWIG_AsPtr_std_string(swig_obj[8], &ptr); + if (!SWIG_IsOK(res9)) { + SWIG_exception_fail(SWIG_ArgError(res9), "in method '" "gda_azp_greedy" "', argument " "9"" of type '" "std::string const &""'"); } if (!ptr) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "gda_azp_sa" "', argument " "11"" of type '" "std::string const &""'"); + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "gda_azp_greedy" "', argument " "9"" of type '" "std::string const &""'"); } - arg11 = ptr; + arg9 = ptr; } - ecode12 = SWIG_AsVal_int(swig_obj[11], &val12); - if (!SWIG_IsOK(ecode12)) { - SWIG_exception_fail(SWIG_ArgError(ecode12), "in method '" "gda_azp_sa" "', argument " "12"" of type '" "int""'"); + ecode10 = SWIG_AsVal_int(swig_obj[9], &val10); + if (!SWIG_IsOK(ecode10)) { + SWIG_exception_fail(SWIG_ArgError(ecode10), "in method '" "gda_azp_greedy" "', argument " "10"" of type '" "int""'"); } - arg12 = static_cast< int >(val12); + arg10 = static_cast< int >(val10); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = gda_azp_sa(arg1,arg2,(std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > const &)*arg3,(std::string const &)*arg4,arg5,arg6,arg7,(std::vector< std::pair< double,std::vector< double,std::allocator< double > > >,std::allocator< std::pair< double,std::vector< double,std::allocator< double > > > > > const &)*arg8,(std::vector< std::pair< double,std::vector< double,std::allocator< double > > >,std::allocator< std::pair< double,std::vector< double,std::allocator< double > > > > > const &)*arg9,(std::vector< int,std::allocator< int > > const &)*arg10,(std::string const &)*arg11,arg12); + result = gda_azp_greedy(arg1,arg2,(std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > const &)*arg3,(std::string const &)*arg4,arg5,(std::vector< std::pair< double,std::vector< double,std::allocator< double > > >,std::allocator< std::pair< double,std::vector< double,std::allocator< double > > > > > const &)*arg6,(std::vector< std::pair< double,std::vector< double,std::allocator< double > > >,std::allocator< std::pair< double,std::vector< double,std::allocator< double > > > > > const &)*arg7,(std::vector< int,std::allocator< int > > const &)*arg8,(std::string const &)*arg9,arg10); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = swig::from(static_cast< std::vector< std::vector< int,std::allocator< int > >,std::allocator< std::vector< int,std::allocator< int > > > > >(result)); + if (SWIG_IsNewObj(res3)) delete arg3; + if (SWIG_IsNewObj(res4)) delete arg4; + if (SWIG_IsNewObj(res6)) delete arg6; + if (SWIG_IsNewObj(res7)) delete arg7; + if (SWIG_IsNewObj(res8)) delete arg8; + if (SWIG_IsNewObj(res9)) delete arg9; + return resultobj; +fail: + if (SWIG_IsNewObj(res3)) delete arg3; + if (SWIG_IsNewObj(res4)) delete arg4; + if (SWIG_IsNewObj(res6)) delete arg6; + if (SWIG_IsNewObj(res7)) delete arg7; + if (SWIG_IsNewObj(res8)) delete arg8; + if (SWIG_IsNewObj(res9)) delete arg9; + return NULL; +} + + +SWIGINTERN PyObject *_wrap_gda_azp_sa(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + int arg1 ; + GeoDaWeight *arg2 = (GeoDaWeight *) 0 ; + std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *arg3 = 0 ; + std::string *arg4 = 0 ; + int arg5 ; + double arg6 ; + int arg7 ; + std::vector< std::pair< double,std::vector< double,std::allocator< double > > >,std::allocator< std::pair< double,std::vector< double,std::allocator< double > > > > > *arg8 = 0 ; + std::vector< std::pair< double,std::vector< double,std::allocator< double > > >,std::allocator< std::pair< double,std::vector< double,std::allocator< double > > > > > *arg9 = 0 ; + std::vector< int,std::allocator< int > > *arg10 = 0 ; + std::string *arg11 = 0 ; + int arg12 ; + int val1 ; + int ecode1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + int res3 = SWIG_OLDOBJ ; + int res4 = SWIG_OLDOBJ ; + int val5 ; + int ecode5 = 0 ; + double val6 ; + int ecode6 = 0 ; + int val7 ; + int ecode7 = 0 ; + int res8 = SWIG_OLDOBJ ; + int res9 = SWIG_OLDOBJ ; + int res10 = SWIG_OLDOBJ ; + int res11 = SWIG_OLDOBJ ; + int val12 ; + int ecode12 = 0 ; + PyObject *swig_obj[12] ; + std::vector< std::vector< int,std::allocator< int > >,std::allocator< std::vector< int,std::allocator< int > > > > result; + + if (!SWIG_Python_UnpackTuple(args, "gda_azp_sa", 12, 12, swig_obj)) SWIG_fail; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gda_azp_sa" "', argument " "1"" of type '" "int""'"); + } + arg1 = static_cast< int >(val1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_GeoDaWeight, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "gda_azp_sa" "', argument " "2"" of type '" "GeoDaWeight *""'"); + } + arg2 = reinterpret_cast< GeoDaWeight * >(argp2); + { + std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *ptr = (std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *)0; + res3 = swig::asptr(swig_obj[2], &ptr); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "gda_azp_sa" "', argument " "3"" of type '" "std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > const &""'"); + } + if (!ptr) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "gda_azp_sa" "', argument " "3"" of type '" "std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > const &""'"); + } + arg3 = ptr; + } + { + std::string *ptr = (std::string *)0; + res4 = SWIG_AsPtr_std_string(swig_obj[3], &ptr); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "gda_azp_sa" "', argument " "4"" of type '" "std::string const &""'"); + } + if (!ptr) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "gda_azp_sa" "', argument " "4"" of type '" "std::string const &""'"); + } + arg4 = ptr; + } + ecode5 = SWIG_AsVal_int(swig_obj[4], &val5); + if (!SWIG_IsOK(ecode5)) { + SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "gda_azp_sa" "', argument " "5"" of type '" "int""'"); + } + arg5 = static_cast< int >(val5); + ecode6 = SWIG_AsVal_double(swig_obj[5], &val6); + if (!SWIG_IsOK(ecode6)) { + SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "gda_azp_sa" "', argument " "6"" of type '" "double""'"); + } + arg6 = static_cast< double >(val6); + ecode7 = SWIG_AsVal_int(swig_obj[6], &val7); + if (!SWIG_IsOK(ecode7)) { + SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "gda_azp_sa" "', argument " "7"" of type '" "int""'"); + } + arg7 = static_cast< int >(val7); + { + std::vector< std::pair< double,std::vector< double,std::allocator< double > > >,std::allocator< std::pair< double,std::vector< double,std::allocator< double > > > > > *ptr = (std::vector< std::pair< double,std::vector< double,std::allocator< double > > >,std::allocator< std::pair< double,std::vector< double,std::allocator< double > > > > > *)0; + res8 = swig::asptr(swig_obj[7], &ptr); + if (!SWIG_IsOK(res8)) { + SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "gda_azp_sa" "', argument " "8"" of type '" "std::vector< std::pair< double,std::vector< double,std::allocator< double > > >,std::allocator< std::pair< double,std::vector< double,std::allocator< double > > > > > const &""'"); + } + if (!ptr) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "gda_azp_sa" "', argument " "8"" of type '" "std::vector< std::pair< double,std::vector< double,std::allocator< double > > >,std::allocator< std::pair< double,std::vector< double,std::allocator< double > > > > > const &""'"); + } + arg8 = ptr; + } + { + std::vector< std::pair< double,std::vector< double,std::allocator< double > > >,std::allocator< std::pair< double,std::vector< double,std::allocator< double > > > > > *ptr = (std::vector< std::pair< double,std::vector< double,std::allocator< double > > >,std::allocator< std::pair< double,std::vector< double,std::allocator< double > > > > > *)0; + res9 = swig::asptr(swig_obj[8], &ptr); + if (!SWIG_IsOK(res9)) { + SWIG_exception_fail(SWIG_ArgError(res9), "in method '" "gda_azp_sa" "', argument " "9"" of type '" "std::vector< std::pair< double,std::vector< double,std::allocator< double > > >,std::allocator< std::pair< double,std::vector< double,std::allocator< double > > > > > const &""'"); + } + if (!ptr) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "gda_azp_sa" "', argument " "9"" of type '" "std::vector< std::pair< double,std::vector< double,std::allocator< double > > >,std::allocator< std::pair< double,std::vector< double,std::allocator< double > > > > > const &""'"); + } + arg9 = ptr; + } + { + std::vector< int,std::allocator< int > > *ptr = (std::vector< int,std::allocator< int > > *)0; + res10 = swig::asptr(swig_obj[9], &ptr); + if (!SWIG_IsOK(res10)) { + SWIG_exception_fail(SWIG_ArgError(res10), "in method '" "gda_azp_sa" "', argument " "10"" of type '" "std::vector< int,std::allocator< int > > const &""'"); + } + if (!ptr) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "gda_azp_sa" "', argument " "10"" of type '" "std::vector< int,std::allocator< int > > const &""'"); + } + arg10 = ptr; + } + { + std::string *ptr = (std::string *)0; + res11 = SWIG_AsPtr_std_string(swig_obj[10], &ptr); + if (!SWIG_IsOK(res11)) { + SWIG_exception_fail(SWIG_ArgError(res11), "in method '" "gda_azp_sa" "', argument " "11"" of type '" "std::string const &""'"); + } + if (!ptr) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "gda_azp_sa" "', argument " "11"" of type '" "std::string const &""'"); + } + arg11 = ptr; + } + ecode12 = SWIG_AsVal_int(swig_obj[11], &val12); + if (!SWIG_IsOK(ecode12)) { + SWIG_exception_fail(SWIG_ArgError(ecode12), "in method '" "gda_azp_sa" "', argument " "12"" of type '" "int""'"); + } + arg12 = static_cast< int >(val12); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = gda_azp_sa(arg1,arg2,(std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > const &)*arg3,(std::string const &)*arg4,arg5,arg6,arg7,(std::vector< std::pair< double,std::vector< double,std::allocator< double > > >,std::allocator< std::pair< double,std::vector< double,std::allocator< double > > > > > const &)*arg8,(std::vector< std::pair< double,std::vector< double,std::allocator< double > > >,std::allocator< std::pair< double,std::vector< double,std::allocator< double > > > > > const &)*arg9,(std::vector< int,std::allocator< int > > const &)*arg10,(std::string const &)*arg11,arg12); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = swig::from(static_cast< std::vector< std::vector< int,std::allocator< int > >,std::allocator< std::vector< int,std::allocator< int > > > > >(result)); @@ -53826,6 +54604,388 @@ SWIGINTERN PyObject *_wrap_utf8_strlen(PyObject *SWIGUNUSEDPARM(self), PyObject } +SWIGINTERN PyObject *_wrap_RateStandardizeEB(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + int arg1 ; + double *arg2 = (double *) 0 ; + double *arg3 = (double *) 0 ; + double *arg4 = (double *) 0 ; + std::vector< bool,std::allocator< bool > > *arg5 = 0 ; + int val1 ; + int ecode1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + void *argp5 = 0 ; + int res5 = 0 ; + PyObject *swig_obj[5] ; + bool result; + + if (!SWIG_Python_UnpackTuple(args, "RateStandardizeEB", 5, 5, swig_obj)) SWIG_fail; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "RateStandardizeEB" "', argument " "1"" of type '" "int""'"); + } + arg1 = static_cast< int >(val1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_double, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "RateStandardizeEB" "', argument " "2"" of type '" "double const *""'"); + } + arg2 = reinterpret_cast< double * >(argp2); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_double, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "RateStandardizeEB" "', argument " "3"" of type '" "double const *""'"); + } + arg3 = reinterpret_cast< double * >(argp3); + res4 = SWIG_ConvertPtr(swig_obj[3], &argp4,SWIGTYPE_p_double, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "RateStandardizeEB" "', argument " "4"" of type '" "double *""'"); + } + arg4 = reinterpret_cast< double * >(argp4); + res5 = SWIG_ConvertPtr(swig_obj[4], &argp5, SWIGTYPE_p_std__vectorT_bool_std__allocatorT_bool_t_t, 0 ); + if (!SWIG_IsOK(res5)) { + SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "RateStandardizeEB" "', argument " "5"" of type '" "std::vector< bool,std::allocator< bool > > &""'"); + } + if (!argp5) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "RateStandardizeEB" "', argument " "5"" of type '" "std::vector< bool,std::allocator< bool > > &""'"); + } + arg5 = reinterpret_cast< std::vector< bool,std::allocator< bool > > * >(argp5); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (bool)GdaAlgs::RateStandardizeEB(arg1,(double const *)arg2,(double const *)arg3,arg4,*arg5); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_bool(static_cast< bool >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_RateSmoother_RawRate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + int arg1 ; + double *arg2 = (double *) 0 ; + double *arg3 = (double *) 0 ; + double *arg4 = (double *) 0 ; + std::vector< bool,std::allocator< bool > > *arg5 = 0 ; + int val1 ; + int ecode1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + void *argp5 = 0 ; + int res5 = 0 ; + PyObject *swig_obj[5] ; + bool result; + + if (!SWIG_Python_UnpackTuple(args, "RateSmoother_RawRate", 5, 5, swig_obj)) SWIG_fail; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "RateSmoother_RawRate" "', argument " "1"" of type '" "int""'"); + } + arg1 = static_cast< int >(val1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_double, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "RateSmoother_RawRate" "', argument " "2"" of type '" "double *""'"); + } + arg2 = reinterpret_cast< double * >(argp2); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_double, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "RateSmoother_RawRate" "', argument " "3"" of type '" "double *""'"); + } + arg3 = reinterpret_cast< double * >(argp3); + res4 = SWIG_ConvertPtr(swig_obj[3], &argp4,SWIGTYPE_p_double, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "RateSmoother_RawRate" "', argument " "4"" of type '" "double *""'"); + } + arg4 = reinterpret_cast< double * >(argp4); + res5 = SWIG_ConvertPtr(swig_obj[4], &argp5, SWIGTYPE_p_std__vectorT_bool_std__allocatorT_bool_t_t, 0 ); + if (!SWIG_IsOK(res5)) { + SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "RateSmoother_RawRate" "', argument " "5"" of type '" "std::vector< bool,std::allocator< bool > > &""'"); + } + if (!argp5) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "RateSmoother_RawRate" "', argument " "5"" of type '" "std::vector< bool,std::allocator< bool > > &""'"); + } + arg5 = reinterpret_cast< std::vector< bool,std::allocator< bool > > * >(argp5); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (bool)GdaAlgs::RateSmoother_RawRate(arg1,arg2,arg3,arg4,*arg5); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_bool(static_cast< bool >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_RateSmoother_ExcessRisk(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + int arg1 ; + double *arg2 = (double *) 0 ; + double *arg3 = (double *) 0 ; + double *arg4 = (double *) 0 ; + std::vector< bool,std::allocator< bool > > *arg5 = 0 ; + int val1 ; + int ecode1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + void *argp5 = 0 ; + int res5 = 0 ; + PyObject *swig_obj[5] ; + bool result; + + if (!SWIG_Python_UnpackTuple(args, "RateSmoother_ExcessRisk", 5, 5, swig_obj)) SWIG_fail; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "RateSmoother_ExcessRisk" "', argument " "1"" of type '" "int""'"); + } + arg1 = static_cast< int >(val1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_double, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "RateSmoother_ExcessRisk" "', argument " "2"" of type '" "double *""'"); + } + arg2 = reinterpret_cast< double * >(argp2); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_double, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "RateSmoother_ExcessRisk" "', argument " "3"" of type '" "double *""'"); + } + arg3 = reinterpret_cast< double * >(argp3); + res4 = SWIG_ConvertPtr(swig_obj[3], &argp4,SWIGTYPE_p_double, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "RateSmoother_ExcessRisk" "', argument " "4"" of type '" "double *""'"); + } + arg4 = reinterpret_cast< double * >(argp4); + res5 = SWIG_ConvertPtr(swig_obj[4], &argp5, SWIGTYPE_p_std__vectorT_bool_std__allocatorT_bool_t_t, 0 ); + if (!SWIG_IsOK(res5)) { + SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "RateSmoother_ExcessRisk" "', argument " "5"" of type '" "std::vector< bool,std::allocator< bool > > &""'"); + } + if (!argp5) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "RateSmoother_ExcessRisk" "', argument " "5"" of type '" "std::vector< bool,std::allocator< bool > > &""'"); + } + arg5 = reinterpret_cast< std::vector< bool,std::allocator< bool > > * >(argp5); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (bool)GdaAlgs::RateSmoother_ExcessRisk(arg1,arg2,arg3,arg4,*arg5); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_bool(static_cast< bool >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_RateSmoother_EBS(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + int arg1 ; + double *arg2 = (double *) 0 ; + double *arg3 = (double *) 0 ; + double *arg4 = (double *) 0 ; + std::vector< bool,std::allocator< bool > > *arg5 = 0 ; + int val1 ; + int ecode1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + void *argp5 = 0 ; + int res5 = 0 ; + PyObject *swig_obj[5] ; + bool result; + + if (!SWIG_Python_UnpackTuple(args, "RateSmoother_EBS", 5, 5, swig_obj)) SWIG_fail; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "RateSmoother_EBS" "', argument " "1"" of type '" "int""'"); + } + arg1 = static_cast< int >(val1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_double, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "RateSmoother_EBS" "', argument " "2"" of type '" "double *""'"); + } + arg2 = reinterpret_cast< double * >(argp2); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_double, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "RateSmoother_EBS" "', argument " "3"" of type '" "double *""'"); + } + arg3 = reinterpret_cast< double * >(argp3); + res4 = SWIG_ConvertPtr(swig_obj[3], &argp4,SWIGTYPE_p_double, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "RateSmoother_EBS" "', argument " "4"" of type '" "double *""'"); + } + arg4 = reinterpret_cast< double * >(argp4); + res5 = SWIG_ConvertPtr(swig_obj[4], &argp5, SWIGTYPE_p_std__vectorT_bool_std__allocatorT_bool_t_t, 0 ); + if (!SWIG_IsOK(res5)) { + SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "RateSmoother_EBS" "', argument " "5"" of type '" "std::vector< bool,std::allocator< bool > > &""'"); + } + if (!argp5) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "RateSmoother_EBS" "', argument " "5"" of type '" "std::vector< bool,std::allocator< bool > > &""'"); + } + arg5 = reinterpret_cast< std::vector< bool,std::allocator< bool > > * >(argp5); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (bool)GdaAlgs::RateSmoother_EBS(arg1,arg2,arg3,arg4,*arg5); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_bool(static_cast< bool >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_RateSmoother_SEBS(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + int arg1 ; + GeoDaWeight *arg2 = (GeoDaWeight *) 0 ; + double *arg3 = (double *) 0 ; + double *arg4 = (double *) 0 ; + double *arg5 = (double *) 0 ; + std::vector< bool,std::allocator< bool > > *arg6 = 0 ; + int val1 ; + int ecode1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + void *argp5 = 0 ; + int res5 = 0 ; + void *argp6 = 0 ; + int res6 = 0 ; + PyObject *swig_obj[6] ; + bool result; + + if (!SWIG_Python_UnpackTuple(args, "RateSmoother_SEBS", 6, 6, swig_obj)) SWIG_fail; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "RateSmoother_SEBS" "', argument " "1"" of type '" "int""'"); + } + arg1 = static_cast< int >(val1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_GeoDaWeight, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "RateSmoother_SEBS" "', argument " "2"" of type '" "GeoDaWeight *""'"); + } + arg2 = reinterpret_cast< GeoDaWeight * >(argp2); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_double, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "RateSmoother_SEBS" "', argument " "3"" of type '" "double *""'"); + } + arg3 = reinterpret_cast< double * >(argp3); + res4 = SWIG_ConvertPtr(swig_obj[3], &argp4,SWIGTYPE_p_double, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "RateSmoother_SEBS" "', argument " "4"" of type '" "double *""'"); + } + arg4 = reinterpret_cast< double * >(argp4); + res5 = SWIG_ConvertPtr(swig_obj[4], &argp5,SWIGTYPE_p_double, 0 | 0 ); + if (!SWIG_IsOK(res5)) { + SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "RateSmoother_SEBS" "', argument " "5"" of type '" "double *""'"); + } + arg5 = reinterpret_cast< double * >(argp5); + res6 = SWIG_ConvertPtr(swig_obj[5], &argp6, SWIGTYPE_p_std__vectorT_bool_std__allocatorT_bool_t_t, 0 ); + if (!SWIG_IsOK(res6)) { + SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "RateSmoother_SEBS" "', argument " "6"" of type '" "std::vector< bool,std::allocator< bool > > &""'"); + } + if (!argp6) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "RateSmoother_SEBS" "', argument " "6"" of type '" "std::vector< bool,std::allocator< bool > > &""'"); + } + arg6 = reinterpret_cast< std::vector< bool,std::allocator< bool > > * >(argp6); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (bool)GdaAlgs::RateSmoother_SEBS(arg1,arg2,arg3,arg4,arg5,*arg6); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_bool(static_cast< bool >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_RateSmoother_SRS(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + int arg1 ; + GeoDaWeight *arg2 = (GeoDaWeight *) 0 ; + double *arg3 = (double *) 0 ; + double *arg4 = (double *) 0 ; + double *arg5 = (double *) 0 ; + std::vector< bool,std::allocator< bool > > *arg6 = 0 ; + int val1 ; + int ecode1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + void *argp5 = 0 ; + int res5 = 0 ; + void *argp6 = 0 ; + int res6 = 0 ; + PyObject *swig_obj[6] ; + bool result; + + if (!SWIG_Python_UnpackTuple(args, "RateSmoother_SRS", 6, 6, swig_obj)) SWIG_fail; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "RateSmoother_SRS" "', argument " "1"" of type '" "int""'"); + } + arg1 = static_cast< int >(val1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_GeoDaWeight, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "RateSmoother_SRS" "', argument " "2"" of type '" "GeoDaWeight *""'"); + } + arg2 = reinterpret_cast< GeoDaWeight * >(argp2); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_double, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "RateSmoother_SRS" "', argument " "3"" of type '" "double *""'"); + } + arg3 = reinterpret_cast< double * >(argp3); + res4 = SWIG_ConvertPtr(swig_obj[3], &argp4,SWIGTYPE_p_double, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "RateSmoother_SRS" "', argument " "4"" of type '" "double *""'"); + } + arg4 = reinterpret_cast< double * >(argp4); + res5 = SWIG_ConvertPtr(swig_obj[4], &argp5,SWIGTYPE_p_double, 0 | 0 ); + if (!SWIG_IsOK(res5)) { + SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "RateSmoother_SRS" "', argument " "5"" of type '" "double *""'"); + } + arg5 = reinterpret_cast< double * >(argp5); + res6 = SWIG_ConvertPtr(swig_obj[5], &argp6, SWIGTYPE_p_std__vectorT_bool_std__allocatorT_bool_t_t, 0 ); + if (!SWIG_IsOK(res6)) { + SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "RateSmoother_SRS" "', argument " "6"" of type '" "std::vector< bool,std::allocator< bool > > &""'"); + } + if (!argp6) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "RateSmoother_SRS" "', argument " "6"" of type '" "std::vector< bool,std::allocator< bool > > &""'"); + } + arg6 = reinterpret_cast< std::vector< bool,std::allocator< bool > > * >(argp6); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (bool)GdaAlgs::RateSmoother_SRS(arg1,arg2,arg3,arg4,arg5,*arg6); + SWIG_PYTHON_THREAD_END_ALLOW; + } + resultobj = SWIG_From_bool(static_cast< bool >(result)); + return resultobj; +fail: + return NULL; +} + + SWIGINTERN PyObject *_wrap_SuggestDoubleParams(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; int arg1 ; @@ -65591,6 +66751,7 @@ static PyMethodDef SwigMethods[] = { { "VecPair_swigregister", VecPair_swigregister, METH_O, NULL}, { "VecPair_swiginit", VecPair_swiginit, METH_VARARGS, NULL}, { "delete_GeoDaWeight", _wrap_delete_GeoDaWeight, METH_O, NULL}, + { "GeoDaWeight_CheckConnectivity", _wrap_GeoDaWeight_CheckConnectivity, METH_O, NULL}, { "GeoDaWeight_CheckNeighbor", _wrap_GeoDaWeight_CheckNeighbor, METH_VARARGS, NULL}, { "GeoDaWeight_GetNeighbors", _wrap_GeoDaWeight_GetNeighbors, METH_VARARGS, NULL}, { "GeoDaWeight_GetNeighborWeights", _wrap_GeoDaWeight_GetNeighborWeights, METH_VARARGS, NULL}, @@ -65600,6 +66761,8 @@ static PyMethodDef SwigMethods[] = { { "GeoDaWeight_GetNbrSize", _wrap_GeoDaWeight_GetNbrSize, METH_VARARGS, NULL}, { "GeoDaWeight_SpatialLag", _wrap_GeoDaWeight_SpatialLag, METH_VARARGS, NULL}, { "GeoDaWeight_Save", _wrap_GeoDaWeight_Save, METH_VARARGS, NULL}, + { "GeoDaWeight_SetNeighbors", _wrap_GeoDaWeight_SetNeighbors, METH_VARARGS, NULL}, + { "GeoDaWeight_SetNeighborsAndWeights", _wrap_GeoDaWeight_SetNeighborsAndWeights, METH_VARARGS, NULL}, { "GeoDaWeight_IsSymmetric", _wrap_GeoDaWeight_IsSymmetric, METH_O, NULL}, { "GeoDaWeight_GetSparsity", _wrap_GeoDaWeight_GetSparsity, METH_O, NULL}, { "GeoDaWeight_GetMinNbrs", _wrap_GeoDaWeight_GetMinNbrs, METH_O, NULL}, @@ -65608,6 +66771,7 @@ static PyMethodDef SwigMethods[] = { { "GeoDaWeight_GetMedianNbrs", _wrap_GeoDaWeight_GetMedianNbrs, METH_O, NULL}, { "GeoDaWeight_GetNumObs", _wrap_GeoDaWeight_GetNumObs, METH_O, NULL}, { "GeoDaWeight_IsInternalUse", _wrap_GeoDaWeight_IsInternalUse, METH_O, NULL}, + { "GeoDaWeight_IsMasked", _wrap_GeoDaWeight_IsMasked, METH_VARARGS, NULL}, { "GeoDaWeight_GetTitle", _wrap_GeoDaWeight_GetTitle, METH_O, NULL}, { "GeoDaWeight_GetIDName", _wrap_GeoDaWeight_GetIDName, METH_O, NULL}, { "GeoDaWeight_GetUID", _wrap_GeoDaWeight_GetUID, METH_O, NULL}, @@ -65826,9 +66990,12 @@ static PyMethodDef SwigMethods[] = { { "gda_queen_weights", _wrap_gda_queen_weights, METH_VARARGS, NULL}, { "gda_rook_weights", _wrap_gda_rook_weights, METH_VARARGS, NULL}, { "gda_knn_weights", _wrap_gda_knn_weights, METH_VARARGS, NULL}, + { "gda_knn_weights_sub", _wrap_gda_knn_weights_sub, METH_VARARGS, NULL}, { "gda_min_distthreshold", _wrap_gda_min_distthreshold, METH_VARARGS, NULL}, { "gda_distance_weights", _wrap_gda_distance_weights, METH_VARARGS, NULL}, - { "gda_load_weights", _wrap_gda_load_weights, METH_O, NULL}, + { "gda_load_gal", _wrap_gda_load_gal, METH_VARARGS, NULL}, + { "gda_load_gwt", _wrap_gda_load_gwt, METH_VARARGS, NULL}, + { "gda_load_swm", _wrap_gda_load_swm, METH_VARARGS, NULL}, { "gda_azp_greedy", _wrap_gda_azp_greedy, METH_VARARGS, NULL}, { "gda_azp_sa", _wrap_gda_azp_sa, METH_VARARGS, NULL}, { "gda_azp_tabu", _wrap_gda_azp_tabu, METH_VARARGS, NULL}, @@ -65843,6 +67010,12 @@ static PyMethodDef SwigMethods[] = { { "gda_withinsumofsquare", _wrap_gda_withinsumofsquare, METH_VARARGS, NULL}, { "gda_betweensumofsquare", _wrap_gda_betweensumofsquare, METH_VARARGS, NULL}, { "utf8_strlen", _wrap_utf8_strlen, METH_O, NULL}, + { "RateStandardizeEB", _wrap_RateStandardizeEB, METH_VARARGS, NULL}, + { "RateSmoother_RawRate", _wrap_RateSmoother_RawRate, METH_VARARGS, NULL}, + { "RateSmoother_ExcessRisk", _wrap_RateSmoother_ExcessRisk, METH_VARARGS, NULL}, + { "RateSmoother_EBS", _wrap_RateSmoother_EBS, METH_VARARGS, NULL}, + { "RateSmoother_SEBS", _wrap_RateSmoother_SEBS, METH_VARARGS, NULL}, + { "RateSmoother_SRS", _wrap_RateSmoother_SRS, METH_VARARGS, NULL}, { "SuggestDoubleParams", _wrap_SuggestDoubleParams, METH_VARARGS, NULL}, { "GetMaxDouble", _wrap_GetMaxDouble, METH_VARARGS, NULL}, { "GetMaxDoubleString", _wrap_GetMaxDoubleString, METH_VARARGS, NULL}, diff --git a/pygeoda/libgeoda.py b/pygeoda/libgeoda.py index f0e5846..0b2b34d 100644 --- a/pygeoda/libgeoda.py +++ b/pygeoda/libgeoda.py @@ -1959,6 +1959,9 @@ def __init__(self, *args, **kwargs): __repr__ = _swig_repr __swig_destroy__ = _libgeoda.delete_GeoDaWeight + def CheckConnectivity(self): + return _libgeoda.GeoDaWeight_CheckConnectivity(self) + def CheckNeighbor(self, obs_idx, nbr_idx): return _libgeoda.GeoDaWeight_CheckNeighbor(self, obs_idx, nbr_idx) @@ -1986,6 +1989,12 @@ def SpatialLag(self, obs_idx, data): def Save(self, *args): return _libgeoda.GeoDaWeight_Save(self, *args) + def SetNeighbors(self, id, nbr_ids): + return _libgeoda.GeoDaWeight_SetNeighbors(self, id, nbr_ids) + + def SetNeighborsAndWeights(self, id, nbr_ids, w): + return _libgeoda.GeoDaWeight_SetNeighborsAndWeights(self, id, nbr_ids, w) + def IsSymmetric(self): return _libgeoda.GeoDaWeight_IsSymmetric(self) @@ -2010,6 +2019,9 @@ def GetNumObs(self): def IsInternalUse(self): return _libgeoda.GeoDaWeight_IsInternalUse(self) + def IsMasked(self, obs_idx): + return _libgeoda.GeoDaWeight_IsMasked(self, obs_idx) + def GetTitle(self): return _libgeoda.GeoDaWeight_GetTitle(self) @@ -2528,8 +2540,8 @@ def gda_fdr(lisa, current_p): def gda_bo(lisa, current_p): return _libgeoda.gda_bo(lisa, current_p) -def gda_neighbor_match_test(geoda, k, power, is_inverse, is_arc, is_mile, data, scale_method, dist_type): - return _libgeoda.gda_neighbor_match_test(geoda, k, power, is_inverse, is_arc, is_mile, data, scale_method, dist_type) +def gda_neighbor_match_test(*args): + return _libgeoda.gda_neighbor_match_test(*args) def gda_demean(data): return _libgeoda.gda_demean(data) @@ -2570,8 +2582,11 @@ def gda_queen_weights(geoda, order, include_lower_order, precision_threshold): def gda_rook_weights(geoda, order, include_lower_order, precision_threshold): return _libgeoda.gda_rook_weights(geoda, order, include_lower_order, precision_threshold) -def gda_knn_weights(geoda, k, power, is_inverse, is_arc, is_mile, kernel, bandwidth, adaptive_bandwidth, use_kernel_diagnals, polyid): - return _libgeoda.gda_knn_weights(geoda, k, power, is_inverse, is_arc, is_mile, kernel, bandwidth, adaptive_bandwidth, use_kernel_diagnals, polyid) +def gda_knn_weights(geoda, k, power, is_inverse, is_arc, is_mile, kernel, bandwidth, adaptive_bandwidth, use_kernel_diagonals, polyid): + return _libgeoda.gda_knn_weights(geoda, k, power, is_inverse, is_arc, is_mile, kernel, bandwidth, adaptive_bandwidth, use_kernel_diagonals, polyid) + +def gda_knn_weights_sub(geoda, k, start, end, power, is_inverse, is_arc, is_mile, kernel, bandwidth, adaptive_bandwidth, use_kernel_diagonals, polyid): + return _libgeoda.gda_knn_weights_sub(geoda, k, start, end, power, is_inverse, is_arc, is_mile, kernel, bandwidth, adaptive_bandwidth, use_kernel_diagonals, polyid) def gda_min_distthreshold(geoda, is_arc, is_mile): return _libgeoda.gda_min_distthreshold(geoda, is_arc, is_mile) @@ -2579,8 +2594,14 @@ def gda_min_distthreshold(geoda, is_arc, is_mile): def gda_distance_weights(geoda, dist_thres, polyid, power, is_inverse, is_arc, is_mile, kernel, use_kernel_diagonals): return _libgeoda.gda_distance_weights(geoda, dist_thres, polyid, power, is_inverse, is_arc, is_mile, kernel, use_kernel_diagonals) -def gda_load_weights(weights_path): - return _libgeoda.gda_load_weights(weights_path) +def gda_load_gal(*args): + return _libgeoda.gda_load_gal(*args) + +def gda_load_gwt(*args): + return _libgeoda.gda_load_gwt(*args) + +def gda_load_swm(*args): + return _libgeoda.gda_load_swm(*args) def gda_azp_greedy(p, w, _data, scale_method, inits, min_bounds, max_bounds, init_regions, distance_method, rnd_seed): return _libgeoda.gda_azp_greedy(p, w, _data, scale_method, inits, min_bounds, max_bounds, init_regions, distance_method, rnd_seed) @@ -2624,6 +2645,24 @@ def gda_betweensumofsquare(solution, data): def utf8_strlen(str): return _libgeoda.utf8_strlen(str) +def RateStandardizeEB(nObs, P, E, results, undefined): + return _libgeoda.RateStandardizeEB(nObs, P, E, results, undefined) + +def RateSmoother_RawRate(obs, P, E, results, undefined): + return _libgeoda.RateSmoother_RawRate(obs, P, E, results, undefined) + +def RateSmoother_ExcessRisk(obs, P, E, results, undefined): + return _libgeoda.RateSmoother_ExcessRisk(obs, P, E, results, undefined) + +def RateSmoother_EBS(obs, P, E, results, undefined): + return _libgeoda.RateSmoother_EBS(obs, P, E, results, undefined) + +def RateSmoother_SEBS(obs, w, P, E, results, undefined): + return _libgeoda.RateSmoother_SEBS(obs, w, P, E, results, undefined) + +def RateSmoother_SRS(obs, w, P, E, results, undefined): + return _libgeoda.RateSmoother_SRS(obs, w, P, E, results, undefined) + def SuggestDoubleParams(length, decimals, suggest_len, suggest_dec): return _libgeoda.SuggestDoubleParams(length, decimals, suggest_len, suggest_dec) diff --git a/pygeoda/weights/__init__.py b/pygeoda/weights/__init__.py index 644790f..1b003ad 100644 --- a/pygeoda/weights/__init__.py +++ b/pygeoda/weights/__init__.py @@ -5,4 +5,4 @@ from .rook import rook_weights from .distance import distance_weights, min_distthreshold, knn_weights from .kernel import kernel_weights, kernel_knn_weights -from .weight import Weight \ No newline at end of file +from .weight import Weight, read_gal, read_gwt, read_swm \ No newline at end of file diff --git a/pygeoda/weights/weight.py b/pygeoda/weights/weight.py index 980e481..2a12f95 100644 --- a/pygeoda/weights/weight.py +++ b/pygeoda/weights/weight.py @@ -1,4 +1,4 @@ -from ..libgeoda import VecInt64 +from ..libgeoda import GeoDa, VecInt, VecInt64, gda_load_gal, gda_load_gwt, gda_load_swm, GeoDaWeight __author__ = "Xun Li " @@ -180,4 +180,83 @@ def __repr__(self): info += '{0:>24} {1:>20}\n'.format("# mean neighbors:", self.mean_neighbors()) info += '{0:>24} {1:>20}\n'.format("# median neighbors:", self.median_neighbors()) info += '{0:>24} {1:>20}\n'.format("has isolates:", "True" if self.has_isolates() else "False") - return info \ No newline at end of file + return info + +def read_gal(file_path, id_vec): + """Read GAL Weights + Create a spatial weights object from a .GAL file + + Args: + file_path (str): The file paht of the .GAL file + id_vec (tuple): The id values used in the .GAL file. e.g. [1,2,3,4,...] + + Returns: + Weight: An instance of Weight class + """ + + f = open(file_path) + first_line = f.readline() + + items = first_line.split(" ") + + if len(items) < 1: + raise ValueError("The content of weights file is not correct.") + + num_obs = int(items[1]) + + if len(id_vec) != num_obs: + raise ValueError("The id_vec size does not match the number of observations in weights file.") + + gda_w = gda_load_gal(file_path, id_vec) + + return Weight(gda_w) + +def read_gwt(file_path, id_vec): + """Read GWT Weights + Create a spatial weights object from a .GWT file + + Args: + file_path (str): The file paht of the .GAL file + id_vec (tuple): The id values used in the .GAL file. e.g. [1,2,3,4,...] + + Returns: + Weight: An instance of Weight class + """ + + f = open(file_path) + first_line = f.readline() + + items = first_line.split(" ") + + if len(items) < 1: + raise ValueError("The content of weights file is not correct.") + + num_obs = int(items[1]) + + if len(id_vec) != num_obs: + raise ValueError("The id_vec size does not match the number of observations in weights file.") + + gda_w = gda_load_gwt(file_path, id_vec) + + return Weight(gda_w) + +def read_swm(file_path, **kwargs): + """Read SWM Weights + Create a spatial weights object from a .swm file + + Args: + file_path (str): The file paht of the .swm file + id_vec (tuple): The id values used in the .sfile. e.g. [1,2,3,4,...] (optional) + + Returns: + Weight: An instance of Weight class + """ + + id_vec = [] if 'id_vec' not in kwargs else kwargs['id_vec'] + + if not all(isinstance(x, int) for x in id_vec): + raise ValueError("The values of id_vec has to be integer type.") + + gda_w = gda_load_swm(file_path, VecInt(id_vec)) + + return Weight(gda_w) diff --git a/setup.py b/setup.py index dacecf0..7cb1098 100644 --- a/setup.py +++ b/setup.py @@ -202,7 +202,7 @@ extra_objects=EXTRA_OBJECTS),] setup (name = 'pygeoda', - version = '0.0.8', + version = '0.0.8-1', author = "Xun Li", author_email = "lixun910@gmail.com", url = "https://github.com/geodacenter/pygeoda",